# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
633545 | 2022-08-22T17:35:19 Z | Ahmed57 | 지구 온난화 (NOI13_gw) | C++ | 848 ms | 65536 KB |
#include <bits/stdc++.h> using namespace std; long long n; long long pre[10000005]; vector<long long> v,w; map<long long,long long> sa,cmp; int main(){ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin>>n; v.push_back(2); for(int i = 0;i<n;i++){ long long x;cin>>x; w.push_back(x); sa[x]++; } long long z = 1; for(auto i:sa){ cmp[i.first] = ++z; } int pre[z*2+5] = {0}; 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 468 KB | Output is correct |
2 | Correct | 1 ms | 468 KB | Output is correct |
3 | Correct | 1 ms | 468 KB | Output is correct |
4 | Correct | 1 ms | 468 KB | Output is correct |
5 | Correct | 1 ms | 468 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 2584 KB | Output is correct |
2 | Correct | 12 ms | 2640 KB | Output is correct |
3 | Correct | 11 ms | 2640 KB | Output is correct |
4 | Correct | 12 ms | 2584 KB | Output is correct |
5 | Correct | 13 ms | 2616 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 98 ms | 15816 KB | Output is correct |
2 | Correct | 67 ms | 15856 KB | Output is correct |
3 | Correct | 93 ms | 15804 KB | Output is correct |
4 | Correct | 102 ms | 15816 KB | Output is correct |
5 | Correct | 96 ms | 15936 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 778 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 848 ms | 65536 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |