Submission #194152

#TimeUsernameProblemLanguageResultExecution timeMemory
194152c4ts0upPaint By Numbers (IOI16_paint)C++17
7 / 100
2 ms376 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; bool IsInRange(pair <int,int> m, int x) { return m.first <= x && m.second >= x; } string solve_puzzle(string s, vector<int> c) { pair <int,int> beg = make_pair (1, c[0]); //cout << "[1, " << c[0] << "]\n"; pair <int,int> end = make_pair (s.size()-c[0]+1, s.size()); //cout << "[" << s.size()-c[0] << ", " << s.size() << "]\n"; pair <int,int> mixed = make_pair (end.first, beg.second); //cout << "[" << mixed.first << ", " << mixed.second << "]\n"; string res = ""; for (int i=1; i<=s.size(); i++) { if (IsInRange(mixed, i)) res += "X"; else res += "?"; } return res; }

Compilation message (stderr)

paint.cpp: In function 'std::__cxx11::string solve_puzzle(std::__cxx11::string, std::vector<int>)':
paint.cpp:19:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=1; i<=s.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...