結果

問題 No.745 letinopia raoha
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-11-26 20:57:46
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 805 bytes
コンパイル時間 2,717 ms
コンパイル使用メモリ 67,824 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-13 20:46:59
合計ジャッジ時間 3,310 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils


proc nextString: string =
   result = ""
   while not endOfFile stdin:
      let nextChar = readChar stdin
      case nextChar
      of '\r':
         discard
      of "\n"[0], ' ':
         break
      else:
         add result, nextChar


proc nextInt: int =
   return parseInt nextString()


proc main: void =
   var score = 0
   var bonus = 1

   var pf = nextInt()
   var gt = nextInt()
   let gd = nextInt()
   let ms = nextInt()

   if ms >= 10:
      echo("Impossible")
      return

   for i in 1..int.high:
      if gt == 0 and pf == 0:
         break
      elif gt != 0:
         score += 50 * bonus
         gt -= 1
      elif pf != 0:
         score += 100 * bonus
         pf -= 1

      if i mod 100 == 0:
         bonus *= 2

   echo score


when isMainModule:
   main()
0