結果
| 問題 |
No.571 3人兄弟(その2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-06 23:01:52 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 2,677 bytes |
| コンパイル時間 | 1,002 ms |
| コンパイル使用メモリ | 115,960 KB |
| 実行使用メモリ | 27,144 KB |
| 最終ジャッジ日時 | 2024-11-17 01:53:40 |
| 合計ジャッジ時間 | 1,968 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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.Linq;
using System.Text;
using System.Collections.Generic;
using STR = System.String;
using INT = System.Int32;
using DEC = System.Double;
class Program
{
public static IO IO = new IO();
public class DATA
{
public INT index;
public INT h;
public INT w;
public DATA(INT INDEX, INT H, INT W)
{
index = INDEX; h = H; w = W;
}
public int Compare(DATA y)
{
int ret = 1;
if (h > y.h)
{
ret = -1;
}
else if (h == y.h)
{
if (w < y.w)
{
ret = -1;
}
}
return ret;
}
}
static void Main(string[] args)
{
INT[][] abc = IO.I(3, ' ');
DATA[] DATALIST = new DATA[3];
char[] o = new char[3] { 'A', 'B', 'C' };
for (int i = 0; i < 3; i++)
{
DATALIST[i] = new DATA(i, abc[i][0], abc[i][1]);
}
Array.Sort(DATALIST, (x, y) => x.Compare(y));
for (int i = 0; i < 3; i++)
{
IO.W(o[DATALIST[i].index]);
}
IO.F();
}
}
public class IO
{
private const int WMAX = 1000;
private StringBuilder SB = new StringBuilder();
private T R<T>(Func<STR, T> f) { return f(Console.ReadLine()); }
private T[] R<T>(Func<STR, T> f, char c) { return S().Split(c).Select(f).ToArray(); }
private T[] R<T>(Func<STR, T> f, INT l) { T[] r = new T[l]; for (INT i = 0; i < l; i++) { r[i] = R(f); } return r; }
private T[][] R<T>(Func<STR, T> f, INT l, char c) { T[][] r = new T[l][]; for (INT i = 0; i < l; i++) { r[i] = R<T>(f, c); } return r; }
private void W<T>(Func<T, STR> f, T v, bool lf = true) { SB.Append(f(v)); if (lf) { SB.Append('\n'); } if (SB.Length >= WMAX) { F(); } }
public STR S() { return R(s => s); }
public STR[] S(char c) { return R(s => s, c); }
public STR[] S(INT l) { return R(s => s, l); }
public STR[][] S(INT l, char c) { return R(s => s, l, c); }
public INT I() { return R(INT.Parse); }
public INT[] I(char c) { return R(INT.Parse, c); }
public INT[] I(INT l) { return R(INT.Parse, l); }
public INT[][] I(INT l, char c) { return R(INT.Parse, l, c); }
public DEC D() { return R(DEC.Parse); }
public DEC[] D(char c) { return R(DEC.Parse, c); }
public DEC[] D(INT l) { return R(DEC.Parse, l); }
public DEC[][] D(INT l, char c) { return R(DEC.Parse, l, c); }
public void W(object s, bool lf = true) { W(v => v.ToString(), s, lf); }
public void F() { Console.Write(SB); SB.Length = 0; }
}