제출 #385525

#제출 시각아이디문제언어결과실행 시간메모리
385525taulantPainting Squares (IOI20_squares)C++17
0 / 100
1 ms328 KiB
#include "bits/stdc++.h" using namespace std; int ans[1024]; vector<int> paint(int n){ vector<int> ret(10), used; int i = 0, idx = 0; while(!used[i]){ used[i] = 1; ++idx; i = (i+i) & 1023; if(!used[i+1]) ++i; ret.push_back(i & 1); ans[i] = idx; } ret.resize(n); } int find_location(int n, vector<int> c){ if(c.back() < 0){ int r = n + 1; for(int i : c) if(i > 0) --r; return r; } int x = 0; for(int i : c) x = x + x + i; return ans[x]; }

컴파일 시 표준 에러 (stderr) 메시지

squares.cpp: In function 'std::vector<int> paint(int)':
squares.cpp:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...