結果
| 問題 | No.2189 六平方和 |
| ユーザー |
titia
|
| 提出日時 | 2023-01-13 22:20:30 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 19 ms / 2,000 ms |
| + 596µs | |
| コード長 | 472 bytes |
| 記録 | |
| コンパイル時間 | 55 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2026-10-31 22:06:37 |
| 合計ジャッジ時間 | 2,788 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
from math import sqrt
from random import randint
N,M,mod=map(int,input().split())
A=pow(M,N,mod)
iniA=A
while True:
ANS=[]
ANS=[randint(1,10**9)]
A=iniA-ANS[-1]**2
A%=mod
while A>0:
k=int(sqrt(A))
if k==0:
ANS.append(mod)
else:
ANS.append(k)
A-=k*k
A%=mod
while len(ANS)<6:
ANS.append(mod)
if len(ANS)==6:
print("YES")
print(*ANS)
break
titia