Submission #284247

#TimeUsernameProblemLanguageResultExecution timeMemory
284247Pichon5Paint By Numbers (IOI16_paint)C++17
7 / 100
1 ms384 KiB
#include "paint.h" #include <bits/stdc++.h> #include <cstdlib> #define vi vector<int> using namespace std; string solve_puzzle(string s,vector<int> c){ vi v(s.size(),0); for(int i=0;i<c[0];i++){ v[i]++; } int x=c[0]; for(int i=s.size()-1;i>=0;i--){ v[i]++; x--; if(x==0){ break; } } string ss=""; for(int i=0;i<s.size();i++){ if(v[i]==2){ ss+='X'; }else{ ss+='?'; } } return ss; }

Compilation message (stderr)

paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:20:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i=0;i<s.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...