結果

問題 No.647 明太子
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-08-08 02:08:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 233 ms / 4,500 ms
コード長 1,409 bytes
コンパイル時間 891 ms
コンパイル使用メモリ 110,736 KB
実行使用メモリ 27,528 KB
最終ジャッジ日時 2023-10-19 22:32:20
合計ジャッジ時間 3,144 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
25,468 KB
testcase_01 AC 30 ms
25,468 KB
testcase_02 AC 30 ms
25,468 KB
testcase_03 AC 30 ms
25,468 KB
testcase_04 AC 30 ms
25,468 KB
testcase_05 AC 30 ms
25,480 KB
testcase_06 AC 30 ms
25,480 KB
testcase_07 AC 31 ms
25,480 KB
testcase_08 AC 30 ms
25,480 KB
testcase_09 AC 33 ms
25,480 KB
testcase_10 AC 35 ms
25,480 KB
testcase_11 AC 31 ms
25,480 KB
testcase_12 AC 35 ms
25,480 KB
testcase_13 AC 39 ms
25,480 KB
testcase_14 AC 131 ms
27,528 KB
testcase_15 AC 44 ms
25,480 KB
testcase_16 AC 34 ms
25,480 KB
testcase_17 AC 154 ms
27,528 KB
testcase_18 AC 165 ms
27,528 KB
testcase_19 AC 60 ms
27,528 KB
testcase_20 AC 62 ms
25,480 KB
testcase_21 AC 42 ms
25,480 KB
testcase_22 AC 233 ms
27,528 KB
testcase_23 AC 30 ms
25,468 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.Linq;
using System.Collections.Generic;

class No647{
    static void Main(){
        var pC=Int32.Parse(Console.ReadLine());
        List<int> priceList=new List<int>();
        List<int> karasaList=new List<int>();
        for(int i=0;i<pC;++i){
            var people=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
            priceList.Add(people[0]);
            karasaList.Add(people[1]);
        }
        var mC=Int32.Parse(Console.ReadLine());
        for(int i=0;i<mC;++i){
            var mentai=Console.ReadLine().Split(' ').Select(x=>Int32.Parse(x)).ToArray();
            priceList.Add(mentai[0]);
            karasaList.Add(mentai[1]);
        }
        List<int> answerList=new List<int>();
        answerList.Add(0);
        var mentaiCountHozon=0;
        for(int i=0;i<mC;++i){
            var mentaiCount=0;
            for(int j=0;j<pC;++j){
                if(priceList[pC+i]<=priceList[j]&&karasaList[pC+i]>=karasaList[j])mentaiCount++;
            }
            if(mentaiCount>mentaiCountHozon){
                mentaiCountHozon=mentaiCount;
                answerList.Clear();
                answerList.Add(i+1);
            }else if(mentaiCount!=0&&mentaiCount==mentaiCountHozon){
                answerList.Add(i+1);
            }
        }
        foreach(var num in answerList){
            Console.WriteLine(num);
        }
    }
}
0