結果
| 問題 | No.3512 moesode |
| コンテスト | |
| ユーザー |
sig
|
| 提出日時 | 2026-04-24 21:48:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 259 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 94,464 KB |
| 最終ジャッジ日時 | 2026-04-24 21:48:14 |
| 合計ジャッジ時間 | 6,230 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge4_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 12 |
ソースコード
#t = int(input())
t = 1
for _ in range(t):
n,m,k = map(int, input().split())
cou = [0]*n
tf = [False]*n
for i in range(m):
a,b = map(int, input().split())
a -= 1
b -= 1
cou[b] += 1
tf[a] = True
lis = []
aa = tf.count(True)
res = (k+1)-aa
for i in range(n):
if not tf[i]:
lis.append(cou[i])
lis.sort(reverse = True)
ans = 0
for i in range(n):
if tf[i]:
ans += min(cou[i],k)
if lis:
ans += sum(lis[:res])
print((k+1)*k - ans)
sig