結果
| 問題 |
No.571 3人兄弟(その2)
|
| コンテスト | |
| ユーザー |
mban
|
| 提出日時 | 2017-10-06 22:55:32 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 1,218 bytes |
| コンパイル時間 | 995 ms |
| コンパイル使用メモリ | 112,840 KB |
| 実行使用メモリ | 17,920 KB |
| 最終ジャッジ日時 | 2024-11-17 01:51:49 |
| 合計ジャッジ時間 | 1,999 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
struct P
{
public int H,W;
}
class Program
{
private P A,B,C;
private void Scan()
{
var l=Console.ReadLine().Split(' ');
A.H=int.Parse(l[0]);
A.W=int.Parse(l[1]);
l=Console.ReadLine().Split(' ');
B.H=int.Parse(l[0]);
B.W=int.Parse(l[1]);
l=Console.ReadLine().Split(' ');
C.H=int.Parse(l[0]);
C.W=int.Parse(l[1]);
}
private void Calc()
{
var ar=new P[]{A,B,C};
Array.Sort(ar,(a,b)=>{
if(a.H!=b.H)
{
return -a.H.CompareTo(b.H);
}
else
{
return a.W.CompareTo(b.W);
}
});
foreach(var p in ar)
{
if(p.H==A.H&&p.W==A.W)
Console.WriteLine("A");
if(p.H==B.H&&p.W==B.W)
Console.WriteLine("B");
if(p.H==C.H&&p.W==C.W)
Console.WriteLine("C");
}
}
public void Solve()
{
Scan();
Calc();
}
static void Main()
{
new Program().Solve();
}
}
mban