답안 #485793

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
485793 2021-11-09T11:50:31 Z asandikci Baloni (COCI15_baloni) C++17
0 / 100
70 ms 18228 KB
/*
Aliberk Sandıkçı
9 November 2021
Current Rank: Newbie: 1033 (max.1188)
Current Grade: 10th in Izmir Science High School
Current Competitive Programming Achievements:
    * Turkey National Computer Olympics 2021 - 1st Stage: 27th place
    * Turkey Izmir Science Olympics (Computer Branch) 2021 - 1st Stage: 4th place
More About Me: ***there will be LinkedIN link soon***
*/
 
#include "bits/stdc++.h"
#define pb push_back
#define lwb lower_bound
#define upb upper_bound
#define fi first
#define se second
#define debu cout << "*debug*\n"
#define debug(x) cout << "debug " << x <<"\n"
#define int unsigned long long
constexpr int modn = 1e9+7;     // 998244353
constexpr int maxn = 1e6+5; 
constexpr int INF = 1e9+5;  
using namespace std;


void solve(){
    int n;
    cin >> n;
    int arr[n+5];
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    vector<int> vec;    
    for(int i=0;i<n;i++){
        vector<int>::iterator ix=vec.begin();
        for(auto it : vec){
            if(arr[i]==it-1){
                vec.erase(ix);
            }
            ix++;
        }
        vec.pb(arr[i]);
    }
    cout << vec.size();
    


}
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0); 
    //freopen("","r",stdin);
    //freopen("","w",stdout);   
    
    int T=1;
    //cin >> T; 
    while(T--){
        solve();    
    }   
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Runtime error 4 ms 588 KB Execution killed with signal 11
3 Runtime error 2 ms 716 KB Execution killed with signal 11
4 Runtime error 3 ms 716 KB Execution killed with signal 11
5 Runtime error 55 ms 16716 KB Execution killed with signal 11
6 Runtime error 70 ms 18228 KB Execution killed with signal 11
7 Runtime error 47 ms 14972 KB Execution killed with signal 11
8 Runtime error 43 ms 14904 KB Execution killed with signal 11
9 Runtime error 49 ms 15856 KB Execution killed with signal 11
10 Runtime error 52 ms 16332 KB Execution killed with signal 11