結果

問題 No.647 明太子
ユーザー iwkjoseciwkjosec
提出日時 2018-03-25 00:48:16
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 142 ms / 4,500 ms
コード長 1,091 bytes
コンパイル時間 3,279 ms
コンパイル使用メモリ 105,780 KB
実行使用メモリ 27,840 KB
最終ジャッジ日時 2023-09-09 09:42:40
合計ジャッジ時間 5,890 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
21,620 KB
testcase_01 AC 62 ms
23,760 KB
testcase_02 AC 60 ms
21,732 KB
testcase_03 AC 61 ms
21,660 KB
testcase_04 AC 62 ms
23,844 KB
testcase_05 AC 61 ms
21,692 KB
testcase_06 AC 62 ms
21,756 KB
testcase_07 AC 62 ms
23,744 KB
testcase_08 AC 61 ms
23,752 KB
testcase_09 AC 63 ms
23,776 KB
testcase_10 AC 68 ms
21,716 KB
testcase_11 AC 65 ms
23,720 KB
testcase_12 AC 65 ms
21,668 KB
testcase_13 AC 70 ms
25,700 KB
testcase_14 AC 118 ms
25,760 KB
testcase_15 AC 73 ms
21,736 KB
testcase_16 AC 66 ms
19,692 KB
testcase_17 AC 134 ms
23,844 KB
testcase_18 AC 139 ms
23,752 KB
testcase_19 AC 76 ms
23,692 KB
testcase_20 AC 75 ms
23,788 KB
testcase_21 AC 66 ms
21,848 KB
testcase_22 AC 142 ms
27,840 KB
testcase_23 AC 64 ms
19,564 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 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[M];
        var Y = new int[M];
        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]++;
            }
        }
        if(c.Max()==0)WriteLine(0);
        else
        {
            foreach (var a in c.Select((x,i)=>x==c.Max()?i+1:0).Where(x=>x>0))
            {
                WriteLine(a);
            }
        }
    }
}
0