제출 #7196

#제출 시각아이디문제언어결과실행 시간메모리
7196tncks0121행성 탐사 (GA8_planet)C++98
95.60 / 100
728 ms1756 KiB
#include "planet.h"
   
#define N 2222
   
void ainta() {
    int i;
    for(i = 0; i < 100; i++) paint(i, i);
}
   
void sangsoo() {
    int r, c, k, t = 0;
   
    for(c = 0; ; c = (c + ++t) % N) {
        if(count_col(c) != 0) break;
    }
   
    for(k = 6; k >= 0; k--, ++t) {
        c = (c - (1<<k) + N) % N;
        if(!count_col(c)) c = (c + (1<<k) + N) % N;
    }
   
    for(r = 0; ; r = (r + ++t) % N) {
        if(count_row(r) != 0) break;
    }
   
    for(k = 6; k >= 0; k--) {
        r = (r - (1<<k) + N) % N;
        if(!count_row(r)) r = (r + (1<<k) + N) % N;
    }
   
    report(r, c);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...