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"
const int EE = 2222;
void ainta() {
for (int i=0; i<66; i++) {
paint(i,0);
}
for (int i=0; i<66; i++) {
paint(0,i);
}
for (int i=0; i<7 + 34 - 66 + 7 + 34; i++) {
paint(0,0);
}
}
void sangsoo() {
for(int i=0; i<66; i++){
count_row(42);
}
int posx = 0;
for (int i=0; i<34; i++) {
if(count_row(i * 66 % EE)) posx = 66 * i % EE; // step 2.
}
int s = 0, e = 65;
for(int i=0; i<7; i++){
if(s == e){
count_row(42);
continue;
}
int m = (s+e+1) / 2;
int new_pos = (posx + EE - m) % EE;
if(count_row(new_pos)) s = m;
else e = m-1;
}
posx = (posx + EE - s) % EE;
int posy = 0;
for (int i=0; i<34; i++) {
if(count_col(66 * i % EE)) posy = 66 * i % EE; // step 2.
}
s = 0, e = 65;
for(int i=0; i<7; i++){
if(s == e){
count_row(42);
continue;
}
int m = (s+e+1) / 2;
int new_pos = (posy + EE - m) % EE;
if(count_col(new_pos)) s = m;
else e = m-1;
}
posy = (posy + EE - s) % EE;
report(posx,posy);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |