# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375210 | 2021-03-09T04:31:45 Z | div2der | Po (COCI21_po) | C++14 | 11 ms | 364 KB |
//#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx") //#include <bits/stdc++.h> #include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <set> #include <map> #include <iomanip> using namespace std; const int N = 1e6; const int inf = 1e9 + 7; const int mod = 1e9 + 7; const int INF = 1e9 + 13; const int NN = 2e3; #define sz(s) (int)(s.size()) #define all(x) x.begin(), x.end() #define eb emplace_back #define ll long long void init(const string &prob) { ios_base::sync_with_stdio(false); cin.tie(0); if (prob != "default") { freopen((prob + ".txt").c_str(), "r", stdin); freopen((prob + ".txt").c_str(), "w", stdout); } } void solve() { int n; cin >> n; int prev = -1, cnt = 1; for (int i = 1; i <= n; ++ i) { int x; cin >> x; if (prev == -1) { prev = x; continue; } else { if (prev < x) cnt += (x - prev); prev = x; } } cout << cnt << '\n'; return; } int main() { init("default"); int tt = 1; while (tt--) { solve(); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 364 KB | Output isn't correct |
2 | Incorrect | 1 ms | 364 KB | Output isn't correct |
3 | Incorrect | 1 ms | 364 KB | Output isn't correct |
4 | Incorrect | 4 ms | 364 KB | Output isn't correct |
5 | Incorrect | 5 ms | 364 KB | Output isn't correct |
6 | Correct | 11 ms | 364 KB | Output is correct |
7 | Incorrect | 11 ms | 364 KB | Output isn't correct |