0% found this document useful (0 votes)
8 views10 pages

Atcoderbeginercontest 432

The document outlines a programming problem where Takahashi sets task goals for N days and the objective is to count the number of days he completed more tasks than his goals. It includes constraints, input-output format, and sample inputs with corresponding outputs. The solution is provided in C++ code that reads the input, compares the completed tasks with the goals, and outputs the count of successful days.

Uploaded by

Nguyễn Danh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views10 pages

Atcoderbeginercontest 432

The document outlines a programming problem where Takahashi sets task goals for N days and the objective is to count the number of days he completed more tasks than his goals. It includes constraints, input-output format, and sample inputs with corresponding outputs. The solution is provided in C++ code that reads the input, compares the completed tasks with the goals, and outputs the count of successful days.

Uploaded by

Nguyễn Danh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mục lục

A-Task Failed Successfully 1

B-Precondition 4

C-Giant Domino 5

D-Make 2-Regular Graph 6

E-LCM Sequence 7

F-Stocks 4 8

G-Degree Harmony 9
A-Task Failed Successfully

Problem Statement
Takahashi set task goals for N days.
He aimed to complete Ai tasks on day i(i ≤ i ≤ N),and actually completed Bi tasks.
Find the number of days when he completed more tasks than his goal.

Constraints

• 1 ≤ N ≤ 100

• 1 ≤ Ai , Bi ≤ 100

• All input values are integers.

Input
The input is given from Standard Input in the following format:

A1 B1

A2 B2
..
.

AN BN

Output
Output the answer.
Sample Input 1

2 8

5 5

5 4

6 7

1
Sample Output 1

Sample Input 2

1 1

1 1

1 1

1 1

1 1

Sample Output 2

Sample Input 3

1 6

2 5

3 4

4 3

5 2

6 1

Sample Output 3

Solution
1 # include < iostream >
2 using namespace std ;

2
3

4 int main () {
5 int n , a , b ;
6 cin >> n ;
7 int ans = 0;
8 for ( int i = 1; i <= n ; i ++) {
9 cin >> a >> b ;
10 if ( a < b ) ans ++;
11 }
12 cout << ans << endl ;
13 return 0;
14 }

3
B-Precondition

4
C-Giant Domino

5
D-Make 2-Regular Graph

6
E-LCM Sequence

7
F-Stocks 4

8
G-Degree Harmony

You might also like