Submission #172955

#TimeUsernameProblemLanguageResultExecution timeMemory
172955chubyxdxdPaint By Numbers (IOI16_paint)C++17
7 / 100
2 ms376 KiB
#include "paint.h" #include <bits/stdc++.h> #include <cstdlib> typedef long long ll; using namespace std; std::string solve_puzzle(std::string s, std::vector<int> c) { string s1; ll tam=s.size(),l=tam-c[0]; s1.resize(tam,'?'); if(c[0]<=tam/2){ s1.resize(tam,'?'); return s1; } ll r=tam-c[0]; ll m=tam-r-l; for(int i=0;i<tam;i++){ if(r>0){ s1[i]='?'; r--; continue; } if(m>0){ s1[i]='X'; m--; continue; } if(l>0){ s1[i]='?'; l--; continue; } } }/* const int S_MAX_LEN = 200 * 1000; char buf[S_MAX_LEN + 1]; int main() { assert(1 == scanf("%s", buf)); std::string s = buf; int c_len; assert(1 == scanf("%d", &c_len)); std::vector<int> c(c_len); for (int i = 0; i < c_len; i++) { assert(1 == scanf("%d", &c[i])); } std::string ans = solve_puzzle(s, c); printf("%s\n", ans.data()); return 0; } */

Compilation message (stderr)

paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, std::vector<int>)':
paint.cpp:33: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...