結果

問題 No.647 明太子
ユーザー iwkjoseciwkjosec
提出日時 2018-03-25 00:42:35
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 975 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 105,456 KB
実行使用メモリ 27,892 KB
最終ジャッジ日時 2023-09-07 09:04:53
合計ジャッジ時間 6,106 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,852 KB
testcase_01 AC 64 ms
23,708 KB
testcase_02 WA -
testcase_03 RE -
testcase_04 AC 64 ms
19,700 KB
testcase_05 AC 63 ms
21,672 KB
testcase_06 AC 64 ms
23,728 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 67 ms
21,696 KB
testcase_10 AC 70 ms
21,644 KB
testcase_11 RE -
testcase_12 AC 68 ms
21,756 KB
testcase_13 AC 72 ms
23,732 KB
testcase_14 AC 120 ms
21,700 KB
testcase_15 AC 75 ms
21,772 KB
testcase_16 AC 69 ms
21,772 KB
testcase_17 AC 130 ms
23,748 KB
testcase_18 AC 139 ms
25,848 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 135 ms
27,892 KB
testcase_23 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 A = new int[N];
        var B = new int[N];
        for (int i = 0; i < N; i++)
        {
            var AB = ReadLine().Split().Select(int.Parse).ToArray();
            A[i]=AB[0];
            B[i]=AB[1];
        }
        var M =int.Parse(ReadLine());
        var X = new int[N];
        var Y = new int[N];
        for (int i = 0; i < M; i++)
        {
            var XY = ReadLine().Split().Select(int.Parse).ToArray();
            X[i]=XY[0];
            Y[i]=XY[1];
        }
        var c=new int[M];
        for (int i = 0; i < N; i++)
        {
            for (int j = 0; j < M; j++)
            {
                if(A[i]>=X[j]&&B[i]<=Y[j])c[j]++;
            }
        }
        foreach (var i in c.Select((x,i)=>x==c.Max()?i:-1).Where(x=>x>-1))WriteLine(i+1);
    }
}
0