結果
問題 |
No.2655 Increasing Strides
|
ユーザー |
![]() |
提出日時 | 2025-04-16 00:36:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 221 ms |
コンパイル使用メモリ | 82,912 KB |
実行使用メモリ | 53,492 KB |
最終ジャッジ日時 | 2025-04-16 00:40:41 |
合計ジャッジ時間 | 2,220 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
n = int(input()) def check_case1(n): kx = (n + 1) // 2 if n % 2 else n // 2 sum_x = kx * kx if sum_x % 2 != 0: return False if kx < 4: return False ky = n // 2 if (ky * (ky + 1)) % 4 != 0: return False return True def check_case2(n): kx = n // 2 sum_x = kx * (kx + 1) if sum_x % 4 != 0: return False ky = (n + 1) // 2 if ky % 2 != 0: return False if ky < 4: return False return True if check_case1(n) or check_case2(n): print("Yes") else: print("No")