This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int bezw(int K)
{
if(K<0){K*=-1;}
return K;
}
int main()
{
int N;
cin >> N;
int A[N] , B[N];
for(int i=0;i<N;i++)
{
cin >> A[i] >> B[i];
}
int nadmiar=0,wynik=0;
for(int i=0;i<N;i++)
{
nadmiar+=A[i]-B[i];
wynik+=bezw(nadmiar);
}
cout <<wynik;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |