結果
問題 | No.152 貯金箱の消失 |
ユーザー |
|
提出日時 | 2019-01-27 01:10:47 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 70 ms / 5,000 ms |
コード長 | 499 bytes |
コンパイル時間 | 2,271 ms |
コンパイル使用メモリ | 60,836 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-01 10:59:26 |
合計ジャッジ時間 | 3,276 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
import mathproc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}proc scan(): int =while true:let k = getchar_unlocked()if k < '0': breakresult = 10 * result + k.ord - '0'.ordproc solve(n:int):int =for x in 1..n:for y in (x+1)..n:let a = (x * x - y * y).abslet b = 2 * x * ylet c = x * x + y * yif a + b + c > n : breakif a.gcd(b).gcd(c) != 1 : continueresult += 1let n = scan() div 4echo n.solve()