Submission #334277

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3342772020-12-08 22:55:13SwanPaint By Numbers (IOI16_paint)C++14
59 / 100
1 ms384 KiB
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 3;
const int maxk = 101;
bitset<maxk> pref[maxn];
bitset<maxk> suf[maxn];
int prefSum[maxn];
int prefSumBlack[maxn];
int isWhiteGood[maxn];
string ans;
int n;
int k;
void addWhite(int l, int r){
isWhiteGood[l]++;
isWhiteGood[r + 1]--;
}
int getSum(int l, int r){
int res = prefSum[r];
if(l)res-=prefSum[l - 1];
return res;
}
int getSumBlack(int l, int r){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

paint.cpp: In function 'void solveBlack(std::string&, std::string&)':
paint.cpp:67:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   67 |     for(int i = 0; i < s.size();i++){
      |                    ~~^~~~~~~~~~
paint.cpp: In function 'bool putBlock(int, int, int, std::string&)':
paint.cpp:86:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |     if(r != s.size() - 1){
      |        ~~^~~~~~~~~~~~~~~
paint.cpp: In function 'void solveWhite(std::string&, std::vector<int>&, std::string&)':
paint.cpp:94:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   94 |     for(int j = 0; j < c.size();j++){
      |                    ~~^~~~~~~~~~
paint.cpp:95:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   95 |         for(int l = 0 ; l < s.size();l++){
      |                         ~~^~~~~~~~~~
paint.cpp:97:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   97 |             if(r >= s.size())continue;
      |                ~~^~~~~~~~~~~
paint.cpp: In function 'void calc_suf(std::vector<int>&, std::string&)':
paint.cpp:119:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  119 |             if(s[j] != 'X' && i != s.size() - 1)suf[i][j] = suf[i + 1][j];
      |                               ~~^~~~~~~~~~~~~~~
paint.cpp:121:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  121 |             if(r >= s.size())continue;
      |                ~~^~~~~~~~~~~
paint.cpp:125:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  125 |             if(j == c.size() - 1){
      |                ~~^~~~~~~~~~~~~~~
paint.cpp:126:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  126 |                 if(r == s.size() - 1){
      |                    ~~^~~~~~~~~~~~~~~
paint.cpp:134:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  134 |                 if(r + 2 < s.size()){
      |                    ~~~~~~^~~~~~~~~~
paint.cpp: In function 'void calc_pref(std::vector<int>&, std::string&)':
paint.cpp:146:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  146 |     for(int i = 0; i < s.size();i++){
      |                    ~~^~~~~~~~~~
paint.cpp:147:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  147 |         for(int j = 0; j < c.size();j++){
      |                        ~~^~~~~~~~~~
paint.cpp: In function 'std::string solve_puzzle(std::string, std::vector<int>)':
paint.cpp:175:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  175 |     for(int i = 0; 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...