Submission #1169491

#TimeUsernameProblemLanguageResultExecution timeMemory
1169491owieczkaPainting Squares (IOI20_squares)C++20
100 / 100
49 ms420 KiB
#include "squares.h" #include <bits/stdc++.h> using namespace std; string wzor = "0111111111101010101011101010110110101011111010110101101111010111011101011110110101111111011011011101101111110111011111011110111111110010010011001001010100100101110010011011001001110100100111110010100101001110010101011001010110100101011110010110011001011010100101101110010111011001011110100101111110011001101001100111100110101010011010111001101101100110111010011011111001110011101011001110110100111011110011110101001111011100111110110011111101001111111000100010100010001110001001001000100101100010011010001001111000101001100010101010001010111000101100100010110110001011101000101111100011000110010100011001110001101001000110101100011011010001101111000111001100011101010001110111000111100100011110110001111101000111111000010000100011000010010100001001110000101001000010101100001011010000101111000011000100001100110000110101000011011100001110010000111011000011110100001111100000100010000010011000001010100000101110000011001000001101100000111010000011110000001001000000101100000011010000001110000000101000000011000000001000000000"; std::vector<int> paint(int n) { vector<int> label(n+1); label[n] = 10; for (int i = 0; i < n; i++) { label[i] = !(wzor[i]=='0'); } return label; } int find_location(int n, std::vector<int> c) { for (int i = 0; i < c.size(); i++) { // cerr << c[i]; if (c[i] == -1) { return n - i; } } // cerr << '\n'; for (int i = 0; i + 10 <= n; i++) { for (int j = 0; j < 10; j++) { if ((wzor[i+j]-'0') != c[j])goto here; } return i; here: continue; } }

Compilation message (stderr)

squares.cpp: In function 'int find_location(int, std::vector<int>)':
squares.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...