# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
464284 | 2021-08-12T17:37:55 Z | TeaTime | Money (IZhO17_money) | C++17 | 0 ms | 204 KB |
//#pragma GCC optimize("O3") //#pragma GCC target("avx2") #include <iostream> #include <vector> #include <string> #include <algorithm> #include <map> #include <set> #include <queue> #include <unordered_map> using namespace std; #define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); typedef long long ll; typedef long double ld; #define int ll const ll SZ = 1e6 + 10; ll n, m, q; vector<ll> vec; signed main() { fastInp; cin >> n; vec.resize(n); ll ans = 1; for (auto& c : vec) cin >> c; vector<ll> pos(n); for (int i = 0; i < n; i++) { pos[vec[i] - 1] = i; } ll pr = pos[0]; for (int i = 1; i < n; i++) { if (pos[i] < pos[i - 1]) ans++; } cout << ans; return 0; } /* 3 4 RGWR GRGG RGWW 4 4 RGWR GRRG WGGW WWWR 5 5 RGRGW GRRGW WGGWR RWRGW RGWGW */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Incorrect | 0 ms | 204 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |