Submission #132785

# Submission time Handle Problem Language Result Execution time Memory
132785 2019-07-19T14:33:04 Z Vardanyan Baloni (COCI15_baloni) C++14
0 / 100
118 ms 131076 KB
#include <bits/stdc++.h>
using namespace std;
const int N = 1000*1000+5;
int a[N];
bool col[N];
queue<int> mark[N];
int main(){
    ios_base::sync_with_stdio(false);
    int n;
   // cout<<0<<endl;
    cin>>n;
    for(int i = 1;i<=n;i++) cin>>a[i];
    int ans = 0;

    for(int i = 1;i<=n;i++){
        int x = a[i];
        if(mark[x+1].size() == 0){
            mark[x].push(i);
            ans++;
            continue;
        }
        mark[x+1].pop();
        mark[x].push(i);
    }
    cout<<ans<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 118 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Runtime error 114 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Runtime error 114 ms 131072 KB Execution killed with signal 9 (could be triggered by violating memory limits)
4 Runtime error 116 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
5 Runtime error 113 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
6 Runtime error 113 ms 131072 KB Execution killed with signal 9 (could be triggered by violating memory limits)
7 Runtime error 117 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
8 Runtime error 114 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
9 Runtime error 113 ms 131076 KB Execution killed with signal 9 (could be triggered by violating memory limits)
10 Runtime error 117 ms 131072 KB Execution killed with signal 9 (could be triggered by violating memory limits)