제출 #1078782

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10787822024-08-28 06:13:41LittleOrange죄수들의 도전 (IOI22_prison)C++17
56 / 100
11 ms1284 KiB
#include "prison.h"
#include <vector>
#include<bits/stdc++.h>
using namespace std;
using ll = int;
std::vector<std::vector<int>> devise_strategy(int N) {
ll n = N;
ll lvl = __lg(n);
ll x = lvl*2+2;
vector<vector<ll>> ret;
vector<ll> mp;
{
vector<ll> a(n+1,0);
for(ll i = 1;i<=n;i++) a[i] = (i>>lvl&1)?1:2;
ret.push_back(a);
}
for(ll j = 0;j<=lvl;j++){
ll h = lvl-j;
ll tp = j&1^1;
{
vector<ll> a(n+1,tp);
for(ll i = 1;i<=n;i++){
if (i>>h&1) a[i] = ((i<<1>>h&1)?1:2)+j*2+2;
else a[i] = -1-tp;
}
ret.push_back(a);
}
{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:21:14: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   21 |     ll tp = j&1^1;
      |             ~^~
prison.cpp:33:17: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   33 |         if (i>>h&1^1) a[i] = ((i<<1>>h&1)?1:2)+j*2+2;
      |             ~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...