# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112010 | 2024-11-13T13:55:14 Z | idk__ | Baloni (COCI15_baloni) | C++14 | 133 ms | 14160 KB |
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL); int n; cin >> n; pair<int ,int> a[n]; for(int i = 0;i < n ;i++){ int x;cin >> x; a[i] = {x, i+1}; } sort(a, a+n); reverse(a, a+n); int ans = n; for(int i = 1;i < n; i++){ auto [v, idx] = a[i]; auto [v1,idx1] = a[i-1]; if(idx > idx1 and v1 - v==1){ ans--; } } cout << ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 336 KB | Output isn't correct |
2 | Incorrect | 1 ms | 336 KB | Output isn't correct |
3 | Incorrect | 1 ms | 336 KB | Output isn't correct |
4 | Incorrect | 1 ms | 336 KB | Output isn't correct |
5 | Incorrect | 121 ms | 12624 KB | Output isn't correct |
6 | Incorrect | 133 ms | 14160 KB | Output isn't correct |
7 | Incorrect | 111 ms | 13896 KB | Output isn't correct |
8 | Incorrect | 113 ms | 11600 KB | Output isn't correct |
9 | Incorrect | 115 ms | 12380 KB | Output isn't correct |
10 | Incorrect | 117 ms | 12864 KB | Output isn't correct |