結果

問題 No.2795 Perfect Number
コンテスト
ユーザー 6soukiti29
提出日時 2024-07-09 01:21:26
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 264 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,427 ms
コンパイル使用メモリ 69,724 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2026-03-30 08:42:58
合計ジャッジ時間 38,684 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_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 = 0
    i = 1
while i * i <= N:
    if N mod i == 0:
        a += i
        if i * i != N:
            a += N div i
    i += 1

if a == 2 * N:
    echo("Yes")
else:
    echo("No")
0