結果

問題 No.188 HAPPY DAY
ユーザー nanophoto12nanophoto12
提出日時 2015-12-13 22:02:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 857 bytes
コンパイル時間 3,654 ms
コンパイル使用メモリ 102,352 KB
実行使用メモリ 20,464 KB
最終ジャッジ日時 2023-08-29 03:34:18
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,464 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace No188
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			var pairs = new[]{
				new Tuple<int,int>(1,31),
				new Tuple<int,int>(2,28),
				new Tuple<int,int>(3,31),
				new Tuple<int,int>(4,30),
				new Tuple<int,int>(5,31),
				new Tuple<int,int>(6,30),
				new Tuple<int,int>(7,31),
				new Tuple<int,int>(8,31),
				new Tuple<int,int>(9,30),
				new Tuple<int,int>(10,31),
				new Tuple<int,int>(11,30),
				new Tuple<int,int>(12,31)
			};

			int total = 0;
			foreach (var keyValue in pairs) {
				var month = keyValue.Item1;
				for (int day = 1; day <= keyValue.Item2; day++) {
					int t = day % 10;
					int d = day / 10;
					int s = t + d;
					if (month == s) {
						total++;
					}
				}
			}
			Console.WriteLine (total.ToString ());
		}
	}
}
0