https://ac.nowcoder.com/acm/contest/554/E

题解:朴素

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG
#define RI register int
#define endl "\n"
using namespace std;
typedef long long ll;
//typedef __int128 lll;
const int N=100000+10;
const int M=100000+10;
const int MOD=1e9+7;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m,k,p,l,r,u,v;
int ans,cnt,flag,temp,sum;
int a,b,c,y;
char str;
struct node{};
bool check(int y){return y%4==0&&y%100!=0||y%400==0;
}
int mo[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}};
int main()
{
#ifdef DEBUGfreopen("input.in", "r", stdin);//freopen("output.out", "w", stdout);
#endif//ios::sync_with_stdio(false);//cin.tie(0);//cout.tie(0);//scanf("%d",&t);//while(t--){while(~scanf("%d%d%d%d",&a,&b,&c,&y)){int week=1;int num=1;ans=0;int year,month,day;for(int i=1850;i<=y;i++){int f=check(i);for(int j=1;j<=12;j++){num=0;for(int k=1;k<=mo[f][j];k++){week++;if(week>7)week=1;if(week==c)num++;if(i==y&&j==a&&b==num&&week==c){ans=1;year=i;month=j;day=k;break;}}}}if(ans){printf("%d/",year);if(month<10)printf("0%d/",month);elseprintf("%d/",month);if(day<10)printf("0%d\n",day);elseprintf("%d\n",day);}else{cout<<"none"<<endl;}}//}#ifdef DEBUGprintf("Time cost : %lf s\n",(double)clock()/CLOCKS_PER_SEC);
#endif//cout << "Hello world!" << endl;return 0;
}

Mother's Day相关推荐

  1. usaco Mother's Milk

    问题:有三个容器A,B,C,只能从一个容器倒入另一容器,要么全部倒入,要么倒直到另一容器满.问容器A为0时,C可能的值 思路: 1.深度优先搜索 用State来表示int a[3],遍历从一容器到另两 ...

  2. UVA10945 Mother bear【Ad Hoc】

    Unforunately for our lazy "heroes", the nuts were planted by an evil bear known as- Dave, ...

  3. USACO 1.4 Mother's Milk 母亲的牛奶(经典的dfs倒水问题)

    [USACO1.4.4]Mother's Milk 母亲的牛奶 Time Limit:10000MS  Memory Limit:65536K Total Submit:42 Accepted:27  ...

  4. mother的含义,母亲节赞美母亲的优美诗句

    从刚开始学习英语的时候,我们就记住了这个英文单词"mother",如今已长大成人甚至为人父母的你,是否真正了解母亲--mother这个单词的真正涵义? 美国抒情诗人霍华德·约翰逊巧 ...

  5. English trip V2 - A 1. Mother tongue 母语 Teacher:Lamb Key: Comparative 比较级 superlative 最高级...

    In this lesson you will learn to talk about languages. 课上内容(Lesson) mother tongue: Chinese official  ...

  6. 母亲节快到了,祝所有母亲节日快乐!Happy Mother‘s Day

    <游子吟>唐·孟郊 慈母手中线,游子身上衣. 临行密密缝,意恐迟迟归. 谁言寸草心,报得三春晖. My kind mother has a needle and thread in her ...

  7. Mother and child 妈妈与孩子

    我拿起那条链子.她用双手接过它,向前探了探身,在我的脖子后把简易的项链钩系好.然后她向后退了几步,好像在看看是否合适.我低下头看着闪闪发亮的玻璃珠和已失去光泽的金色链子,然后抬起头望着她.我很认真地轻 ...

  8. uscao Mother's Milk

    bfs吧,我做过一题非常可乐跟这题很像.就是每次把牛奶在两个杯子中互倒,找到所有情况把a==0这个情况下的c保存起来(可能不同状态下的c相同用vis标记). /* ID: jinbo wu LANG: ...

  9. 母亲的牛奶 Mother's Milk

    题目描述 农民约翰有三个容量分别是A,B,C升的桶,A,B,C分别是三个从1到20的整数, 最初,A和B桶都是空的,而C桶是装满牛奶的.有时,农民把牛奶从一个桶倒到另一个桶中,直到被灌桶装满或原桶空了 ...

最新文章

  1. wamp环境下安装imagick扩展
  2. shell shocked什么意思_Shell 启动类型探究 ── login interactive
  3. 观峰雨个人空间 2010 STOCK ADVICE !
  4. Swift Property Wrapper 属性包装器
  5. pycharm2019.2一个奇怪的bugger,执行后输出内容被莫名处理
  6. 计算机试题新编实训,计算机基础与实训 练习题
  7. linux 针对目录空间配额,linux磁盘配额quota
  8. mysql 报错1005_MysqlERROR 1005错误处理
  9. mysql存储过程 大小写_MySQL数据记录大小写敏感问题【转】
  10. go语言io reader_Golang io.TeeReader()用法及代码示例
  11. 免费又好用的Redis客户端工具!AnotherRedisDesktopManager
  12. 基于javaweb+JSP+Servlet火车票网上订票系统(前台、后台)
  13. pthread_join()详解及实验
  14. SVN冲突的原因和解决
  15. 泛函分析在计算机科学中的应用,泛函分析在小波理论中的应用.doc
  16. 2016年腾讯实习生校园招聘-电面2
  17. 供应链管理环境下,企业采购管理面临哪些要求?
  18. vue路由SPA的介绍
  19. Protobuf简单使用
  20. 关于数据库大小写的问题

热门文章

  1. mysql ibatis xml配置 like_iBatis学习方法及入门总结
  2. 动态让控件超出屏幕_JAVA浏览器控件JxBrowser v7.5上线!更轻松处理Dynamic Favicons...
  3. bean加载context idea_02-基于IDEA创建SpringBoot项目并进行入门分析
  4. c#图片base64去转义字符_C#实现字符串与图片的Base64编码转换操作示例
  5. python给视频加水印_视频水印_Python SDK_服务端SDK_视频点播 - 阿里云
  6. php 调用vnc协议,Centos7下部署VNC(示例代码)
  7. addroutes刷新_vue解决addRoutes多次添加路由重复的操作方法
  8. hashCode() 和equals() 区别和作用
  9. 化工仪表和自动化(自动控制系统)
  10. Python与常见加密方式