Submission #00019
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #include<bits/stdc++.h> using namespace std; int arr[6][2]; int cnt = 0; int can = 0; int flg[6][2] ={}; int dfs( int a, int b); int main(){ for ( int i=0;i<6;i++) for ( int j=0;j<2;j++)cin>>arr[i][j]; dfs(0,0); if (can)cout<< "yes" <<endl; else cout<< "no" <<endl; return (0); } int dfs( int a, int b){ int next; if (b==0)next=1; else next = 0; if (cnt==12){ if (arr[a][next] == arr[0][0])can=1; return (0); } for ( int i=0;i<6;i++){ for ( int j=0;j<2 && a!=i;j++){ if (flg[i][j]==0 && flg[a][next]==0 && arr[i][j] == arr[a][next]){ flg[a][next]=flg[i][j]=1; cnt+=2; dfs(i,j); cnt-=2; flg[a][next]=flg[i][j]=0; } } } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0001 - 直方体 |
ユーザー名 | root |
投稿日時 | 2017-10-24 17:50:41 |
言語 | C++11 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 719 Byte |
最大実行時間 | 23 ms |
最大メモリ使用量 | 756 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 6 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in01.txt | AC | 13 ms | 476 KB |
1
|
in02.txt | AC | 16 ms | 700 KB |
1
|
in03.txt | AC | 16 ms | 676 KB |
1
|
in04.txt | AC | 14 ms | 524 KB |
1
|
in05.txt | AC | 16 ms | 496 KB |
1
|
in06.txt | WA | 16 ms | 472 KB |
1
|
in07.txt | WA | 19 ms | 572 KB |
1
|
in08.txt | AC | 17 ms | 548 KB |
1
|
in09.txt | AC | 19 ms | 652 KB |
1
|
in10.txt | AC | 16 ms | 628 KB |
1
|
in11.txt | WA | 20 ms | 476 KB |
1
|
in12.txt | AC | 19 ms | 452 KB |
1
|
in13.txt | AC | 17 ms | 432 KB |
1
|
in14.txt | AC | 19 ms | 536 KB |
1
|
in15.txt | WA | 17 ms | 640 KB |
1
|
in16.txt | AC | 16 ms | 488 KB |
1
|
in17.txt | AC | 13 ms | 592 KB |
1
|
in18.txt | AC | 20 ms | 568 KB |
1
|
in19.txt | AC | 16 ms | 672 KB |
1
|
in20.txt | WA | 16 ms | 644 KB |
1
|
in21.txt | AC | 16 ms | 620 KB |
1
|
in22.txt | WA | 23 ms | 592 KB |
1
|
in23.txt | WA | 16 ms | 572 KB |
1
|
in24.txt | AC | 14 ms | 544 KB |
1
|
in25.txt | WA | 15 ms | 652 KB |
1
|
in26.txt | WA | 21 ms | 756 KB |
1
|
in27.txt | WA | 19 ms | 600 KB |
1
|
in28.txt | WA | 15 ms | 576 KB |
1
|
in29.txt | WA | 15 ms | 676 KB |
1
|
in30.txt | WA | 23 ms | 652 KB |
1
|