Submission #92604

#TimeUsernameProblemLanguageResultExecution timeMemory
92604BadralPaint By Numbers (IOI16_paint)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int a[1000005]; int main() { string str, s; getline(cin, str); int i; for(i = 14; i < str.size(); i++) { if(str[i] != '"') s += str[i]; else break; } i += 2; vector<int> v; for(; i < str.size(); i++) { int k = 0; while(str[i] <= '9' && str[i] >= '0') { k = k * 10 + str[i] - 48; i++; } if(k != 0) v.push_back(k); } int k = v[0]; for(int i = 0; i < k; i++) { a[i]++; } for(int i = s.size(); i >= s.size()-k; i--) { a[i]++; } for(int i = 0; i < s.size(); i++) { if(a[i] == 2) { cout<<'X'; } else cout<<'?'; } }

Compilation message (stderr)

paint.cpp: In function 'int main()':
paint.cpp:9:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(i = 14; i < str.size(); i++) {
                 ~~^~~~~~~~~~~~
paint.cpp:15:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(; i < str.size(); i++) {
           ~~^~~~~~~~~~~~
paint.cpp:27:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = s.size(); i >= s.size()-k; i--) {
                           ~~^~~~~~~~~~~~~
paint.cpp:30:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0; i < s.size(); i++) {
                    ~~^~~~~~~~~~
/tmp/ccGpbdLb.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cczpMueJ.o:paint.cpp:(.text.startup+0x0): first defined here
/tmp/ccGpbdLb.o: In function `main':
grader.cpp:(.text.startup+0x1eb): undefined reference to `solve_puzzle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status