結果

問題 No.188 HAPPY DAY
ユーザー sironekotorosironekotoro
提出日時 2018-11-15 17:14:41
言語 Perl
(5.38.0)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,676 KB
実行使用メモリ 6,744 KB
最終ジャッジ日時 2023-08-26 01:19:10
合計ジャッジ時間 515 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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