結果

問題 No.647 明太子
ユーザー mencottonmencotton
提出日時 2018-02-09 23:30:13
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 141 ms / 4,500 ms
コード長 1,304 bytes
コンパイル時間 2,190 ms
コンパイル使用メモリ 103,896 KB
実行使用メモリ 25,868 KB
最終ジャッジ日時 2023-09-09 09:27:25
合計ジャッジ時間 5,131 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
21,636 KB
testcase_01 AC 62 ms
23,672 KB
testcase_02 AC 60 ms
21,680 KB
testcase_03 AC 62 ms
21,796 KB
testcase_04 AC 63 ms
21,768 KB
testcase_05 AC 61 ms
19,516 KB
testcase_06 AC 61 ms
21,532 KB
testcase_07 AC 62 ms
21,788 KB
testcase_08 AC 61 ms
21,484 KB
testcase_09 AC 64 ms
21,776 KB
testcase_10 AC 65 ms
21,700 KB
testcase_11 AC 62 ms
21,792 KB
testcase_12 AC 64 ms
23,676 KB
testcase_13 AC 67 ms
21,720 KB
testcase_14 AC 123 ms
23,828 KB
testcase_15 AC 71 ms
21,688 KB
testcase_16 AC 64 ms
21,632 KB
testcase_17 AC 136 ms
23,824 KB
testcase_18 AC 141 ms
23,736 KB
testcase_19 AC 77 ms
21,684 KB
testcase_20 AC 78 ms
23,632 KB
testcase_21 AC 68 ms
21,748 KB
testcase_22 AC 132 ms
25,868 KB
testcase_23 AC 63 ms
21,680 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;

namespace _647
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[,] member = new int[n,2];
            for (int i = 0; i < n; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                member[i,0] = x[0]; member[i,1] = x[1];
            }
            int m = int.Parse(Console.ReadLine());
            List<int> ret = new List<int>(); int max = 1;
            for (int i = 0; i < m; i++)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                int mentai = 0;
                for (int j = 0; j < n; j++)
                {
                    if (x[0] <= member[j,0] && member[j,1] <= x[1]) mentai++;
                }
                if (mentai > max) ret.Clear();
                if (mentai >= max) ret.Add(i + 1);
                max = Math.Max(max,mentai);
            }
            if (ret.Count() == 0) Console.WriteLine(0);
            else
            {
                for (int i = 0; i < ret.Count(); i++)
                {
                    Console.WriteLine(ret[i]);
                }
            }
        }
    }
}
0