結果

問題 No.2795 Perfect Number
コンテスト
ユーザー 6soukiti29
提出日時 2024-07-09 01:15:15
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 287 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,818 ms
コンパイル使用メモリ 70,160 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-30 08:41:34
合計ジャッジ時間 38,953 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 TLE * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
/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]

ソースコード

diff #
raw source code

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")

0