結果
| 問題 |
No.91 赤、緑、青の石
|
| コンテスト | |
| ユーザー |
しらゆき
|
| 提出日時 | 2015-11-23 15:32:36 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 949 ms / 5,000 ms |
| コード長 | 938 bytes |
| コンパイル時間 | 2,359 ms |
| コンパイル使用メモリ | 109,632 KB |
| 実行使用メモリ | 33,192 KB |
| 最終ジャッジ日時 | 2024-06-24 06:52:57 |
| 合計ジャッジ時間 | 11,948 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 28 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class Program
{
public static void Main()
{
var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
int ans = 0;
while (true)
{
Array.Sort(a);
if (a[0] >= 1)
{
a[0]--; a[1]--; a[2]--;
ans++;
}
else
{
if (a[1] >= 1)
{
if (a[2] >= 3)
{
a[1]--; a[2] -= 3;
ans++;
}
else break;
}
else
{
if (a[2] >= 5)
{
a[2] -= 5;
ans++;
}
else break;
}
}
}
Console.WriteLine(ans);
}
}
しらゆき