# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
83674 | 2018-11-09T18:31:23 Z | nikolapesic2802 | Sticks (POI11_pat) | C++14 | 610 ms | 33792 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back void fastscan(int &n) { bool minus=false; n=0; register int c=getchar(); if(c=='-') { minus=true; c=getchar(); } while(c>='0'&&c<='9') { n*=10; n+=c-'0'; c=getchar(); } if(minus) n*=-1; } int main() { int k; //scanf("%i",&k); fastscan(k); vector<set<int> > sets(k); for(int i=0;i<k;i++) { sets[i].insert(INT_MAX); int n; //scanf("%i",&n); fastscan(n); for(int j=0;j<n;j++) { int a; //scanf("%i",&a); fastscan(a); sets[i].insert(a); } } for(int i=0;i<k;i++) { for(auto p:sets[i]) { if(p==INT_MAX) continue; int m1=INT_MAX,m2=INT_MAX,c1,c2; int ma1=-1,ma2=-1,ca1,ca2; for(int j=0;j<k;j++) { if(i==j) continue; set<int>::iterator it=sets[j].lower_bound(p); int v=*it; if(v<m1) { m2=m1; c2=c1; m1=v; c1=j; } else { if(v<m2) { m2=v; c2=j; } } it--; if(it==sets[j].begin()) continue; v=*it; if(v>ma1) { ma2=ma1; ca2=ca1; ma1=v; ca1=j; } else { if(v>ma2) { ma2=v; ca2=j; } } } if(m1!=INT_MAX&&m2!=INT_MAX) { if(p+m1>m2) { printf("%i %i %i %i %i %i\n",i+1,p,c1+1,m1,c2+1,m2); return 0; } } if(ma1!=-1&&ma2!=-1&&ma1<p&&ma2<p) { if(ma1+ma2>p) { printf("%i %i %i %i %i %i\n",i+1,p,ca1+1,ma1,ca2+1,ma2); return 0; } } } } printf("NIE\n"); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 504 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 564 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 564 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 572 KB | Output is correct |
2 | Incorrect | 2 ms | 652 KB | Expected EOF |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 680 KB | Expected EOF |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 700 KB | Expected EOF |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 1092 KB | Expected EOF |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 11 ms | 2220 KB | Expected EOF |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 28 ms | 4856 KB | Expected EOF |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 343 ms | 30044 KB | Output is correct |
2 | Correct | 206 ms | 30044 KB | Output is correct |
3 | Incorrect | 138 ms | 30044 KB | Expected EOF |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 270 ms | 33792 KB | Memory limit exceeded: We have a known bug that the memory usage is measured incorrectly (possibly because of Meltdown/Spectre patch), so your solution may be correct. Please submit again. Sorry for the inconvenience. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 610 ms | 33792 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 437 ms | 33792 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |