/*
ID: ljfcnya1
PROG: friday
LANG: C++
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i, a, b) for(int i = (a), _end_ = (b);i <= _end_; ++ i)
#define mem(a) memset((a), 0, sizeof(a))
#define str(a) strlen(a)
const int maxn = 10000;
int n, m;
void read(int &x) {
x = 0;
char c = getchar();
while(c < '0' || c > '9')
c = getchar();
while(c >= '0' && c <= '9') {
x = x * 10 + c - '0';
c = getchar();
}
}
int date[13] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, ans[8];
int main() {
freopen("friday.in", "r", stdin);
freopen("friday.out", "w", stdout);
scanf("%d", &n);
int today = 0;
REP(i, 1900, 1900 + n - 1) {
if((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
date[1] = 29;
else
date[1] = 28;
REP(j, 0, 11)
REP(k, 1, date[j]) {
++today;
if(k == 13)
++ans[today];
if(today == 7)
today = 0;
}
}
printf("%d %d", ans[6], ans[7]);
REP(i, 1, 5)
printf(" %d", ans[i]);
puts("");
return 0;
}
Usaco1.1 friday
最新推荐文章于 2018-12-12 21:44:53 发布