結果

問題 No.638 Sum of "not power of 2"
ユーザー bluemegane
提出日時 2018-09-09 13:28:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 387 bytes
コンパイル時間 942 ms
コンパイル使用メモリ 103,552 KB
実行使用メモリ 17,664 KB
最終ジャッジ日時 2024-12-23 06:43:52
合計ジャッジ時間 1,985 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    public static void Main()
    {
        var n = long.Parse(Console.ReadLine().Trim());
        for (int i = 3; i < n; i++)
            if (check(i) && check(n - i)) { Console.WriteLine("{0} {1}", i, n - i); goto end; }
        Console.WriteLine(-1);
        end:;
    }
    public static bool check(long n) => (n & (n - 1)) == 0 ? false : true;
}
0