結果
問題 | No.331 CodeRunnerでやれ |
ユーザー | chocorusk |
提出日時 | 2018-12-11 02:43:38 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 330 ms / 5,000 ms |
コード長 | 933 bytes |
コンパイル時間 | 691 ms |
コンパイル使用メモリ | 93,616 KB |
実行使用メモリ | 24,324 KB |
平均クエリ数 | 399.88 |
最終ジャッジ日時 | 2023-09-24 02:02:51 |
合計ジャッジ時間 | 6,917 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 138 ms
23,328 KB |
testcase_01 | AC | 131 ms
24,324 KB |
testcase_02 | AC | 143 ms
23,560 KB |
testcase_03 | AC | 213 ms
23,440 KB |
testcase_04 | AC | 143 ms
23,412 KB |
testcase_05 | AC | 153 ms
23,628 KB |
testcase_06 | AC | 319 ms
24,276 KB |
testcase_07 | AC | 257 ms
23,560 KB |
testcase_08 | AC | 325 ms
23,440 KB |
testcase_09 | AC | 174 ms
23,452 KB |
testcase_10 | AC | 213 ms
23,392 KB |
testcase_11 | AC | 171 ms
23,644 KB |
testcase_12 | AC | 273 ms
24,300 KB |
testcase_13 | AC | 216 ms
23,496 KB |
testcase_14 | AC | 285 ms
24,156 KB |
testcase_15 | AC | 248 ms
23,572 KB |
testcase_16 | AC | 330 ms
23,340 KB |
ソースコード
#include <cstdio> #include <cstring> #include <string> #include <iostream> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> using namespace std; typedef long long int ll; typedef pair<int, int> P; bool e; bool used[50][50]; int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1}; void dfs(int x, int y, int k){ used[x][y]=1; int d; cin>>d; for(int i=0; i<4; i++){ if(d==20151224){ while(1){ cout<<"F"<<endl; string s; cin>>s; if(s=="Merry"){ cin>>s; e=1; return; } } } if(d && !used[x+dx[(k+i)&3]][y+dy[(k+i)&3]]){ cout<<"F"<<endl; dfs(x+dx[(k+i)&3], y+dy[(k+i)&3], (k+i)&3); if(e) return; cout<<"B"<<endl; cin>>d; } cout<<"L"<<endl; cin>>d; } } int main() { dfs(21, 21, 0); return 0; }