제출 #834322

#제출 시각아이디문제언어결과실행 시간메모리
834322mindiyakPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms212 KiB
#include "prison.h" #include <cmath> #include <vector> #include <iostream> using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { vector<vector<int>> ans; vector<int> temp(N+1,0); for(int i=0;i<5;i++){ temp = vector<int> (N+1,0); if(i==0){ ans.push_back(temp); continue; } for(int j=1;j<N+1;j++){ int a = (int)(j/pow(10,4-i))%10; temp[j] = i*10 + a; } ans.push_back(temp); } for(int i=5;i<10;i++){ temp = vector<int> (N+1,0); ans.push_back(temp); } for(int i=10;i<50;i++){ temp = vector<int> (N+1,0); temp[0] = 1; // cout << i << " -> "; for(int j=1;j<N+1;j++){ int pos = i/10; int a = i%10; int b = (int)(j/pow(10,4-pos))%10; // cout << "{" << a << "," << b << "," << pos << "} "; if(a>b)temp[j] = -1; else if(a<b)temp[j] = -2; else { if((i/10) == 4)temp[j] = 0; else temp[j] = (i/10)+1; } } // cout << endl; ans.push_back(temp); } // int counter = 0; // for(auto a: ans){ // cout << counter << " -> "; // for(auto b: a){ // cout << b << " "; // }cout << endl; // counter ++; // } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...