結果
問題 |
No.411 昇順昇順ソート
|
ユーザー |
|
提出日時 | 2016-08-13 23:04:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 566 bytes |
コンパイル時間 | 1,097 ms |
コンパイル使用メモリ | 106,368 KB |
実行使用メモリ | 20,480 KB |
最終ジャッジ日時 | 2024-11-07 16:32:38 |
合計ジャッジ時間 | 3,393 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 WA * 2 |
コンパイルメッセージ
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 Program { static void Main() { var a = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray(); if(a[1]==1) { var k = a[0] - 2; if(k==0) Console.WriteLine(0); else { int p = (int)Math.Pow(2,k); int t = a[0]-3; int count =0; for(;t>0;t--)count+=t; Console.WriteLine(count+p); } } else Console.WriteLine(Math.Pow(2,a[0]-a[1])); } }