답안 #567670

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
567670 2022-05-24T02:26:43 Z zaneyu 경찰관과 강도 (BOI14_coprobber) C++14
0 / 100
0 ms 292 KB
#include "coprobber.h"
#define REP(i,n) for(int i=0;i<n;i++)
int start(int n, bool A[MAX_N][MAX_N])
{
    int c;
    REP(i,n) if(A[0][i]) c=i;
    int r=n/c;
    if(r==2 or c==2){
        return 0;
    } 
    return -1;
}

int nextMove(int R){
    if(R==3) return 0; 
    return R;
}

Compilation message

coprobber.cpp: In function 'int start(int, bool (*)[500])':
coprobber.cpp:8:17: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
    8 |     if(r==2 or c==2){
      |                ~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 284 KB Cop can catch the robber, but start() returned -1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Cop can catch the robber, but start() returned -1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 292 KB Cop can catch the robber, but start() returned -1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 284 KB Cop can catch the robber, but start() returned -1
3 Halted 0 ms 0 KB -