結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
funakoshi
|
| 提出日時 | 2019-06-20 17:37:47 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,504 bytes |
| コンパイル時間 | 685 ms |
| コンパイル使用メモリ | 110,952 KB |
| 実行使用メモリ | 26,776 KB |
| 最終ジャッジ日時 | 2025-10-24 21:10:24 |
| 合計ジャッジ時間 | 2,007 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 13 |
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
namespace yukicoderTest
{
class Program
{
static void Main(string[] args)
{
string n = Console.ReadLine();
int[] itemcnt = new int[10];
int defeattime = int.Parse(n);
int pupcnt = 0;
for(int i=0;i<itemcnt.Length;i++)
{
itemcnt[i] = 0;
}
for(int i=0;i<defeattime;i++)
{
string item = Console.ReadLine();
string[] itemary = item.Split(' ');
int a = int.Parse(itemary[0]);
int b = int.Parse(itemary[1]);
int c = int.Parse(itemary[2]);
itemcnt[a - 1] = itemcnt[a - 1]+1;
itemcnt[b - 1] = itemcnt[b - 1]+1;
itemcnt[c - 1] = itemcnt[c - 1]+1;
}
int cnt = 0;
for (int i=0;i<itemcnt.Length;i++)
{
while (itemcnt[i] >= 2)
{
itemcnt[i] = itemcnt[i] - 2;
pupcnt++;
}
if (itemcnt[i] == 1)
{
itemcnt[i]--;
cnt++;
}
if (cnt == 4)
{
pupcnt++;
}
}
Console.WriteLine(pupcnt);
}
}
}
funakoshi