QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#399484 | #2826. 历史行程 | ucup-team1251 | AC ✓ | 0ms | 3852kb | C++17 | 1.1kb | 2024-04-26 13:43:20 | 2024-04-26 13:43:22 |
Judging History
answer
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<math.h>
#include<set>
#include<bitset>
#include<deque>
#include<unordered_map>
#include<algorithm>
#define int long long
using namespace std;
//typedef pair<int,int>PII;
const int N=1e6+10,M=5e2+10;
int a[3000];
int b[10]={10,8,13,11,9,14,12};
int n;
void df(){
stack<int>q;
for(int i=1913;i<=2019;i++){
if(i%400==0 || (i%4==0 && i%100!=0)) q.push(i);
}
int num=0;
while(q.size()){
num++;
int oo=q.top();
q.pop();
a[oo]=b[num%7];
}
cin>>n;
if(n==1913){
cout<<"11\n";
return ;
}
if(n==1914){
cout<<"10\n";
return ;
}
if(n==1915){
cout<<"9\n";
return ;
}
if(n%400==0 || (n%4==0 && n%100!=0)){
cout<<a[n]<<endl;
}
else{
int st=0;
for(int i=1;i<=3;i++){
int oo=n-i;
if(oo%400==0 || (oo%4==0 && oo%100!=0)){
st=i;
break;
}
}
int ans=a[n-st];
while(st--){
if(ans==8) ans=14;
else ans--;
}
cout<<ans<<endl;
}
}
signed main(){
ios::sync_with_stdio(false);
cin.tie();
cout.tie();
int t=1;
// cin>>t;
// n=1913;
while(t--)
{
df();
// n++;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3500kb
input:
1913
output:
11
result:
ok single line: '11'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1914
output:
10
result:
ok single line: '10'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
1915
output:
9
result:
ok single line: '9'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1916
output:
14
result:
ok single line: '14'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1917
output:
13
result:
ok single line: '13'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1918
output:
12
result:
ok single line: '12'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
1919
output:
11
result:
ok single line: '11'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
1920
output:
9
result:
ok single line: '9'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1921
output:
8
result:
ok single line: '8'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1922
output:
14
result:
ok single line: '14'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1923
output:
13
result:
ok single line: '13'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
1924
output:
11
result:
ok single line: '11'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
1925
output:
10
result:
ok single line: '10'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
1926
output:
9
result:
ok single line: '9'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1927
output:
8
result:
ok single line: '8'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1928
output:
13
result:
ok single line: '13'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
1929
output:
12
result:
ok single line: '12'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1930
output:
11
result:
ok single line: '11'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1931
output:
10
result:
ok single line: '10'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1932
output:
8
result:
ok single line: '8'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1933
output:
14
result:
ok single line: '14'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1934
output:
13
result:
ok single line: '13'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1935
output:
12
result:
ok single line: '12'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
1936
output:
10
result:
ok single line: '10'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1937
output:
9
result:
ok single line: '9'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1938
output:
8
result:
ok single line: '8'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
1939
output:
14
result:
ok single line: '14'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1940
output:
12
result:
ok single line: '12'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1941
output:
11
result:
ok single line: '11'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
1942
output:
10
result:
ok single line: '10'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1943
output:
9
result:
ok single line: '9'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
1944
output:
14
result:
ok single line: '14'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1945
output:
13
result:
ok single line: '13'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1946
output:
12
result:
ok single line: '12'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1947
output:
11
result:
ok single line: '11'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1948
output:
9
result:
ok single line: '9'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1949
output:
8
result:
ok single line: '8'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1950
output:
14
result:
ok single line: '14'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1951
output:
13
result:
ok single line: '13'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1952
output:
11
result:
ok single line: '11'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1953
output:
10
result:
ok single line: '10'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1954
output:
9
result:
ok single line: '9'
Test #43:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1955
output:
8
result:
ok single line: '8'
Test #44:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
1956
output:
13
result:
ok single line: '13'
Test #45:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1957
output:
12
result:
ok single line: '12'
Test #46:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1958
output:
11
result:
ok single line: '11'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1959
output:
10
result:
ok single line: '10'
Test #48:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
1960
output:
8
result:
ok single line: '8'
Test #49:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1961
output:
14
result:
ok single line: '14'
Test #50:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
1962
output:
13
result:
ok single line: '13'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1963
output:
12
result:
ok single line: '12'
Test #52:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
1964
output:
10
result:
ok single line: '10'
Test #53:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1965
output:
9
result:
ok single line: '9'
Test #54:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
1966
output:
8
result:
ok single line: '8'
Test #55:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1967
output:
14
result:
ok single line: '14'
Test #56:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
1968
output:
12
result:
ok single line: '12'
Test #57:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
1969
output:
11
result:
ok single line: '11'
Test #58:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
1970
output:
10
result:
ok single line: '10'
Test #59:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
1971
output:
9
result:
ok single line: '9'
Test #60:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1972
output:
14
result:
ok single line: '14'
Test #61:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1973
output:
13
result:
ok single line: '13'
Test #62:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
1974
output:
12
result:
ok single line: '12'
Test #63:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1975
output:
11
result:
ok single line: '11'
Test #64:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1976
output:
9
result:
ok single line: '9'
Test #65:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
1977
output:
8
result:
ok single line: '8'
Test #66:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1978
output:
14
result:
ok single line: '14'
Test #67:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1979
output:
13
result:
ok single line: '13'
Test #68:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
1980
output:
11
result:
ok single line: '11'
Test #69:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
1981
output:
10
result:
ok single line: '10'
Test #70:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
1982
output:
9
result:
ok single line: '9'
Test #71:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1983
output:
8
result:
ok single line: '8'
Test #72:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
1984
output:
13
result:
ok single line: '13'
Test #73:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
1985
output:
12
result:
ok single line: '12'
Test #74:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
1986
output:
11
result:
ok single line: '11'
Test #75:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
1987
output:
10
result:
ok single line: '10'
Test #76:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1988
output:
8
result:
ok single line: '8'
Test #77:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1989
output:
14
result:
ok single line: '14'
Test #78:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
1990
output:
13
result:
ok single line: '13'
Test #79:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1991
output:
12
result:
ok single line: '12'
Test #80:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1992
output:
10
result:
ok single line: '10'
Test #81:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1993
output:
9
result:
ok single line: '9'
Test #82:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1994
output:
8
result:
ok single line: '8'
Test #83:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
1995
output:
14
result:
ok single line: '14'
Test #84:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1996
output:
12
result:
ok single line: '12'
Test #85:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
1997
output:
11
result:
ok single line: '11'
Test #86:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
1998
output:
10
result:
ok single line: '10'
Test #87:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1999
output:
9
result:
ok single line: '9'
Test #88:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
2000
output:
14
result:
ok single line: '14'
Test #89:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
2001
output:
13
result:
ok single line: '13'
Test #90:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
2002
output:
12
result:
ok single line: '12'
Test #91:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
2003
output:
11
result:
ok single line: '11'
Test #92:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
2004
output:
9
result:
ok single line: '9'
Test #93:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2005
output:
8
result:
ok single line: '8'
Test #94:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
2006
output:
14
result:
ok single line: '14'
Test #95:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
2007
output:
13
result:
ok single line: '13'
Test #96:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
2008
output:
11
result:
ok single line: '11'
Test #97:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2009
output:
10
result:
ok single line: '10'
Test #98:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2010
output:
9
result:
ok single line: '9'
Test #99:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
2011
output:
8
result:
ok single line: '8'
Test #100:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
2012
output:
13
result:
ok single line: '13'
Test #101:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
2013
output:
12
result:
ok single line: '12'
Test #102:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
2014
output:
11
result:
ok single line: '11'
Test #103:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
2015
output:
10
result:
ok single line: '10'
Test #104:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2016
output:
8
result:
ok single line: '8'
Test #105:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
2017
output:
14
result:
ok single line: '14'
Test #106:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2018
output:
13
result:
ok single line: '13'
Test #107:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
2019
output:
12
result:
ok single line: '12'