結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
SagToki
|
| 提出日時 | 2018-06-08 13:46:54 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 5,000 ms |
| コード長 | 1,341 bytes |
| 記録 | |
| コンパイル時間 | 874 ms |
| コンパイル使用メモリ | 113,888 KB |
| 実行使用メモリ | 26,852 KB |
| 最終ジャッジ日時 | 2025-10-24 21:06:40 |
| 合計ジャッジ時間 | 2,286 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
コンパイルメッセージ
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;
namespace Yukicorder_029 {
class Program{
static void Main(string[] args) {
int N = InputN(1, 100);
int Level = 0;
var list = new List<string>();
var Items = new List<string>();
for (int i = 0; i < N; i++) {
list.AddRange(Console.ReadLine().Split());
}
foreach (String Match in list) {
if(!Items.Contains(Match)) {
Items.Add(Match);
}else{
Items.Remove(Match);
Level++;
}
}
Level = Level + Items.Count / 4;
Console.WriteLine(Level);
}
static int InputN(int Min , int Max) {
int Number = int.Parse(Console.ReadLine());
try {
if(Number < Min || Number > Max) {
Console.WriteLine(Min + "以上" + Max + "以下で入力してください");
}
}catch(FormatException e) {
Console.WriteLine("数字を入力してください");
}catch(Exception E) {
Console.WriteLine("想定外のエラーです");
}
return Number;
}
}
}
SagToki