結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2015-12-13 22:02:33 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 1,000 ms |
コード長 | 857 bytes |
コンパイル時間 | 1,145 ms |
コンパイル使用メモリ | 103,680 KB |
実行使用メモリ | 17,408 KB |
最終ジャッジ日時 | 2024-12-30 20:50:02 |
合計ジャッジ時間 | 1,724 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
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;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 ());}}}