Skip to content

Commit 886bd86

Browse files
committed
🥺chore
1 parent 6a964a9 commit 886bd86

File tree

5 files changed

+243
-0
lines changed

5 files changed

+243
-0
lines changed

abc018/a/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()

abc018/b/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()

abc018/c/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()

abc018/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": "abc018",
4+
"title": "AtCoder Beginner Contest 018",
5+
"url": "https://atcoder.jp/contests/abc018"
6+
},
7+
"tasks": [
8+
{
9+
"id": "abc018_1",
10+
"label": "A",
11+
"title": "豆まき",
12+
"url": "https://atcoder.jp/contests/abc018/tasks/abc018_1",
13+
"directory": {
14+
"path": "a",
15+
"testdir": "test",
16+
"submit": "main.py"
17+
}
18+
},
19+
{
20+
"id": "abc018_2",
21+
"label": "B",
22+
"title": "文字列の反転",
23+
"url": "https://atcoder.jp/contests/abc018/tasks/abc018_2",
24+
"directory": {
25+
"path": "b",
26+
"testdir": "test",
27+
"submit": "main.py"
28+
}
29+
},
30+
{
31+
"id": "abc018_3",
32+
"label": "C",
33+
"title": "菱型カウント",
34+
"url": "https://atcoder.jp/contests/abc018/tasks/abc018_3",
35+
"directory": {
36+
"path": "c",
37+
"testdir": "test",
38+
"submit": "main.py"
39+
}
40+
},
41+
{
42+
"id": "abc018_4",
43+
"label": "D",
44+
"title": "バレンタインデー",
45+
"url": "https://atcoder.jp/contests/abc018/tasks/abc018_4",
46+
"directory": {
47+
"path": "d",
48+
"testdir": "test",
49+
"submit": "main.py"
50+
}
51+
}
52+
]
53+
}

abc018/d/main.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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, M, P, Q, R = LI()
41+
xyz = LIR(R)
42+
43+
edges = make_list(N, M)
44+
45+
for x, y, z in xyz:
46+
edges[x-1][y-1] = z
47+
48+
ans = 0
49+
50+
for com in itertools.combinations(range(N), P):
51+
score = [0] * M
52+
53+
for w in com:
54+
for m in range(M):
55+
score[m] += edges[w][m]
56+
ans = max(ans, sum(sorted(score, reverse=True)[:Q]))
57+
58+
print(ans)
59+
60+
if __name__ == '__main__':
61+
main()

0 commit comments

Comments
 (0)