# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1137669 | lightentheshadow | Colors (BOI20_colors) | C++20 | 0 ms | 420 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
if (n == 1 || n > 1000) {
cout << "= " << n;
return 0;
}
int x = sqrt(n), y = 1, cnt = 0;
for (int i = x / 2 + 1; i <= x; i++) {
int num = i;
while (num + x <= n) num += x;
if (n - num >= i - 1 && (n - num) - (i - 1) <= 1) {
y = i;
break;
}
}
int save[55];
while (y <= n) {
save[++cnt] = y;
y += x;
}
int l = 1, r = cnt, curr = 0, border = n, prev = save[cnt];
cout << "? " << save[cnt] << endl;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |