Submission #284659

#TimeUsernameProblemLanguageResultExecution timeMemory
284659Pichon5Paint By Numbers (IOI16_paint)C++17
7 / 100
1 ms288 KiB
#include "paint.h" #include <bits/stdc++.h> #include <cstdlib> #define vi vector<int> using namespace std; string ss; int atras,delante; void f(int a,int b,int x){ a+=atras; b-=delante; int aux=b-a+1-x; for(int i=a;aux>0;i++){ aux--; ss[i]='?'; } aux=b-a+1-x; for(int i=b;aux>0;i--){ aux--; ss[i]='?'; } } string solve_puzzle(string s,vector<int> c){ int a=0,b=s.size()-1; ss.assign(s.size(),'X'); for(int i=0;i<c.size();i++){ b-=c[i]; } atras=0; delante=c.size()-1; for(int i=0;i<c.size();i++){ b+=c[i]; f(a,b,c[i]); a+=c[i]; atras++; delante--; } return ss; }

Compilation message (stderr)

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