結果

問題 No.36 素数が嫌い!
ユーザー AreTrashAreTrash
提出日時 2016-04-13 09:30:13
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 108,820 KB
実行使用メモリ 25,808 KB
最終ジャッジ日時 2024-04-15 00:39:34
合計ジャッジ時間 3,033 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
23,520 KB
testcase_01 AC 25 ms
23,640 KB
testcase_02 AC 24 ms
23,780 KB
testcase_03 AC 23 ms
21,812 KB
testcase_04 WA -
testcase_05 AC 24 ms
23,384 KB
testcase_06 AC 24 ms
23,652 KB
testcase_07 AC 25 ms
25,664 KB
testcase_08 AC 24 ms
23,520 KB
testcase_09 AC 24 ms
23,600 KB
testcase_10 AC 24 ms
23,980 KB
testcase_11 AC 57 ms
23,364 KB
testcase_12 AC 124 ms
23,776 KB
testcase_13 WA -
testcase_14 AC 24 ms
23,744 KB
testcase_15 AC 24 ms
23,776 KB
testcase_16 AC 23 ms
23,512 KB
testcase_17 AC 24 ms
25,560 KB
testcase_18 AC 24 ms
25,808 KB
testcase_19 AC 24 ms
23,852 KB
testcase_20 AC 27 ms
23,396 KB
testcase_21 AC 23 ms
23,748 KB
testcase_22 AC 25 ms
25,404 KB
testcase_23 AC 24 ms
25,540 KB
testcase_24 AC 38 ms
23,520 KB
testcase_25 AC 24 ms
25,664 KB
testcase_26 AC 85 ms
23,596 KB
testcase_27 AC 110 ms
25,668 KB
testcase_28 AC 83 ms
23,748 KB
testcase_29 AC 120 ms
23,520 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace No36_1{
    public class Program{
        public static void Main(string[] args){
            var input = long.Parse(Console.ReadLine());
            var tmp = input;
            var cnt = 0;

            for(long i = 2; i * i <= input; i++){
                while(tmp % i == 0){
                    tmp /= i;
                    cnt++;
                    if(cnt == 2) {
                        Console.WriteLine("YES");
                        return;
                    }
                }
            }
            Console.WriteLine("NO");
        }
    }
}
0