結果
| 問題 | No.3678 しゃべりすぎた男 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-09 10:05:05 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,190 bytes |
| 記録 | |
| コンパイル時間 | 70 ms |
| コンパイル使用メモリ | 81,152 KB |
| 実行使用メモリ | 67,840 KB |
| 最終ジャッジ日時 | 2026-09-09 10:05:14 |
| 合計ジャッジ時間 | 3,487 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 3 WA * 30 |
ソースコード
import sys
sys.setrecursionlimit(2*10**7)
#↓codon===============================
import string
Alp_low=list(string.ascii_lowercase)
Alp_up=list(string.ascii_uppercase)
Digit="0123456789"
dij=[[0,1],[1,0],[0,-1],[-1,0]]
def nin():
return list(map(int,input().split()))
def deq(x):
return [i-1 for i in x]
mod=998244353
_factorial=[1]
def factorial(n):
while len(_factorial)<=n:
_factorial.append((_factorial[-1]*len(_factorial))%mod)
return _factorial[n]
_inv_factorial=[1]
def inv_factorial(n):
while len(_inv_factorial)<=n:
_inv_factorial.append((_inv_factorial[-1]*pow(len(_inv_factorial),mod-2,mod))%mod)
return _inv_factorial[n]
def binom(n,r):
if r>=mod:
raise ValueError("r is too big")
if n<0:
return 0
if r>n:
return 0
if r<0:
return 0
ans=((factorial(n)*inv_factorial(r))%mod*inv_factorial(n-r))%mod
return ans
def main():
t=nin()
for i in range(7):
if t[i]==-1:
t[i]=10**9
t.sort()
for i in range(7):
s=sum(t[:i+1])
if s>6000:
print(-1)
else:
print(6000-s)
if __name__=="__main__":
main()