結果
問題 |
No.2795 Perfect Number
|
ユーザー |
![]() |
提出日時 | 2024-07-09 01:15:15 |
言語 | Nim (2.2.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 287 bytes |
コンパイル時間 | 3,928 ms |
コンパイル使用メモリ | 66,136 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-07-09 01:15:24 |
合計ジャッジ時間 | 7,877 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 TLE * 1 -- * 32 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport] /home/judge/data/code/Main.nim(1, 26) Warning: imported and not used: 'algorithm' [UnusedImport]
ソースコード
import sequtils,strutils,algorithm,math var N = stdin.readline.parseInt a = newSeq[int](0) i = 1 while i ^ 2 <= N: if N mod i == 0: a.add(i) if i * i != N: a.add(N div i) i += 1 if sum(a) == 2 * N: echo("Yes") else: echo("No")