# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
800454 | 2023-08-01T15:06:07 Z | Tunglam07 | Med (COCI22_med) | C++17 | 1 ms | 320 KB |
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; int sum[n+1]; string s[n+1]; for(int i=0; i<n; i++) { cin>>s[i]; for(int j=0; j<5; j++) { int day; cin>>day; sum[i]+=day; } } for(int i=0; i<n; i++) { int minn=n, maxx=n; int misum=sum[i]+500, masum=sum[i]-500; for(int j=0; j<n; j++) { if(i==j) { continue; } if(misum>sum[j]||misum==sum[j]&&s[i]<s[j]) { minn--; } if(masum>sum[j]||masum==sum[j]&&s[i]<s[j]) { maxx--; } } cout<<minn<<" "<<maxx<<"\n"; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Incorrect | 1 ms | 320 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Incorrect | 1 ms | 320 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |