제출 #625840

#제출 시각아이디문제언어결과실행 시간메모리
625840peti1234죄수들의 도전 (IOI22_prison)C++17
10 / 100
5 ms596 KiB
#include <bits/stdc++.h>

using namespace std;

vector<vector<int> > devise_strategy(int n){
    vector<vector<int>> ans(21);
    for (int i=0; i<=20; i++) {
        ans[i].resize(n+1);
    }
    int pos=0, ert=500;
    for (int i=0; i<=17; i++) {
        if (i%6==0) {
            ert/=5;
            ans[i][0]=0;
            for (int j=1; j<=n; j++) {
                int rem=(j-1)%(5*ert)/ert+1;
                //cout << "fontos " << i <<" " << j << " " << ert << " " << rem << "\n";
                ans[i][j]=i+rem;
            }
        } else {
            ans[i][0]=1;
            for (int j=1; j<=n; j++) {
                int rem=(j-1)%(5*ert)/ert+1, aa=i%6;
                if (rem<aa) ans[i][j]=-2;
                if (aa<rem) ans[i][j]=-1;
                if (aa==rem) ans[i][j]=i+6-rem;
            }
        }
    }
    ans[18][0]=0;
    for (int j=1; j<=n; j++) {
        int rem=(j-1)%4;
        if (rem==0) ans[18][j]=-1;
        if (rem==3) ans[18][j]=-2;
        if (rem==1 || rem==2) ans[18][j]=18+rem;
    }
    for (int i=19; i<=20; i++) {
        ans[i][0]=1;
        for (int j=1; j<=n; j++) {
            int rem=(j-1)%4, aa=i-18;
            if (rem<aa) ans[i][j]=-2;
            if (aa<rem) ans[i][j]=-1;
            if (aa==rem) ans[i][j]=0;
        }
    }
    return ans;
}
/*int main()
{
    ios_base::sync_with_stdio(false);
    vector<vector<int> > sz=devise_strategy(20);
    for (auto x:sz) {
        for (auto y:x) {
            cout << y << " ";
        }
        cout << "\n";
    }
    return 0;
}*/

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

prison.cpp: In function 'std::vector<std::vector<int> > devise_strategy(int)':
prison.cpp:10:9: warning: unused variable 'pos' [-Wunused-variable]
   10 |     int pos=0, ert=500;
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...