제출 #1112355

#제출 시각아이디문제언어결과실행 시간메모리
1112355vjudge1Baloni (COCI15_baloni)C++17
0 / 100
2101 ms14160 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main() { int n,tut,cev=0; cin >> n; int arr[n+5],visited[n+5]; for(int i=0;i<n;i++){ cin >> arr[i]; visited[i]=0; } for(int i=0;i<n;i++) { if(visited[i]==1) continue; cev++; tut=arr[i]; tut--; for(int j=i+1;j<n;j++) { if(arr[j]==tut){ visited[j]=1; tut--; } } } cout << cev; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...