제출 #395832

#제출 시각아이디문제언어결과실행 시간메모리
395832khangal벽 칠하기 (APIO20_paint)C++14
0 / 100
1554 ms29276 KiB
#include "paint.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef double db; typedef pair<ll,ll> pl; typedef vector<ll> vl; #define pb push_back #define po pop_back #define ff first #define ss second #define MIN -1e18 #define MAX 1e18 #define lw lower_bound // typedef tree<ll , null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; // template< typename T> // using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; ll n,m,mid,mn,T,sum,c[1234567],h1,h2,x,y,z,l,r,cnt,cnt1,ans; vector<ll> vec[1234567]; bool ok[1234567],ok1; int minimumInstructions( int N, int M, int K, std::vector<int> C, std::vector<int> A, std::vector<std::vector<int>> B) { for(int i=0;i<M;i++){ for(auto u:B[i]) vec[u].pb(i); } vector<vector<ll> > mp(M); for(int i=0;i<N;i++){ for(auto u:vec[C[i]]){ mp[((u-i)%M+M)%M].pb(i); } } vl v(N); for(auto u:mp){ ll last = N+1; ll len =0; for(int i=u.size()-1;i>=0;i--){ if(u[i]+1!=last)len=0; len++; v[u[i]]=max(v[u[i]],len); last=u[i]; } } vl ok; for(int i=0;i<N;i++)if(v[i]>=M)ok.pb(i); ll Rpoint=0; ll id=0; while(Rpoint<N){ while(id<ok.size()&&ok[id]<=Rpoint){ id++; } if(id==0)return -1; ll Lpoint = ok[id-1]; if(Lpoint + M <= Rpoint)return -1; ans++; } return ans; }

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

paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, std::vector<std::vector<int> >)':
paint.cpp:49:11: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |   while(id<ok.size()&&ok[id]<=Rpoint){
      |         ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...