Skip to content

Commit 5fd6042

Browse files
committed
🥺chore
1 parent cd00730 commit 5fd6042

File tree

5 files changed

+255
-0
lines changed

5 files changed

+255
-0
lines changed

abc111/a/main.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
from itertools import *
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+
def powerset(iterable):
28+
s = list(iterable)
29+
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
30+
31+
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)]
32+
33+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
34+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
35+
alphabets = "abcdefghijklmnopqrstuvwxyz"
36+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
37+
MOD = 1000000007
38+
INF = float("inf")
39+
40+
sys.setrecursionlimit(1000000)
41+
42+
def main():
43+
N = I()
44+
45+
if __name__ == '__main__':
46+
main()

abc111/b/main.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
from itertools import *
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+
def powerset(iterable):
28+
s = list(iterable)
29+
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
30+
31+
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)]
32+
33+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
34+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
35+
alphabets = "abcdefghijklmnopqrstuvwxyz"
36+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
37+
MOD = 1000000007
38+
INF = float("inf")
39+
40+
sys.setrecursionlimit(1000000)
41+
42+
def main():
43+
N = I()
44+
45+
if __name__ == '__main__':
46+
main()

abc111/c/main.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
from itertools import *
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+
def powerset(iterable):
28+
s = list(iterable)
29+
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
30+
31+
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)]
32+
33+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
34+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
35+
alphabets = "abcdefghijklmnopqrstuvwxyz"
36+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
37+
MOD = 1000000007
38+
INF = float("inf")
39+
40+
sys.setrecursionlimit(1000000)
41+
42+
def main():
43+
n = I()
44+
V = LI()
45+
c1 = Counter(V[::2])
46+
c2 = Counter(V[1::2])
47+
48+
(r1, d1), (r2, d2) = c1.most_common(1)[0], c2.most_common(1)[0]
49+
if r1 == r2:
50+
w1, w2 = c1.most_common(2), c2.most_common(2)
51+
(r3, d3), (r4, d4) = w1[-1], w2[-1]
52+
if len(w1) >= 2 and len(w2) >= 2:
53+
print(min(n - d3 - d2, n - d1 - d4))
54+
elif len(w1) == 1 and len(w2) >= 2:
55+
print(n - d1 - d4)
56+
elif len(w1) >= 2 and len(w2) == 1:
57+
print(n - d2 - d3)
58+
else:
59+
print(n - d1)
60+
else:
61+
print(n - d1 - d2)
62+
63+
if __name__ == '__main__':
64+
main()

abc111/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": "abc111",
4+
"title": "AtCoder Beginner Contest 111",
5+
"url": "https://atcoder.jp/contests/abc111"
6+
},
7+
"tasks": [
8+
{
9+
"id": "abc111_a",
10+
"label": "A",
11+
"title": "AtCoder Beginner Contest 999",
12+
"url": "https://atcoder.jp/contests/abc111/tasks/abc111_a",
13+
"directory": {
14+
"path": "a",
15+
"testdir": "test",
16+
"submit": "main.py"
17+
}
18+
},
19+
{
20+
"id": "abc111_b",
21+
"label": "B",
22+
"title": "AtCoder Beginner Contest 111",
23+
"url": "https://atcoder.jp/contests/abc111/tasks/abc111_b",
24+
"directory": {
25+
"path": "b",
26+
"testdir": "test",
27+
"submit": "main.py"
28+
}
29+
},
30+
{
31+
"id": "arc103_a",
32+
"label": "C",
33+
"title": "/\\/\\/\\/",
34+
"url": "https://atcoder.jp/contests/abc111/tasks/arc103_a",
35+
"directory": {
36+
"path": "c",
37+
"testdir": "test",
38+
"submit": "main.py"
39+
}
40+
},
41+
{
42+
"id": "arc103_b",
43+
"label": "D",
44+
"title": "Robot Arms",
45+
"url": "https://atcoder.jp/contests/abc111/tasks/arc103_b",
46+
"directory": {
47+
"path": "d",
48+
"testdir": "test",
49+
"submit": "main.py"
50+
}
51+
}
52+
]
53+
}

abc111/d/main.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
from itertools import *
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+
def powerset(iterable):
28+
s = list(iterable)
29+
return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
30+
31+
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)]
32+
33+
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
34+
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
35+
alphabets = "abcdefghijklmnopqrstuvwxyz"
36+
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
37+
MOD = 1000000007
38+
INF = float("inf")
39+
40+
sys.setrecursionlimit(1000000)
41+
42+
def main():
43+
N = I()
44+
45+
if __name__ == '__main__':
46+
main()

0 commit comments

Comments
 (0)