题目出处:codeforces - 29A
水题,计算下每个终点,比较起点和终点不在同一点,就吐不到
the accepted code like this :
复制代码
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// // main.cpp // CF29A // // Created by IntelliegeWither on 15/12/2. // Copyright © 2015年 IntelliegeWither. All rights reserved. // #include<stdio.h> int main() { int a[105],d[105],zd[105]; int n; int i,j,sign=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d%d",&a[i],&d[i]); zd[i]=a[i]+d[i]; } for(i=0;i<n;i++) { for(j=0;j<n;j++) { if(i!=j&&a[i]==zd[j]&&a[j]==zd[i])//相互吐不中,标记 { sign=1; } } } if(sign) { printf("YESn"); } else { printf("NOn"); } }
最后
以上就是魔幻羽毛最近收集整理的关于CodeForces - 29A - Spit Problem的全部内容,更多相关CodeForces内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复