結果
| 問題 | No.188 HAPPY DAY | 
| コンテスト | |
| ユーザー |  sironekotoro | 
| 提出日時 | 2018-11-15 17:17:02 | 
| 言語 | Perl (5.40.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 28 ms / 1,000 ms | 
| コード長 | 667 bytes | 
| コンパイル時間 | 309 ms | 
| コンパイル使用メモリ | 7,936 KB | 
| 実行使用メモリ | 7,808 KB | 
| 最終ジャッジ日時 | 2024-12-24 13:58:52 | 
| 合計ジャッジ時間 | 844 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 1 | 
コンパイルメッセージ
Main.pl syntax OK
ソースコード
use strict;
use warnings;
use Time::Piece;
use Time::Seconds;
my $t = Time::Piece->strptime( '2015-01-01', '%Y-%m-%d' );
my @calendar = ();
my $count = 0;
# 2015年のカレンダー作成
while (1) {
    push @calendar, $t->strftime('%m%d');
    last if ( $t->ymd eq '2015-12-31' );
    $t = $t + ONE_DAY;
}
# カレンダーの月と日付を比較する
for my $date (@calendar){
    my $month = substr($date,0,2);
    # 日付の10の位
    my $date_ten = substr($date,2,1);
    # 日付の1の位
    my $date_one = substr($date,3,1);
    if ($month == ($date_ten + $date_one) ){
        # print $date , "\n";
        $count++;
    }
}
print $count , "\n"
            
            
            
        