Submission #170176

#TimeUsernameProblemLanguageResultExecution timeMemory
170176ksmzzang2003Paint By Numbers (IOI16_paint)C++14
0 / 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'; return C; } }

Compilation message (stderr)

paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, std::vector<int>)':
paint.cpp:10:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=0;i<s.size();i++) if(A[i] == B[i] && A[i]=='X') C[i] = 'X'; 
               ~^~~~~~~~~
paint.cpp:13: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...