Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) A题
来源:互联网 发布:网络大学 编辑:程序博客网 时间:2024/06/10 01:11
题意:
给出一年12个月天数,已经指定。 问是否存在给出的两个星期,是相邻的两个月份。
思路
月份 有28 30 31 三种情况 分别/7 有 X=0 2 3 三种情况。
判断差值
#include <cstdio>#include <iostream>#include <cstring>#include <algorithm>#include <queue>using namespace std;char s[15][20]={"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"};char a[20];char b[20];int main(){ gets(a); gets(b); int lena,lenb; for(int i=0;i<=6;i++ ) { if(strcmp(s[i],a)==0) { lena=i; break; } } for(int i=0;i<=6;i++ ) { if(strcmp(s[i],b)==0) { lenb=i; break; } } int t; if(lena>lenb) { t=7-lena+lenb; } else t=lenb-lena; // cout<<t<<endl; if(t==3||t==0||t==2) { cout<<"YES"<<endl; } else cout<<"NO"<<endl; return 0;}
0 0
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) A题
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)【A,B,C,D】
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) -- A. Checking the Calendar(思路)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)A. Checking the Calendar
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D题
- Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)
- Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)
- Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)
- Coderforces Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) B. Batch Sort
- Codeforces Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) D. Dense Subsequence
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) B
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) -- C. Ray Tracing(STL乱搞)
- 云服务器 ECS CentOS 7配置默认防火墙 Firewall
- windows 各版本激活方式
- httputils查询网络资源
- Codeforces Round Intel Code Challenge Final Round B.Batch Sort
- ShoeBox 快速建立Unity美术字库(NGUI以及UGUI)
- Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) A题
- 在寻找NSRunLoopCommonModes和NSDefaultRunLoopMode区别时发现
- 正向代理与反向代理
- [kuangbin带你飞]专题四 最短路练习 A POJ 2387
- position属性(absolute; relative; fixed)以及相关属性z-index
- Spring切入点表达式常用写法
- AsyncTask与FutureTask运用介绍
- iwebshop sql语句拼接
- 哈希表,二次探测再散列