# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
733514 | 2023-05-01T01:22:56 Z | Trunkty | 경찰관과 강도 (BOI14_coprobber) | C++14 | 1 ms | 208 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; //#define int ll #include "coprobber.h" bool isgood[505][505][2]; // 0 - robber, 1 - cop int cnt[505][505]; vector<tuple<int,int,int>> v; int start(int n, bool arr[MAX_N][MAX_N]){ for(int i=0;i<n;i++){ isgood[i][i][0] = true; isgood[i][i][1] = true; v.push_back(make_tuple(i,i,0)); v.push_back(make_tuple(i,i,1)); for(int j=0;j<n;j++){ if(arr[i][j]){ cnt[i][0]++; } } for(int j=1;j<n;j++){ cnt[i][j] = cnt[i][j-1]; } } for(int i=0;i<v.size();i++){ int a = get<0>(v[i]), b = get<1>(v[i]), c = get<2>(v[i]); if(c==0){ for(int j=0;j<n;j++){ if(arr[b][j]){ if(!isgood[a][j][1]){ isgood[a][j][1] = true; v.push_back(make_tuple(a,j,1)); } } } } else{ for(int j=0;j<n;j++){ if(arr[a][j]){ if(!isgood[j][b][0]){ cnt[j][b]--; if(cnt[j][b]==0){ isgood[j][b][0] = true; v.push_back(make_tuple(j,b,0)); } } } } } } for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(!isgood[i][j][0] or !isgood[i][j][1]){ return -1; } } } return 1; } int nextMove(int r){ return -1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | nextMove() returned a value that is either outside 0..N-1 or the new cop position is not a neighbour to the previous one |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | Cop can catch the robber, but start() returned -1 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 208 KB | nextMove() returned a value that is either outside 0..N-1 or the new cop position is not a neighbour to the previous one |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | nextMove() returned a value that is either outside 0..N-1 or the new cop position is not a neighbour to the previous one |
2 | Halted | 0 ms | 0 KB | - |