QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21420 | #2826. 历史行程 | Skyqwq# | AC ✓ | 3ms | 3720kb | C++14 | 1.1kb | 2022-03-04 22:56:43 | 2022-05-08 03:13:45 |
Judging History
answer
// Skyqwq
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef pair<int, int> PII;
typedef long long LL;
template <typename T> bool chkMax(T &x, T y) { return (y > x) ? x = y, 1 : 0; }
template <typename T> bool chkMin(T &x, T y) { return (y < x) ? x = y, 1 : 0; }
template <typename T> void inline read(T &x) {
int f = 1; x = 0; char s = getchar();
while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); }
while (s <= '9' && s >= '0') x = x * 10 + (s ^ 48), s = getchar();
x *= f;
}
int y;
int main() {
cin >> y;
int v = 0;
for (int i = y + 1; i <= 2019; i++) {
v += 365;
if ((i % 4 == 0 && i % 100) || i % 400 == 0) v++;
}
v %= 7;
v = (7 - v) % 7;
for (int i = 0; i < 11; i++) {
v = (v + 6) % 7;
}
int c = 0;
int a = 1;
while (1) {
if (v % 7 == 0) c++;
if (c == 2) {
cout << a << endl;
return 0;
}
++a, (v += 1) %= 7;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3568kb
input:
1913
output:
11
result:
ok single line: '11'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
1914
output:
10
result:
ok single line: '10'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1915
output:
9
result:
ok single line: '9'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3536kb
input:
1916
output:
14
result:
ok single line: '14'
Test #5:
score: 0
Accepted
time: 3ms
memory: 3600kb
input:
1917
output:
13
result:
ok single line: '13'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
1918
output:
12
result:
ok single line: '12'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
1919
output:
11
result:
ok single line: '11'
Test #8:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1920
output:
9
result:
ok single line: '9'
Test #9:
score: 0
Accepted
time: 2ms
memory: 3680kb
input:
1921
output:
8
result:
ok single line: '8'
Test #10:
score: 0
Accepted
time: 3ms
memory: 3720kb
input:
1922
output:
14
result:
ok single line: '14'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3676kb
input:
1923
output:
13
result:
ok single line: '13'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1924
output:
11
result:
ok single line: '11'
Test #13:
score: 0
Accepted
time: 3ms
memory: 3588kb
input:
1925
output:
10
result:
ok single line: '10'
Test #14:
score: 0
Accepted
time: 3ms
memory: 3680kb
input:
1926
output:
9
result:
ok single line: '9'
Test #15:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
1927
output:
8
result:
ok single line: '8'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
1928
output:
13
result:
ok single line: '13'
Test #17:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
1929
output:
12
result:
ok single line: '12'
Test #18:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
1930
output:
11
result:
ok single line: '11'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3680kb
input:
1931
output:
10
result:
ok single line: '10'
Test #20:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1932
output:
8
result:
ok single line: '8'
Test #21:
score: 0
Accepted
time: 3ms
memory: 3520kb
input:
1933
output:
14
result:
ok single line: '14'
Test #22:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
1934
output:
13
result:
ok single line: '13'
Test #23:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1935
output:
12
result:
ok single line: '12'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
1936
output:
10
result:
ok single line: '10'
Test #25:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
1937
output:
9
result:
ok single line: '9'
Test #26:
score: 0
Accepted
time: 2ms
memory: 3648kb
input:
1938
output:
8
result:
ok single line: '8'
Test #27:
score: 0
Accepted
time: 3ms
memory: 3648kb
input:
1939
output:
14
result:
ok single line: '14'
Test #28:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1940
output:
12
result:
ok single line: '12'
Test #29:
score: 0
Accepted
time: 3ms
memory: 3536kb
input:
1941
output:
11
result:
ok single line: '11'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
1942
output:
10
result:
ok single line: '10'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
1943
output:
9
result:
ok single line: '9'
Test #32:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1944
output:
14
result:
ok single line: '14'
Test #33:
score: 0
Accepted
time: 1ms
memory: 3448kb
input:
1945
output:
13
result:
ok single line: '13'
Test #34:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
1946
output:
12
result:
ok single line: '12'
Test #35:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
1947
output:
11
result:
ok single line: '11'
Test #36:
score: 0
Accepted
time: 2ms
memory: 3668kb
input:
1948
output:
9
result:
ok single line: '9'
Test #37:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
1949
output:
8
result:
ok single line: '8'
Test #38:
score: 0
Accepted
time: 3ms
memory: 3536kb
input:
1950
output:
14
result:
ok single line: '14'
Test #39:
score: 0
Accepted
time: 3ms
memory: 3648kb
input:
1951
output:
13
result:
ok single line: '13'
Test #40:
score: 0
Accepted
time: 3ms
memory: 3716kb
input:
1952
output:
11
result:
ok single line: '11'
Test #41:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
1953
output:
10
result:
ok single line: '10'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
1954
output:
9
result:
ok single line: '9'
Test #43:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1955
output:
8
result:
ok single line: '8'
Test #44:
score: 0
Accepted
time: 3ms
memory: 3664kb
input:
1956
output:
13
result:
ok single line: '13'
Test #45:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1957
output:
12
result:
ok single line: '12'
Test #46:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
1958
output:
11
result:
ok single line: '11'
Test #47:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1959
output:
10
result:
ok single line: '10'
Test #48:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1960
output:
8
result:
ok single line: '8'
Test #49:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
1961
output:
14
result:
ok single line: '14'
Test #50:
score: 0
Accepted
time: 3ms
memory: 3624kb
input:
1962
output:
13
result:
ok single line: '13'
Test #51:
score: 0
Accepted
time: 3ms
memory: 3516kb
input:
1963
output:
12
result:
ok single line: '12'
Test #52:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
1964
output:
10
result:
ok single line: '10'
Test #53:
score: 0
Accepted
time: 3ms
memory: 3596kb
input:
1965
output:
9
result:
ok single line: '9'
Test #54:
score: 0
Accepted
time: 3ms
memory: 3580kb
input:
1966
output:
8
result:
ok single line: '8'
Test #55:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
1967
output:
14
result:
ok single line: '14'
Test #56:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
1968
output:
12
result:
ok single line: '12'
Test #57:
score: 0
Accepted
time: 3ms
memory: 3592kb
input:
1969
output:
11
result:
ok single line: '11'
Test #58:
score: 0
Accepted
time: 3ms
memory: 3536kb
input:
1970
output:
10
result:
ok single line: '10'
Test #59:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1971
output:
9
result:
ok single line: '9'
Test #60:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
1972
output:
14
result:
ok single line: '14'
Test #61:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
1973
output:
13
result:
ok single line: '13'
Test #62:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1974
output:
12
result:
ok single line: '12'
Test #63:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
1975
output:
11
result:
ok single line: '11'
Test #64:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1976
output:
9
result:
ok single line: '9'
Test #65:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
1977
output:
8
result:
ok single line: '8'
Test #66:
score: 0
Accepted
time: 3ms
memory: 3720kb
input:
1978
output:
14
result:
ok single line: '14'
Test #67:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1979
output:
13
result:
ok single line: '13'
Test #68:
score: 0
Accepted
time: 3ms
memory: 3716kb
input:
1980
output:
11
result:
ok single line: '11'
Test #69:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1981
output:
10
result:
ok single line: '10'
Test #70:
score: 0
Accepted
time: 3ms
memory: 3596kb
input:
1982
output:
9
result:
ok single line: '9'
Test #71:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
1983
output:
8
result:
ok single line: '8'
Test #72:
score: 0
Accepted
time: 2ms
memory: 3680kb
input:
1984
output:
13
result:
ok single line: '13'
Test #73:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1985
output:
12
result:
ok single line: '12'
Test #74:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
1986
output:
11
result:
ok single line: '11'
Test #75:
score: 0
Accepted
time: 3ms
memory: 3680kb
input:
1987
output:
10
result:
ok single line: '10'
Test #76:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1988
output:
8
result:
ok single line: '8'
Test #77:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
1989
output:
14
result:
ok single line: '14'
Test #78:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
1990
output:
13
result:
ok single line: '13'
Test #79:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
1991
output:
12
result:
ok single line: '12'
Test #80:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
1992
output:
10
result:
ok single line: '10'
Test #81:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
1993
output:
9
result:
ok single line: '9'
Test #82:
score: 0
Accepted
time: 3ms
memory: 3676kb
input:
1994
output:
8
result:
ok single line: '8'
Test #83:
score: 0
Accepted
time: 3ms
memory: 3596kb
input:
1995
output:
14
result:
ok single line: '14'
Test #84:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
1996
output:
12
result:
ok single line: '12'
Test #85:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
1997
output:
11
result:
ok single line: '11'
Test #86:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
1998
output:
10
result:
ok single line: '10'
Test #87:
score: 0
Accepted
time: 3ms
memory: 3648kb
input:
1999
output:
9
result:
ok single line: '9'
Test #88:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
2000
output:
14
result:
ok single line: '14'
Test #89:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
2001
output:
13
result:
ok single line: '13'
Test #90:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
2002
output:
12
result:
ok single line: '12'
Test #91:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
2003
output:
11
result:
ok single line: '11'
Test #92:
score: 0
Accepted
time: 3ms
memory: 3560kb
input:
2004
output:
9
result:
ok single line: '9'
Test #93:
score: 0
Accepted
time: 3ms
memory: 3592kb
input:
2005
output:
8
result:
ok single line: '8'
Test #94:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
2006
output:
14
result:
ok single line: '14'
Test #95:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
2007
output:
13
result:
ok single line: '13'
Test #96:
score: 0
Accepted
time: 3ms
memory: 3668kb
input:
2008
output:
11
result:
ok single line: '11'
Test #97:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
2009
output:
10
result:
ok single line: '10'
Test #98:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
2010
output:
9
result:
ok single line: '9'
Test #99:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
2011
output:
8
result:
ok single line: '8'
Test #100:
score: 0
Accepted
time: 3ms
memory: 3584kb
input:
2012
output:
13
result:
ok single line: '13'
Test #101:
score: 0
Accepted
time: 3ms
memory: 3588kb
input:
2013
output:
12
result:
ok single line: '12'
Test #102:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
2014
output:
11
result:
ok single line: '11'
Test #103:
score: 0
Accepted
time: 3ms
memory: 3556kb
input:
2015
output:
10
result:
ok single line: '10'
Test #104:
score: 0
Accepted
time: 3ms
memory: 3588kb
input:
2016
output:
8
result:
ok single line: '8'
Test #105:
score: 0
Accepted
time: 2ms
memory: 3588kb
input:
2017
output:
14
result:
ok single line: '14'
Test #106:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
2018
output:
13
result:
ok single line: '13'
Test #107:
score: 0
Accepted
time: 3ms
memory: 3652kb
input:
2019
output:
12
result:
ok single line: '12'