Skip to content

Commit 284cb20

Browse files
committed
chore
1 parent 32bc2b5 commit 284cb20

File tree

10 files changed

+468
-0
lines changed

10 files changed

+468
-0
lines changed

arc082/c/main.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N = I()
41+
A = LI()
42+
d = [0]*(10**5+1)
43+
44+
if N == 1:
45+
print(1)
46+
return
47+
elif N == 2:
48+
print(2 if abs(A[0] - A[1]) <= 1 else 1)
49+
return
50+
51+
for ai in A:
52+
d[ai] += 1
53+
54+
print(max([sum(d[i-1:i+2]) for i in range(1, N)]))
55+
56+
57+
58+
if __name__ == '__main__':
59+
main()

arc082/contest.acc.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"contest": {
3+
"id": "arc082",
4+
"title": "AtCoder Regular Contest 082",
5+
"url": "https://atcoder.jp/contests/arc082"
6+
},
7+
"tasks": [
8+
{
9+
"id": "arc082_a",
10+
"label": "C",
11+
"title": "Together",
12+
"url": "https://atcoder.jp/contests/arc082/tasks/arc082_a",
13+
"directory": {
14+
"path": "c",
15+
"testdir": "test",
16+
"submit": "main.py"
17+
}
18+
},
19+
{
20+
"id": "arc082_b",
21+
"label": "D",
22+
"title": "Derangement",
23+
"url": "https://atcoder.jp/contests/arc082/tasks/arc082_b",
24+
"directory": {
25+
"path": "d",
26+
"testdir": "test",
27+
"submit": "main.py"
28+
}
29+
},
30+
{
31+
"id": "arc082_c",
32+
"label": "E",
33+
"title": "ConvexScore",
34+
"url": "https://atcoder.jp/contests/arc082/tasks/arc082_c",
35+
"directory": {
36+
"path": "e",
37+
"testdir": "test",
38+
"submit": "main.py"
39+
}
40+
},
41+
{
42+
"id": "arc082_d",
43+
"label": "F",
44+
"title": "Sandglass",
45+
"url": "https://atcoder.jp/contests/arc082/tasks/arc082_d",
46+
"directory": {
47+
"path": "f",
48+
"testdir": "test",
49+
"submit": "main.py"
50+
}
51+
}
52+
]
53+
}

arc082/d/main.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N = I()
41+
42+
if __name__ == '__main__':
43+
main()

arc082/e/main.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N = I()
41+
42+
if __name__ == '__main__':
43+
main()

arc082/f/main.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N = I()
41+
42+
if __name__ == '__main__':
43+
main()

arc102/c/main.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N, K = LI()
41+
42+
43+
44+
if __name__ == '__main__':
45+
main()

arc102/contest.acc.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"contest": {
3+
"id": "arc102",
4+
"title": "AtCoder Regular Contest 102",
5+
"url": "https://atcoder.jp/contests/arc102"
6+
},
7+
"tasks": [
8+
{
9+
"id": "arc102_a",
10+
"label": "C",
11+
"title": "Triangular Relationship",
12+
"url": "https://atcoder.jp/contests/arc102/tasks/arc102_a",
13+
"directory": {
14+
"path": "c",
15+
"testdir": "test",
16+
"submit": "main.py"
17+
}
18+
},
19+
{
20+
"id": "arc102_b",
21+
"label": "D",
22+
"title": "All Your Paths are Different Lengths",
23+
"url": "https://atcoder.jp/contests/arc102/tasks/arc102_b",
24+
"directory": {
25+
"path": "d",
26+
"testdir": "test",
27+
"submit": "main.py"
28+
}
29+
},
30+
{
31+
"id": "arc102_c",
32+
"label": "E",
33+
"title": "Stop. Otherwise...",
34+
"url": "https://atcoder.jp/contests/arc102/tasks/arc102_c",
35+
"directory": {
36+
"path": "e",
37+
"testdir": "test",
38+
"submit": "main.py"
39+
}
40+
},
41+
{
42+
"id": "arc102_d",
43+
"label": "F",
44+
"title": "Revenge of BBuBBBlesort!",
45+
"url": "https://atcoder.jp/contests/arc102/tasks/arc102_d",
46+
"directory": {
47+
"path": "f",
48+
"testdir": "test",
49+
"submit": "main.py"
50+
}
51+
}
52+
]
53+
}

arc102/d/main.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!usr/bin/env python3
2+
from collections import defaultdict, deque, Counter, OrderedDict
3+
from bisect import bisect_left, bisect_right
4+
from functools import reduce, lru_cache
5+
from heapq import heappush, heappop, heapify
6+
7+
import itertools
8+
import math, fractions
9+
import sys, copy
10+
11+
def L(): return sys.stdin.readline().split()
12+
def I(): return int(sys.stdin.readline().rstrip())
13+
def SL(): return list(sys.stdin.readline().rstrip())
14+
def LI(): return [int(x) for x in sys.stdin.readline().split()]
15+
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
16+
def LS(): return [list(x) for x in sys.stdin.readline().split()]
17+
def R(n): return [sys.stdin.readline().strip() for _ in range(n)]
18+
def LR(n): return [L() for _ in range(n)]
19+
def IR(n): return [I() for _ in range(n)]
20+
def LIR(n): return [LI() for _ in range(n)]
21+
def LIR1(n): return [LI1() for _ in range(n)]
22+
def SLR(n): return [SL() for _ in range(n)]
23+
def LSR(n): return [LS() for _ in range(n)]
24+
25+
def perm(n, r): return math.factorial(n) // math.factorial(r)
26+
def comb(n, r): return math.factorial(n) // (math.factorial(r) * math.factorial(n-r))
27+
28+
def make_list(n, *args, default=0): return [make_list(*args, default=default) for _ in range(n)] if args else [default for _ in range(n)]
29+
30+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
31+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
32+
alphabets = "abcdefghijklmnopqrstuvwxyz"
33+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
34+
MOD = 1000000007
35+
INF = float("inf")
36+
37+
sys.setrecursionlimit(1000000)
38+
39+
def main():
40+
N = I()
41+
42+
if __name__ == '__main__':
43+
main()

0 commit comments

Comments
 (0)