結果
問題 | No.8042 本棚 |
ユーザー |
![]() |
提出日時 | 2019-04-01 21:41:59 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 706 bytes |
コンパイル時間 | 997 ms |
コンパイル使用メモリ | 113,688 KB |
実行使用メモリ | 20,224 KB |
最終ジャッジ日時 | 2024-06-28 01:48:37 |
合計ジャッジ時間 | 2,960 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
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;using static System.Console;class Program{static void Main(){var N = int.Parse(ReadLine());var S = new string[N];var id = new int[N];for (int i = 0; i < N; i++){var line = ReadLine().Split();S[i] = line[0];var c = line[1][0];id[i] = c == 'i' ? 1 : c == 'n' ? 2 : c == 's' ? 3 : 4;}foreach (var w in S.Select((x, i) => new { s = x, n = id[i] }).OrderBy(y => y.s).ThenBy(z => z.n)){WriteLine(w.s + " " +( w.n == 1 ? "iti" : w.n == 2 ? "ni" : w.n == 3 ? "san" : "yon"));}}}