結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
sironekotoro
|
| 提出日時 | 2018-11-15 17:16:07 |
| 言語 | Perl (5.40.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 1,000 ms |
| コード長 | 572 bytes |
| コンパイル時間 | 61 ms |
| コンパイル使用メモリ | 7,936 KB |
| 実行使用メモリ | 7,936 KB |
| 最終ジャッジ日時 | 2024-12-24 13:58:37 |
| 合計ジャッジ時間 | 482 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
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"
sironekotoro