Sagheer and Crossroads

我以为一次要输入很多组样例,然后读取EOF终止,结果读一个就行了。。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
int l[4], s[4], r[4], p[4];
int flag = 1;
for (int i = 0; i < 4; i++)
{
cin >> l[i] >> s[i] >> r[i] >> p[i];
}
for (int i = 0; i < 4; i++)
{
if (p[i] && (l[(i + 1) % 4] || s[(i + 2) % 4] || r[(i + 3) % 4] || l[i] || r[i] || s[i]))
flag = 0;
}
cout << (flag ? "NO" : "YES") << endl;
return 0;
}