首页 > 其他 > 详细

URAL 1877 Bicycle Codes

时间:2014-07-19 15:01:51      阅读:455      评论:0      收藏:0      [点我收藏+]

1877. Bicycle Codes

Time limit: 0.5 second
Memory limit: 64 MB
Den has two four-digit combination locks for protecting his bicycle from thieves. Every evening he arms the bicycle antitheft alarm and fastens the bicycle to a special stand with one of the locks. Den never uses the same lock two evenings in a row. One night a thief tried to open the lock using the code 0000. The alarm went off and the thief hurried away. The next night the thief decided to try the code 0001, then 0002, and so on in ascending order of the number.
Den never changes the codes of his locks. On the night when the thief came for the first time the bicycle was fastened with the first lock.

Input

The first line contains the combination that opens the first lock and the second line contains the combination that opens the second lock. Both combinations are strings consisting of four digits from 0 to 9.

Output

Output “yes” if the thief will open the lock sooner or later and “no” otherwise.

Samples

inputoutput
0001
0000
no
0002
0001
yes

Problem Author: Denis Mukhametianov
Problem Source: Ural Regional School Programming Contest 2011

bubuko.com,布布扣
 1 #include<iostream>  
 2 #include<string.h>  
 3 #include<stdio.h>  
 4 #include<ctype.h>  
 5 #include<algorithm>  
 6 #include<stack>  
 7 #include<queue>  
 8 #include<set>  
 9 #include<math.h>  
10 #include<vector>  
11 #include<map>  
12 #include<deque>  
13 #include<list>  
14 using namespace std;  
15 int main()
16 {
17     int a,b;
18     scanf("%d%d",&a,&b);
19     if(a%2==0||b%2==1) 
20     printf("yes\n");
21     else 
22     printf("no\n");
23     return 0;
24 }
View Code

URAL 1877 Bicycle Codes,布布扣,bubuko.com

URAL 1877 Bicycle Codes

原文:http://www.cnblogs.com/qscqesze/p/3854181.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!