Submission #170178

#TimeUsernameProblemLanguageResultExecution timeMemory
170178ksmzzang2003Paint By Numbers (IOI16_paint)C++14
7 / 100
2 ms376 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; string solve_puzzle(string s, vector<int> c) { int N = s.size(); if(c.size()==1) { string A = s, B= s,C=s; for(int i=0; i<c[0]; i++) B[N-1-i]=A[i] = 'X'; for(int i=0; i<s.size(); i++) { if(A[i] == B[i] && A[i]=='X') C[i] = 'X'; else C[i] = '?'; } return C; } }

Compilation message (stderr)

paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, std::vector<int>)':
paint.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int i=0; i<s.size(); i++) {
                      ~^~~~~~~~~
paint.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...