This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "planet.h"
#define N 2222
void ainta() {
int i;
for (i = 0; i <= 100; i++){
paint(i*50%N, i*50%N);
}
}
void sangsoo() {
int i, x, y, B, E, M, R, a, b, cnt = 0, R2;
for (i = 0;; i++){
cnt++;
if (count_row((N*N-i * 51) % 2222))break;
}
a = i;
R = (N*N - i * 51) % 2222; B = 1, E = 100, R2 = 0;
while (B <= E){
M = (B + E) >> 1;
if (count_row((R - M*50 + N*N)%N)){ R2 = M; B = M + 1; }
else E = M - 1;
}
x = (R - R2 * 50 + N*N) % 2222;
for (i = 0;; i++){
cnt++;
if (count_col((N*N - i * 101) % 2222))break;
}
b = i;
R = (N*N - i * 101) % 2222; B = 1, E = 100, R2 = 0;
while (B <= E){
M = (B + E) >> 1;
if (count_col((R - M * 50 + N*N) % N)){ R2 = M; B = M + 1; }
else E = M - 1;
}
y = (R - R2 * 50 + N*N) % 2222;
report(x, y);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |