結果
問題 |
No.638 Sum of "not power of 2"
|
ユーザー |
![]() |
提出日時 | 2018-01-26 22:28:26 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 594 bytes |
コンパイル時間 | 3,733 ms |
コンパイル使用メモリ | 103,936 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-12-30 02:18:43 |
合計ジャッジ時間 | 1,890 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 11 WA * 1 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; namespace _638 { class Program { static void Main(string[] args) { int[] a = new int[] { 3,5,6,7 }; long n = long.Parse(Console.ReadLine()); if (n < 8) Console.WriteLine(-1); else { int i = 0; for (; true; i++) { long x = n - a[i]; while (x % 2 == 0) x /= 2; if (x != 1) break; } Console.WriteLine(a[i] + " " + (n - a[i])); } } } }