제출 #737705

#제출 시각아이디문제언어결과실행 시간메모리
737705iee죄수들의 도전 (IOI22_prison)C++17
100 / 100
14 ms980 KiB
#include <bits/stdc++.h> using namespace std; void dfs(int l, int r, int L, int R, bool d, int id, int im, auto &a) { if (l > r) return; l++, r--; a[id][0] = d; for (int i = L; i <= R; ++i) if (i < l) a[id][i] = (d ? -2 : -1); else if (i > r) a[id][i] = (d ? -1 : -2); int s = r - l + 1, num = min(s, 2 + (s > 4)), len = ceil(1.0 * s / num); for (int x = l, y, i = 1; i <= num; x = y + 1, ++i) { y = min(r, x + len - 1); for (int j = x; j <= y; ++j) a[id][j] = im + i; dfs(x, y, l - 1, r + 1, !d, im + i, im + num, a); } } vector<vector<int>> devise_strategy(int n) { vector<vector<int>> a(21, vector<int>(n + 1)); dfs(1, n, 1, n, 0, 0, 0, a); return a; }

컴파일 시 표준 에러 (stderr) 메시지

prison.cpp:3:62: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
    3 | void dfs(int l, int r, int L, int R, bool d, int id, int im, auto &a) {
      |                                                              ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...