# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
633573 | 2022-08-22T18:39:16 Z | Ahmed57 | Global Warming (NOI13_gw) | C++14 | 1000 ms | 65536 KB |
#include <bits/stdc++.h> using namespace std; long long n; long long pre[2000005]; vector<long long> v,w,s; map<long long,long long> cmp; int main(){ cin>>n; v.push_back(2); for(int i = 0;i<n;i++){ long long x;cin>>x; w.push_back(x); s.push_back(x); } sort(s.begin(),s.end()); long long z = 1; for(int i = 0;i<n;i++){ if(i&&s[i]==s[i-1])z--; cmp[s[i]] = ++z; } for(int i = 0;i<w.size();i++){ v.push_back(cmp[w[i]]*2); } for(int i = 0;i<v.size()-1;i++){ if(v[i]<v[i+1]){ pre[v[i+1]]--; pre[v[i]]++; } } long long ma = 0 , cur = 0; for(int i = 2;i<=z*2;i++){ cur+=pre[i]; ma = max(ma,cur); } cout<<ma<<"\n"; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 336 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 23 ms | 3348 KB | Output is correct |
2 | Correct | 23 ms | 3392 KB | Output is correct |
3 | Correct | 22 ms | 3396 KB | Output is correct |
4 | Correct | 26 ms | 3444 KB | Output is correct |
5 | Correct | 24 ms | 3392 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 94 ms | 10592 KB | Output is correct |
2 | Correct | 61 ms | 10508 KB | Output is correct |
3 | Correct | 96 ms | 10604 KB | Output is correct |
4 | Correct | 95 ms | 10504 KB | Output is correct |
5 | Correct | 91 ms | 10648 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 601 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1097 ms | 64024 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |