Submission #00058


ソースコード

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 k, n;
int flag = 0;
int num[10][10];
void dfs(int now, int sum)
{
if (now >= n) {
if (sum == 0) {
flag = 1;
}
return;
}
for (int i = 0; i < k; i++) {
//dfs(now+1, abs(sum+num[now][i]));
dfs(now+1, sum^num[now][i]);
}
return;
}
int main()
{
cin >> n >> k;
for (int i = 0; i < n; i++) {
for (int j = 0; j < k; j++) {
cin >> num[i][j];
}
}
dfs(0, 0);
if (flag == 0) {
cout << "Nothing" << endl;
}
else {
cout << "Found" << endl;
}
}

ステータス

項目 データ
問題 0002 - 回れ雛月花 -Easy
ユーザー名 ei1421
投稿日時 2016-04-27 17:08:43
言語 C++11
状態 Accepted
得点 100
ソースコード長 1154 Byte
最大実行時間 14 ms
最大メモリ使用量 684 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 10 ms 476 KB
1
in2.txt AC 13 ms 436 KB
1
in3.txt AC 10 ms 536 KB
1
in4.txt AC 14 ms 516 KB
1
in5.txt AC 13 ms 492 KB
1
in6.txt AC 12 ms 468 KB
1
in7.txt AC 14 ms 444 KB
1
in8.txt AC 12 ms 548 KB
1
in9.txt AC 10 ms 652 KB
1
in10.txt AC 10 ms 448 KB
1
in11.txt AC 12 ms 556 KB
1
in12.txt AC 12 ms 660 KB
1
in13.txt AC 11 ms 636 KB
1
in14.txt AC 10 ms 612 KB
1
in15.txt AC 13 ms 588 KB
1