# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
136371 | 2019-07-25T07:56:59 Z | 조승현(#3264) | Meandian (CEOI06_meandian) | C++14 | 8 ms | 376 KB |
#include "libmean.h" #include<cstdio> #include<algorithm> using namespace std; int arr[100]; int Go(int *w) { int i, T[5], j; for (i = 0; i < 5; i++) { T[i] = Meandian(w[(i + 1) % 5], w[(i + 2) % 5], w[(i + 3) % 5], w[(i + 4) % 5]); } int pv; for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { if (i != j && T[i] == T[j])break; } if (j == 5)pv = i; } sort(T, T + 5); arr[w[pv]-1] = T[1] + T[3] - T[2]; return w[pv]; } int main(void) { int i, n; int foo, bar, quux; n = Init(); for (i = 0; i < n; i++)arr[i] = -1; int w[5]; for (i = 1; i <= 4; i++)w[i - 1] = i; int pv = 4; for (i = 5; i <= n; i++) { w[pv] = i; int z = Go(w); for (int j = 0; j < 5; j++)if (w[j] == z)pv = j; } Solution(arr); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 3 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 248 KB | Output is correct |
5 | Correct | 3 ms | 248 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 3 ms | 248 KB | Output is correct |
8 | Correct | 6 ms | 248 KB | Output is correct |
9 | Correct | 7 ms | 248 KB | Output is correct |
10 | Correct | 8 ms | 376 KB | Output is correct |