結果
| 問題 | No.3308 One-time Changed Formula |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2025-10-25 02:14:55 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 255 ms / 2,000 ms |
| + 74µs | |
| コード長 | 501 bytes |
| 記録 | |
| コンパイル時間 | 1,217 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 15,872 KB |
| 最終ジャッジ日時 | 2026-07-16 00:07:15 |
| 合計ジャッジ時間 | 5,873 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 15 |
ソースコード
T=int(input())
for tests in range(T):
N=int(input())
S=input().strip()
ANS=0
now=1
for x in S:
if "0"<=x<="9":
k=int(x)
if now==1:
ANS+=9-k
else:
ANS+=k-1
elif x=="+":
if now==1:
ANS+=9
now=1
elif x=="-":
if now==1:
ANS+=9
now=0
else:
if now==1:
ANS+=9
print(ANS)
titia