結果

問題 No.2189 六平方和
ユーザー 👑 testestest
提出日時 2022-12-16 02:31:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 449 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 240,140 KB
最終ジャッジ日時 2024-11-26 20:51:26
合計ジャッジ時間 6,584 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,B=map(int,input().split())
X=pow(M,N,B)
print("YES")

d={i*i%B:i for i in range(10**6)}

import random
while True:
  a=random.randint(0,B-1)
  b=random.randint(0,B-1)
  c=random.randint(0,B-1)
  dd=(X-a*a-b*b-c*c)%B
  if dd in d:
    print(a,b,c,d[dd],0,0)
    exit()
0