結果
| 問題 |
No.548 国士無双
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-08-26 14:27:05 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 985 bytes |
| コンパイル時間 | 784 ms |
| コンパイル使用メモリ | 110,232 KB |
| 実行使用メモリ | 25,540 KB |
| 最終ジャッジ日時 | 2024-09-17 13:45:01 |
| 合計ジャッジ時間 | 1,943 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
static void Main(){
new Magatro().Solve();
}
}
class Magatro{
private string S = Console.ReadLine();
private int[] Count = new int[200];
public void Solve(){
foreach(var c in S){
Count[c]++;
}
int one = 0;
int two = 0;
char cc='a';
for(char c = 'a';c<='m';c++){
switch(Count[c]){
case 0:
cc = c;
break;
case 1:
one++;
break;
case 2:
two++;
break;
}
}
if(one==13&&two==0){
for(char c='a';c<='m';c++){
Console.WriteLine(c);
}
}
else if(one==11&&two==1){
Console.WriteLine(cc);
}
else{
Console.WriteLine("Impossible");
}
}
}
mban