Submission #53105726
Source Code Expand
Copy
#include <bits/stdc++.h>#define ll long longusing namespace std;const int maxn=2e5+10;int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int n;ll a,b;ll mmax=-1;ll sum=0;cin>>n;for(int i=1;i<=n;i++){cin>>a>>b;sum+=a;mmax=max(mmax,b-a);}cout<<sum+mmax<<endl;
#include <bits/stdc++.h> #define ll long long using namespace std; const int maxn=2e5+10; int main() { ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); int n; ll a,b; ll mmax=-1; ll sum=0; cin>>n; for(int i=1;i<=n;i++) { cin>>a>>b; sum+=a; mmax=max(mmax,b-a); } cout<<sum+mmax<<endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Standing On The Shoulders |
User | frankstein |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 352 Byte |
Status | AC |
Exec Time | 22 ms |
Memory | 3608 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt, sample02.txt |
All | sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3456 KB |
sample01.txt | AC | 1 ms | 3456 KB |
sample02.txt | AC | 1 ms | 3460 KB |
testcase00.txt | AC | 20 ms | 3480 KB |
testcase01.txt | AC | 21 ms | 3464 KB |
testcase02.txt | AC | 20 ms | 3328 KB |
testcase03.txt | AC | 22 ms | 3388 KB |
testcase04.txt | AC | 21 ms | 3536 KB |
testcase05.txt | AC | 21 ms | 3392 KB |
testcase06.txt | AC | 20 ms | 3352 KB |
testcase07.txt | AC | 21 ms | 3424 KB |
testcase08.txt | AC | 21 ms | 3392 KB |
testcase09.txt | AC | 22 ms | 3608 KB |
testcase10.txt | AC | 20 ms | 3464 KB |
testcase11.txt | AC | 22 ms | 3472 KB |
testcase12.txt | AC | 20 ms | 3464 KB |
testcase13.txt | AC | 22 ms | 3460 KB |
testcase14.txt | AC | 21 ms | 3524 KB |
testcase15.txt | AC | 21 ms | 3392 KB |
testcase16.txt | AC | 20 ms | 3604 KB |
testcase17.txt | AC | 21 ms | 3424 KB |
testcase18.txt | AC | 20 ms | 3376 KB |
testcase19.txt | AC | 22 ms | 3388 KB |