제출 #830328

#제출 시각아이디문제언어결과실행 시간메모리
830328WarinchaiPaint By Numbers (IOI16_paint)C++14
32 / 100
1 ms308 KiB
#include "paint.h" #include<bits/stdc++.h> using namespace std; int ar[105]; int hb[105]; int db[105]; int pre[105]; std::string solve_puzzle(string s,vector<int> c) { int sz=s.size(); int sum=0; for(int i=0;i<c.size();i++){ sum+=c[i]; pre[i+1]=sum; } int left=sz-sum-(c.size()-1); for(int i=0;i<c.size();i++){ int x=c[i]; int st=pre[i]+i; for(int j=st;j<=st+x-1+left;j++){ hb[j]=1; } for(int j=st+left;j<=st+x-1;j++){ db[j]=1; } } string ans=""; for(int i=0;i<sz;i++){ if(db[i]==1){ ans=ans+'X'; }else if(hb[i]==1){ ans=ans+'?'; }else{ ans=ans+'_'; } } return ans; }

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

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<c.size();i++){
      |                 ~^~~~~~~~~
paint.cpp:16:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(int i=0;i<c.size();i++){
      |                 ~^~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...