| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1312812 | aaaaaaaa | Po (COCI21_po) | C++20 | 1096 ms | 1080 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int n, ans = 0;
cin >> n;
vector<int> a(n + 1, 0);
for(int i = 1; i <= n; ++i) cin >> a[i];
for(int i = 1; i <= n; ++i){
if(a[i] == 0) continue;
int end_point = i;
for(int j = i; j <= n; ++j){
if(a[j] < a[i]) break;
end_point = j;
}
for(int j = i + 1; j <= end_point; ++j){
a[j] -= a[i];
}
ans += 1;
}
cout << ans << "\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
