# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
664834 | 2022-11-27T08:48:59 Z | Astrayt | Money (IZhO17_money) | C++17 | 1 ms | 212 KB |
//君の手を握ってしまったら //孤独を知らないこの街には //もう二度と帰ってくることはできないのでしょう //君が手を差し伸べた 光で影が生まれる //歌って聞かせて この話の続き //連れて行って見たことない星まで //さユリ - 花の塔 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll #define starburst ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define pii pair<int,int> #define pb push_back #define ff first #define ss second #define mp make_pair #define maxn 200005 #define mod 1000000007 void solve(){ int n; cin >> n; vector<pii> v(n); for(auto &x:v) cin >> x.ff; int id = 1; v[0].ss = 0; while(id < n && v[id - 1].ff <= v[id].ff) v[id].ss = 0, id++; if(id == n){ cout << 1 << '\n'; return; } for(int i = id, cur = 2; i < n; ++i){ v[i].ss = cur; cur++; } sort(v.begin(), v.end()); int ans = 1, cnt = 0; for(int i = 1; i < n; ++i){ if(v[i].ss == 0) continue; if(v[i].ss != v[i - 1].ss + 1) ans++; } if(v[0].ss != 0) ans++; cout << ans << '\n'; } signed main(){ starburst int t = 1; //cin >> t; while(t--) solve(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
4 | Incorrect | 1 ms | 212 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |