Submission #284658

#TimeUsernameProblemLanguageResultExecution timeMemory
284658Pichon5Paint By Numbers (IOI16_paint)C++17
0 / 100
0 ms256 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; cout<<a<<" "<<b<<endl; 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:27:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for(int i=0;i<c.size();i++){
      |                 ~^~~~~~~~~
paint.cpp:32:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |     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...