結果
| 問題 |
No.820 Power of Two
|
| コンテスト | |
| ユーザー |
nohopen
|
| 提出日時 | 2019-06-28 22:15:56 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 507 bytes |
| コンパイル時間 | 2,456 ms |
| コンパイル使用メモリ | 104,960 KB |
| 実行使用メモリ | 26,164 KB |
| 最終ジャッジ日時 | 2024-07-02 04:50:30 |
| 合計ジャッジ時間 | 3,365 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Sample {
static void Main(string[] args) {
int[] N = Console.ReadLine().Trim()
.Split(' ')
.Select(int.Parse)
.ToArray();
double count = 0;
var n = Math.Pow(2, N[1]);
if (N[1] == 0) {
count = Math.Pow(2, N[0]);
} else {
for (var i = n; i <= Math.Pow(2, N[0]); i+=n) {
count += 1;
}
}
Console.WriteLine(count);
}
}
nohopen