AC日记——Sagheer and Crossroads codeforces 812a

812A - Sagheer and Crossroads

思路;

  模拟;

代码:

#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define Yes {puts("YES\n");return 0;}

int ai[5][5];

int main()
{
    for(int i=1;i<=4;i++)
    {
        scanf("%d%d%d%d",&ai[i][1],&ai[i][2],&ai[i][3],&ai[i][4]);
        if((ai[i][1]||ai[i][2]||ai[i][3])&&ai[i][4]) Yes
    }
    if((ai[1][1]&&ai[4][4])||(ai[1][2]&&ai[3][4])||(ai[1][3]&&ai[2][4])) Yes
    if((ai[2][1]&&ai[1][4])||(ai[2][2]&&ai[4][4])||(ai[2][3]&&ai[3][4])) Yes
    if((ai[3][1]&&ai[2][4])||(ai[3][2]&&ai[1][4])||(ai[3][3]&&ai[4][4])) Yes
    if((ai[4][1]&&ai[3][4])||(ai[4][2]&&ai[2][4])||(ai[4][3]&&ai[1][4])) Yes
    printf("NO\n");
    return 0;
}
时间: 2024-10-14 09:16:52

AC日记——Sagheer and Crossroads codeforces 812a的相关文章

AC日记——Sagheer, the Hausmeister codeforces 812b

812B - Sagheer, the Hausmeister 思路: 搜索: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 20 #define maxm 105 #define INF 0x7fffffff int n,m,deep[maxn][2],num[maxn],

AC日记——Dynamic Problem Scoring codeforces 807d

Dynamic Problem Scoring 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 130 int n,ai[maxn][6],ac[6],cnt,all,last1,last2; double map[3][6]; inline void in(i

AC日记——Is it rated? codeforces 807a

Is it rated? 思路: 水题: 代码: #include <cstdio> #include <cstring> using namespace std; int n,a[1001],b[1001],last=5000; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d%d",&a[i],&b[i]); if(a[i]!=b[i

AC日记——Periodic RMQ Problem codeforces 803G

G - Periodic RMQ Problem 思路: 题目给一段序列,然后序列复制很多次: 维护序列很多次后的性质: 线段树动态开点: 来,上代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 100005 struct TreeNodeType { int l, r, mid

Codeforces Round #417 (Div. 2) A. Sagheer and Crossroads 模拟 枚举

Codeforces Round #417 (Div. 2) A. Sagheer and Crossroads 模拟  枚举 题意 一个红绿灯 按逆时针方向一次给出各个路口的左转,直行,右转,以及行人车道让你判断,汽车是否有可能撞到行人 注意 当前车道的左转有可能撞到别的车道的行人的 题解 一大堆特判 1 #include <cstdio> 2 #include <cmath> 3 #include <cstdlib> 4 #include <cstring&g

AC日记——Aragorn&#39;s Story HDU 3966

Aragorn's Story Time Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10510    Accepted Submission(s): 2766 Problem Description Our protagonist is the handsome human prince Aragorn comes from The Lor

AC日记——Success Rate codeforces 807c

Success Rate 思路: 水题: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define ll long long inline void in(ll &now) { char Cget=getchar();now=0; while(Cget>'9'||Cget<'0

AC日记——Cards Sorting codeforces 830B

Cards Sorting 思路: 线段树: 代码: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 100005 #define INF 0x3f3f3f3f #define maxtree maxn<<2 int n,ai[maxn],val[maxtree],L[ma

AC日记——Broken BST codeforces 797d

D - Broken BST 思路: 二叉搜索树: 它时间很优是因为每次都能把区间缩减为原来的一半: 所以,我们每次都缩减权值区间. 然后判断dis[now]是否在区间中: 代码: #include <map> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; #define maxn 100005