結果
| 問題 | No.782 マイナス進数 |
| コンテスト | |
| ユーザー |
silversmith
|
| 提出日時 | 2019-05-01 21:02:14 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 370 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 14,848 KB |
| 実行使用メモリ | 11,520 KB |
| 最終ジャッジ日時 | 2026-10-09 22:58:48 |
| 合計ジャッジ時間 | 4,951 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 WA * 9 |
ソースコード
T, B = map(int,input().split())
N = [int(input()) for l in range(T)]
plusB = -B
for t in N:
a = []
sign = 1
while t != 0:
if sign > 0:
a.append(t % plusB)
t = (t - a[-1]) / plusB
else:
a.append(-t % plusB)
t = (t +a[-1]) / plusB
sign *=-1
print(''.join(map(str,map(int,a[::-1]))))
silversmith