Submission #53101160
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define INF 0x3f3f3f3f#define endl '\n'using namespace std;const int N=2e5+233;ll n,a[N],b[N];ll ans , tmp;int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cin>>n;for(int i=1;i<=n;i++){cin>>a[i]>>b[i];ans += a[i];tmp = max(tmp , b[i] - a[i]);}
#include<bits/stdc++.h> #define ll long long #define INF 0x3f3f3f3f #define endl '\n' using namespace std; const int N=2e5+233; ll n,a[N],b[N]; ll ans , tmp; int main(){ ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]>>b[i]; ans += a[i]; tmp = max(tmp , b[i] - a[i]); } cout<<ans + tmp; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Standing On The Shoulders |
User | wusixie |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 387 Byte |
Status | AC |
Exec Time | 23 ms |
Memory | 6656 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 | 3472 KB |
sample01.txt | AC | 1 ms | 3608 KB |
sample02.txt | AC | 1 ms | 3532 KB |
testcase00.txt | AC | 21 ms | 6392 KB |
testcase01.txt | AC | 22 ms | 6576 KB |
testcase02.txt | AC | 21 ms | 6364 KB |
testcase03.txt | AC | 22 ms | 6596 KB |
testcase04.txt | AC | 22 ms | 6456 KB |
testcase05.txt | AC | 22 ms | 6656 KB |
testcase06.txt | AC | 21 ms | 6356 KB |
testcase07.txt | AC | 22 ms | 6600 KB |
testcase08.txt | AC | 22 ms | 6560 KB |
testcase09.txt | AC | 22 ms | 6596 KB |
testcase10.txt | AC | 20 ms | 6340 KB |
testcase11.txt | AC | 22 ms | 6588 KB |
testcase12.txt | AC | 21 ms | 6352 KB |
testcase13.txt | AC | 23 ms | 6600 KB |
testcase14.txt | AC | 22 ms | 6644 KB |
testcase15.txt | AC | 22 ms | 6588 KB |
testcase16.txt | AC | 21 ms | 6288 KB |
testcase17.txt | AC | 22 ms | 6596 KB |
testcase18.txt | AC | 21 ms | 6264 KB |
testcase19.txt | AC | 22 ms | 6588 KB |