結果
| 問題 | No.816 Beautiful tuples |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2022-04-27 23:47:17 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 21 ms / 1,500 ms |
| + 167µs | |
| コード長 | 284 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 15,232 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2026-10-12 20:38:44 |
| 合計ジャッジ時間 | 1,591 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from math import gcd
A,B = map(int,read().split())
g = gcd(A,B)
a = A//g
b = B//g
c = 6 - a - b
if sorted((a,b,c)) == [1,2,3]:
print(c * g)
else:
print(-1)
maspy