# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
288381 | 2020-09-01T13:04:14 Z | emil_physmath | 벽 (IOI14_wall) | C++17 | 171 ms | 14020 KB |
#include "wall.h" #include <iostream> #include <random> #include <chrono> using namespace std; using llong = long long; #define BUGO(x) cerr << #x << " = " << (x) << '\n'; #define BUGOARR(a) {cerr << #a << ": "; for (auto i: a) cerr << i << ' '; cerr << '\n';} #ifndef MANSON #define BUGO(x) #define BUGOARR(x) #endif ostream& operator<<(ostream& out, const pair<auto, auto>& p) { out << "{" << p.first << ", " << p.second << "}"; } mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); inline int rnd(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); } void buildWall(int n, int k, int op[], int left[], int right[], int height[], int ans[]) { for (int i = 0; i < n; ++i) ans[i] = 0; if (n <= 10000 && k <= 5000) { for (int x = 0; x < k; ++x) if (op[x] == 1) // Add { for (int i = left[x]; i <= right[x]; ++i) ans[i] = max(ans[i], height[x]); } else // Remove { for (int i = left[x]; i <= right[x]; ++i) ans[i] = min(ans[i], height[x]); } return; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 416 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 20 ms | 640 KB | Output is correct |
5 | Correct | 20 ms | 640 KB | Output is correct |
6 | Correct | 20 ms | 572 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Incorrect | 166 ms | 8184 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 20 ms | 640 KB | Output is correct |
5 | Correct | 20 ms | 640 KB | Output is correct |
6 | Correct | 20 ms | 568 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Incorrect | 171 ms | 14020 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 1 ms | 384 KB | Output is correct |
4 | Correct | 22 ms | 640 KB | Output is correct |
5 | Correct | 19 ms | 632 KB | Output is correct |
6 | Correct | 19 ms | 640 KB | Output is correct |
7 | Correct | 0 ms | 256 KB | Output is correct |
8 | Incorrect | 165 ms | 13948 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |