結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
kmtrc130
|
| 提出日時 | 2019-03-18 15:15:49 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 5,000 ms |
| コード長 | 1,150 bytes |
| コンパイル時間 | 647 ms |
| コンパイル使用メモリ | 109,588 KB |
| 実行使用メモリ | 26,012 KB |
| 最終ジャッジ日時 | 2024-07-18 09:49:19 |
| 合計ジャッジ時間 | 1,176 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
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 void Solve()
{
int N = int.Parse(Console.ReadLine());
int possible = 0;
int success = 0;
int successCnt = 0;
int missCnt = 0;
string[] TS;
for (int i = 0; i < N; i++)
{
TS = Console.ReadLine().Split(' ');
possible = 12 * int.Parse(TS[0]) / 1000;
if (TS[1].Length < possible)
{
successCnt += TS[1].Length;
}
else
{
if (possible == TS[1].Length)
{
successCnt += possible;
continue;
}
if (possible < TS[1].Length) { success = possible; }
else { success = (possible - TS[1].Length < 0 ? 0 : possible - TS[1].Length); }
missCnt += TS[1].Length - possible;
successCnt += success;
}
}
Console.WriteLine("{0} {1}", successCnt, missCnt);
}
static void Main()
{
var solver = new Program();
solver.Solve();
}
}
kmtrc130