답안 #642488

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642488 2022-09-19T15:00:24 Z birthdaycake 죄수들의 도전 (IOI22_prison) C++17
30 / 100
28 ms 2132 KB
#include "prison.h"

#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
using namespace std;

vector<vector<int>> devise_strategy(int N) {
    vector<vector<int>>ans;
    vector<int>d;
    d.push_back(0);
    for(int i = 1; i <= N; i++) {
        if(i == 1) d.push_back(-1);
        else if(i == N) d.push_back(-2);
        else if(i & (1 << (12))) d.push_back(1);
        else d.push_back(2);
    }
    
    ans.push_back(d);
    d.clear();
    bool turn = 0; int cnt = 12;
    for(int j = 1; ; j+=2){
        if(turn){
            // check a
            cnt--;
            if(cnt == -1) break;
            d.push_back(0);
            for(int i = 1; i <= N; i++){
                if(i == 1) d.push_back(-1);
                else if(i == N) d.push_back(-2);
                else if(i & ((1 << cnt))) d.push_back(j + 2);
                else d.push_back(j + 3);
 
            }
            ans.push_back(d);
            d.clear();
            d.push_back(0);
            for(int i = 1; i <= N; i++){
                if(i == 1) d.push_back(-1);
                else if(i == N) d.push_back(-2);
                else if(i & ((1 << cnt))) d.push_back(j + 2);
                else d.push_back(j + 3);
            }
            ans.push_back(d);
            d.clear();
            
        }else{
            d.push_back(1);
            for(int i = 1; i <= N; i++){
                if(i == 1) d.push_back(-2);
                else if(i == N) d.push_back(-1);
                else if(i & ((1 << cnt))) d.push_back(min(50,j + 2));
                else d.push_back(-2);
            }
            ans.push_back(d);
            d.clear();
            d.push_back(1);
            for(int i = 1; i <= N; i++){
                if(i == 1) d.push_back(-2);
                else if(i == N) d.push_back(-1);
                else if(i & ((1 << cnt))) d.push_back(-1);
                else d.push_back(min(50,j + 3));
            }
            ans.push_back(d);
            d.clear();
            
        }
        
        turn = !turn;
    }
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 468 KB Output is correct
6 Correct 4 ms 468 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 468 KB Output is correct
6 Correct 3 ms 484 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 2 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Partially correct 1 ms 212 KB Output is partially correct
3 Partially correct 1 ms 212 KB Output is partially correct
4 Partially correct 15 ms 1048 KB Output is partially correct
5 Partially correct 22 ms 1748 KB Output is partially correct
6 Partially correct 26 ms 2004 KB Output is partially correct
7 Partially correct 28 ms 2132 KB Output is partially correct
8 Partially correct 1 ms 212 KB Output is partially correct
9 Partially correct 3 ms 340 KB Output is partially correct
10 Partially correct 4 ms 468 KB Output is partially correct
11 Partially correct 11 ms 900 KB Output is partially correct
12 Partially correct 21 ms 1620 KB Output is partially correct