結果

問題 No.3042 本棚
ユーザー iwkjoseciwkjosec
提出日時 2019-04-01 21:41:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 706 bytes
コンパイル時間 3,416 ms
コンパイル使用メモリ 111,264 KB
実行使用メモリ 24,876 KB
最終ジャッジ日時 2023-09-10 10:23:51
合計ジャッジ時間 7,007 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
23,016 KB
testcase_01 AC 89 ms
22,784 KB
testcase_02 AC 89 ms
22,672 KB
testcase_03 AC 88 ms
22,900 KB
testcase_04 AC 90 ms
22,648 KB
testcase_05 AC 89 ms
22,612 KB
testcase_06 AC 88 ms
22,764 KB
testcase_07 AC 89 ms
20,904 KB
testcase_08 AC 90 ms
24,744 KB
testcase_09 AC 89 ms
24,876 KB
testcase_10 AC 90 ms
22,760 KB
testcase_11 AC 89 ms
24,868 KB
testcase_12 AC 89 ms
22,984 KB
testcase_13 AC 89 ms
22,788 KB
testcase_14 AC 89 ms
22,856 KB
testcase_15 AC 91 ms
22,888 KB
testcase_16 AC 90 ms
22,952 KB
testcase_17 AC 90 ms
22,776 KB
testcase_18 AC 89 ms
22,868 KB
testcase_19 AC 89 ms
23,004 KB
testcase_20 AC 89 ms
22,812 KB
testcase_21 AC 88 ms
22,756 KB
testcase_22 AC 88 ms
24,848 KB
testcase_23 AC 88 ms
20,828 KB
testcase_24 AC 87 ms
22,844 KB
testcase_25 AC 89 ms
22,852 KB
testcase_26 AC 90 ms
24,748 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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"));
        }
    }
}
0