結果
| 問題 |
No.1120 Strange Teacher
|
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-07-10 23:44:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 634 bytes |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 48,196 KB |
| 最終ジャッジ日時 | 2024-10-11 20:55:32 |
| 合計ジャッジ時間 | 18,381 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 WA * 2 |
ソースコード
# 嘘解法の提出。WA になるべき。
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = np.array(readline().split(), np.int64)
B = np.array(readline().split(), np.int64)
def main(A, B):
N = len(A)
SA, SB = A.sum(), B.sum()
if N == 2:
if SA != SB:
return -1
return np.abs(A - B).sum() // 2
K = (SA - SB) // (N - 2)
A -= K
x = B - A
# if np.all((x >= 0) & (x % 2 == 0)):
if np.all(x % 2 == 0):
return K
else:
return -1
print(main(A, B))
maspy