제출 #836120

#제출 시각아이디문제언어결과실행 시간메모리
836120tengiz05죄수들의 도전 (IOI22_prison)C++17
10 / 100
7 ms852 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int n) { vector<vector<int>> f(40, vector<int>(n + 1)); for (int i = 0; i < 40; i++) { int num = 8 - (i >> 2); int A = i & 1; int res = i >> 1 & 1; if (A == 0) { f[i][0] = 0; for (int j = 1; j <= n; j++) { int bit = j >> num & 1; f[i][j] = ((8 - num) << 2) | (bit << 1) | 1; } } if (A == 1) { f[i][0] = 1; for (int j = 1; j <= n; j++) { int bit = j >> num & 1; if (bit == res) { f[i][j] = (8 - num + 1) << 2; } else { if (res < bit) { f[i][j] = -1; } else { f[i][j] = -2; } } } } } for (int i = 0; i < f.size(); i++) { for (int j = 0; j <= n; j++) { if (f[i][j] == 40) f[i][j] = 0; // cout << f[i][j] << " \n"[j == n]; } } return f; }

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:35:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |     for (int i = 0; i < f.size(); i++) {
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...