結果

問題 No.188 HAPPY DAY
ユーザー sironekotorosironekotoro
提出日時 2018-11-15 17:16:07
言語 Perl
(5.38.2)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 572 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 6,928 KB
実行使用メモリ 6,768 KB
最終ジャッジ日時 2023-08-26 01:19:11
合計ジャッジ時間 589 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
6,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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);
    my $date_ten = substr($date,2,1);
    my $date_one = substr($date,3,1);

    if ($month == ($date_ten + $date_one) ){
        # print $date , "\n";
        $count++;
    }
}

print $count , "\n"
0