結果

問題 No.2185 平方数の下6桁
ユーザー タコイモタコイモ
提出日時 2023-01-13 22:02:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 71,688 KB
最終ジャッジ日時 2023-08-26 03:47:54
合計ジャッジ時間 4,616 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,480 KB
testcase_01 AC 71 ms
71,348 KB
testcase_02 AC 71 ms
71,124 KB
testcase_03 AC 71 ms
71,132 KB
testcase_04 WA -
testcase_05 AC 72 ms
71,384 KB
testcase_06 AC 71 ms
71,280 KB
testcase_07 AC 70 ms
71,484 KB
testcase_08 AC 70 ms
71,396 KB
testcase_09 AC 71 ms
71,168 KB
testcase_10 AC 70 ms
71,348 KB
testcase_11 AC 72 ms
71,132 KB
testcase_12 AC 70 ms
71,136 KB
testcase_13 AC 71 ms
71,508 KB
testcase_14 AC 70 ms
71,328 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 74 ms
71,268 KB
testcase_18 AC 70 ms
71,516 KB
testcase_19 WA -
testcase_20 AC 71 ms
71,268 KB
testcase_21 AC 72 ms
71,280 KB
testcase_22 WA -
testcase_23 AC 73 ms
71,384 KB
testcase_24 AC 70 ms
71,256 KB
testcase_25 AC 69 ms
71,484 KB
testcase_26 AC 70 ms
71,292 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 70 ms
71,404 KB
testcase_31 AC 71 ms
71,132 KB
testcase_32 AC 71 ms
71,132 KB
testcase_33 AC 71 ms
71,340 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 70 ms
71,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x): #y = N+10**9
  if x == 0:
    return [0]

  if x == 1:
    return [1,9]
  if x == 2 or x == 3 or x == 7 or x == 8:
    return False
  if x == 4:
    return [2,8]
  if x == 5:
    return [5]
  if x == 6:
    return [4,6]
  if x == 9:
    return [3,7]
SS = int(input())
SS += 10**9
ans = [[] for _ in range(7)]
ans[0] = [SS]
for i in range(6):
  for S in ans[i]:
    
    A = str(S)
   
    B = f(int(A[-1]))
    
    if not B:
      continue
    for j in B:
      ans[i+1].append((S-j*j)//10)

if ans[6]:
  print('YES')
else:
  print('NO')
    
 
  
0