QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#173573 | #7176. I Flipped The Calendar... | ucup-team1196# | AC ✓ | 1ms | 3560kb | C++23 | 3.1kb | 2023-09-10 00:08:08 | 2023-09-10 00:08:08 |
Judging History
answer
/*
_/ _/ _/ _/ _/ _/ _/_/_/_/_/ _/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/ _/_/
_/_/ _/_/_/_/_/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/_/ _/ _/
*/
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define multi int _;cin>>_;while(_--)
#define debug(x) cerr << #x << " = " << (x) << endl;
#define int long long
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
mt19937 mrand(random_device{}());
int rnd(int x){ return mrand() % x; }
void test() {cerr << "\n";}
template<typename T, typename... Args>
void test(T x, Args... args) {cerr << x << " ";test(args...);}
const ll MOD = 998244353;
// const ll MOD = 1e9+7;
int ksm(int x,int y){int ans=1;x%=MOD;while(y){if(y&1)ans=ans*x%MOD;x=x*x%MOD,y/=2;}return ans;}
const ll P1 = 999971, base1 = 101;
const ll P2 = 999973, base2 = 103;
const ll N = 200005;
//head
signed main()
{
#ifdef localfreopen
// freopen("1.in","r",stdin);
#endif
fastio
int n;
cin >> n;
vector<int> month = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int s = 3;
int d = 1, y = 1970, m = 1;
while(1)
{
if(y == n) break;
if((y % 4 == 0 && y % 100 != 0 && d == 1 && m == 1) || (y % 400 == 0 && d == 1 && m == 1))
{
month[2]++;
}
s++;
if(s == 8) s = 1;
d++;
if((y % 4 == 0 && y % 100 != 0 && d == 31 && m == 12) || (y % 400 == 0 && d == 31 && m == 12))
{
month[2]--;
}
if(d > month[m])
{
m++;
d = 1;
}
if(m > 12)
{
y++;
m = 1;
}
}
int ans = 0;
while(y <= n)
{
if((y % 4 == 0 && y % 100 != 0 && d == 1 && m == 1) || (y % 400 == 0 && d == 1 && m == 1))
{
month[2]++;
}
s++;
if(s == 8) s = 1;
if(s == 1 || d == 1){
ans++;
// test(y, m, d, s);
}
d++;
if((y % 4 == 0 && y % 100 != 0 && d == 31 && m == 12) || (y % 400 == 0 && d == 31 && m == 12))
{
month[2]--;
}
if(d > month[m])
{
m++;
d = 1;
}
if(m > 12)
{
y++;
m = 1;
}
}
cout << ans << "\n";
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3440kb
input:
2023
output:
63
result:
ok 1 number(s): "63"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
1970
output:
63
result:
ok 1 number(s): "63"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
1971
output:
61
result:
ok 1 number(s): "61"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
1972
output:
63
result:
ok 1 number(s): "63"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
1973
output:
63
result:
ok 1 number(s): "63"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
1974
output:
62
result:
ok 1 number(s): "62"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
1975
output:
62
result:
ok 1 number(s): "62"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
1976
output:
62
result:
ok 1 number(s): "62"
Test #9:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
1977
output:
63
result:
ok 1 number(s): "63"
Test #10:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
1978
output:
63
result:
ok 1 number(s): "63"
Test #11:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
1979
output:
63
result:
ok 1 number(s): "63"
Test #12:
score: 0
Accepted
time: 1ms
memory: 3424kb
input:
1980
output:
62
result:
ok 1 number(s): "62"
Test #13:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
1981
output:
63
result:
ok 1 number(s): "63"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
1982
output:
61
result:
ok 1 number(s): "61"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3512kb
input:
1983
output:
63
result:
ok 1 number(s): "63"
Test #16:
score: 0
Accepted
time: 1ms
memory: 3412kb
input:
1984
output:
64
result:
ok 1 number(s): "64"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
1985
output:
62
result:
ok 1 number(s): "62"
Test #18:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
1986
output:
62
result:
ok 1 number(s): "62"
Test #19:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
1987
output:
63
result:
ok 1 number(s): "63"
Test #20:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
1988
output:
62
result:
ok 1 number(s): "62"
Test #21:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
1989
output:
63
result:
ok 1 number(s): "63"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
1990
output:
63
result:
ok 1 number(s): "63"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
1991
output:
62
result:
ok 1 number(s): "62"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
1992
output:
63
result:
ok 1 number(s): "63"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
1993
output:
61
result:
ok 1 number(s): "61"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
1994
output:
63
result:
ok 1 number(s): "63"
Test #27:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
1995
output:
63
result:
ok 1 number(s): "63"
Test #28:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
1996
output:
62
result:
ok 1 number(s): "62"
Test #29:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
1997
output:
62
result:
ok 1 number(s): "62"
Test #30:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
1998
output:
63
result:
ok 1 number(s): "63"
Test #31:
score: 0
Accepted
time: 1ms
memory: 3452kb
input:
1999
output:
61
result:
ok 1 number(s): "61"
Test #32:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
2000
output:
63
result:
ok 1 number(s): "63"
Test #33:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
2001
output:
63
result:
ok 1 number(s): "63"
Test #34:
score: 0
Accepted
time: 0ms
memory: 3472kb
input:
2002
output:
62
result:
ok 1 number(s): "62"
Test #35:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
2003
output:
62
result:
ok 1 number(s): "62"
Test #36:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
2004
output:
62
result:
ok 1 number(s): "62"
Test #37:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2005
output:
63
result:
ok 1 number(s): "63"
Test #38:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
2006
output:
63
result:
ok 1 number(s): "63"
Test #39:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
2007
output:
63
result:
ok 1 number(s): "63"
Test #40:
score: 0
Accepted
time: 1ms
memory: 3468kb
input:
2008
output:
62
result:
ok 1 number(s): "62"
Test #41:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
2009
output:
63
result:
ok 1 number(s): "63"
Test #42:
score: 0
Accepted
time: 1ms
memory: 3456kb
input:
2010
output:
61
result:
ok 1 number(s): "61"
Test #43:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
2011
output:
63
result:
ok 1 number(s): "63"
Test #44:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
2012
output:
64
result:
ok 1 number(s): "64"
Test #45:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
2013
output:
62
result:
ok 1 number(s): "62"
Test #46:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
2014
output:
62
result:
ok 1 number(s): "62"
Test #47:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
2015
output:
63
result:
ok 1 number(s): "63"
Test #48:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
2016
output:
62
result:
ok 1 number(s): "62"
Test #49:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
2017
output:
63
result:
ok 1 number(s): "63"
Test #50:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2018
output:
63
result:
ok 1 number(s): "63"
Test #51:
score: 0
Accepted
time: 1ms
memory: 3444kb
input:
2019
output:
62
result:
ok 1 number(s): "62"
Test #52:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
2020
output:
63
result:
ok 1 number(s): "63"
Test #53:
score: 0
Accepted
time: 0ms
memory: 3436kb
input:
2021
output:
61
result:
ok 1 number(s): "61"
Test #54:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
2022
output:
63
result:
ok 1 number(s): "63"
Test #55:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
2024
output:
62
result:
ok 1 number(s): "62"
Test #56:
score: 0
Accepted
time: 0ms
memory: 3468kb
input:
2025
output:
62
result:
ok 1 number(s): "62"
Test #57:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
2026
output:
63
result:
ok 1 number(s): "63"
Test #58:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2027
output:
61
result:
ok 1 number(s): "61"
Test #59:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
2028
output:
63
result:
ok 1 number(s): "63"
Test #60:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2029
output:
63
result:
ok 1 number(s): "63"
Test #61:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
2030
output:
62
result:
ok 1 number(s): "62"
Test #62:
score: 0
Accepted
time: 1ms
memory: 3476kb
input:
2031
output:
62
result:
ok 1 number(s): "62"
Test #63:
score: 0
Accepted
time: 1ms
memory: 3512kb
input:
2032
output:
62
result:
ok 1 number(s): "62"
Test #64:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
2033
output:
63
result:
ok 1 number(s): "63"
Test #65:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
2034
output:
63
result:
ok 1 number(s): "63"
Test #66:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
2035
output:
63
result:
ok 1 number(s): "63"
Test #67:
score: 0
Accepted
time: 1ms
memory: 3440kb
input:
2036
output:
62
result:
ok 1 number(s): "62"
Test #68:
score: 0
Accepted
time: 1ms
memory: 3480kb
input:
2037
output:
63
result:
ok 1 number(s): "63"
Extra Test:
score: 0
Extra Test Passed