結果

問題 No.188 HAPPY DAY
ユーザー jntkymjntkym
提出日時 2019-05-10 12:44:44
言語 Nim
(2.0.2)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 430 bytes
コンパイル時間 2,645 ms
コンパイル使用メモリ 66,920 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-14 17:53:36
合計ジャッジ時間 3,118 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'strutils' [UnusedImport]

ソースコード

diff #

import strutils

let monthes: seq[int] = @[1,2,3,4,5,6,7,8,9,10,11,12]
let days: seq[int] = @[0,31,28,31,30,31,30,31,31,30,31,30,31]
var count: int = 0

proc suujiwa(day: int):int =
  if 1 <= day and day <= 9:
    result = day
  else:
    var ten: int = (day/10).int
    var one: int = day mod 10
    result = ten + one

for month in monthes:
  for day in 1..days[month]:
    if suujiwa(day) == month:
      count += 1

echo count
0