제출 #629477

#제출 시각아이디문제언어결과실행 시간메모리
629477jeff252죄수들의 도전 (IOI22_prison)C++17
30 / 100
51 ms2168 KiB
#include<bits/stdc++.h> #define fi first #define se second #define pitem item* using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<ll> vl; const int N=1e6+10; const int SS=1<<19; const int INFi=2e9; const ll INFl=1e13; const ll mod2=998244353; const ll mod=1e9+7; const ll mod3=1000696969; const ll p=70032301; const ull p2=913; const int L=20; int Find(int a,int ind){ vi res; while(a>0){ res.push_back(a%10); a/=10; } reverse(res.begin(),res.end()); if(ind>res.size()) return -1; return res[ind-1]; } int getlen(int a){ int n=0; while(a>0) n++,a/=10; return n; } vector<vi> devise_strategy(int n){ vector<vi>res; for(int i=0;i<=55;i++){ vi curr; if(i==0){ curr.push_back(0); for(int i2=1;i2<=n;i2++) curr.push_back(50+getlen(i2)); res.push_back(curr); continue; } if(i>50){ curr.push_back(1); for(int i2=1;i2<=n;i2++){ int a=getlen(i2); if(a<i%10) curr.push_back(-2); if(a>i%10) curr.push_back(-1); if(a==i%10) curr.push_back(1); } res.push_back(curr); continue; } if(i>=1 and i<=4){ curr.push_back(0); for(int i2=1;i2<=n;i2++){ if(Find(i2,i)==-1) curr.push_back(-1); else curr.push_back(i*10+Find(i2,i)); } }else{ curr.push_back(1); int kt=Find(i,1),val=Find(i,2); for(int i2=1;i2<=n;i2++){ int kt2=Find(i2,kt); if(kt2==-1 or val>kt2){ curr.push_back(-2); continue; } if(val==-1 or val<kt2){ curr.push_back(-1); continue; } curr.push_back(kt+1); } } res.push_back(curr); } return res; } /*int main(){ ios_base::sync_with_stdio(0),cin.tie(0); int tt=1; int n; cin>>n; vector<vi> res=devise_strategy(n); for(int i=0;i<res.size();i++){ for(int i2=0;i2<res[i].size();i2++) cout<<res[i][i2]<<" "; cout<<"\n"; } }*/

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

prison.cpp: In function 'int Find(int, int)':
prison.cpp:27:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     if(ind>res.size()) return -1;
      |        ~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...