# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714117 | 2023-03-24T01:27:18 Z | DepressedMG | Uzastopni (COCI17_uzastopni) | C++17 | 40 ms | 65536 KB |
#include<bits/stdc++.h> #define ull unsigned long long using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); ull n,m,a,b,i,j; cin>>n; vector<ull> v(n/2+3); v[0]=0; for(i=1;i<v.size();i++){ v[i]=v[i-1]+i; } j=v.size()-2; for(i=v.size();i>0 && j>0;){ if(v[i]-v[j]<n){ j--; } else{ if(v[i]-v[j]>n){ i--; } else{ cout<<j+1<<" "<<i<<endl; j--;i--; } } } if(v[i]-v[j]<n){ j--; } else{ if(v[i]-v[j]>n){ i--; } else{ cout<<j+1<<" "<<i<<endl; j--;i--; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Correct | 1 ms | 596 KB | Output is correct |
5 | Correct | 1 ms | 1108 KB | Output is correct |
6 | Correct | 8 ms | 8136 KB | Output is correct |
7 | Correct | 40 ms | 39368 KB | Output is correct |
8 | Runtime error | 30 ms | 65536 KB | Execution killed with signal 9 |
9 | Runtime error | 30 ms | 65536 KB | Execution killed with signal 9 |
10 | Runtime error | 2 ms | 596 KB | Execution killed with signal 6 |