# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1112470 | 2024-11-14T08:36:19 Z | vjudge1 | Baloni (COCI15_baloni) | C++17 | 2 ms | 380 KB |
#include <bits/stdc++.h> #define int long long #define pb push_back #define nmod(a, b) (((a%b)+b)%b) // stands for [n]atural [mod], as in "will always return a natural number", should be used in case of negative #define a2b(a, b) (a << b) // a*2^b #define bit(a, b) ((a >> b) & 1) // bth bit from the right, starts at zero using namespace std; template<class T> using vec = vector<T>; const int INFTY = (1LL << 63) - 1; const int NNFTY = 1LL << 63; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); freopen("bigtest.txt", "r", stdin); int n; cin >> n; vec<int> h(n); for (auto &x : h) cin >> x; vec<int> grouplast(n); grouplast[0] = h[0]; int k = 0; for (int i = 0; i < n; i++) { auto it = find(grouplast.begin(), grouplast.begin() + k, h[i] + 1); *it = h[i]; if (it == grouplast.begin() + k) k++; } cout << k; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 336 KB | Output isn't correct |
2 | Incorrect | 2 ms | 336 KB | Output isn't correct |
3 | Incorrect | 2 ms | 336 KB | Output isn't correct |
4 | Incorrect | 2 ms | 336 KB | Output isn't correct |
5 | Incorrect | 2 ms | 348 KB | Output isn't correct |
6 | Incorrect | 2 ms | 336 KB | Output isn't correct |
7 | Incorrect | 2 ms | 336 KB | Output isn't correct |
8 | Incorrect | 2 ms | 380 KB | Output isn't correct |
9 | Incorrect | 2 ms | 336 KB | Output isn't correct |
10 | Incorrect | 2 ms | 336 KB | Output isn't correct |