結果
| 問題 |
No.647 明太子
|
| コンテスト | |
| ユーザー |
mencotton
|
| 提出日時 | 2018-02-09 23:30:13 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 4,500 ms |
| コード長 | 1,304 bytes |
| コンパイル時間 | 1,356 ms |
| コンパイル使用メモリ | 106,112 KB |
| 実行使用メモリ | 23,032 KB |
| 最終ジャッジ日時 | 2024-06-27 02:35:55 |
| 合計ジャッジ時間 | 2,838 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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]);
}
}
}
}
}
mencotton