結果

問題 No.745 letinopia raoha
コンテスト
ユーザー toshiro_yanagi
提出日時 2018-11-26 21:02:11
言語 Nim
(2.2.6)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 824 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,320 ms
コンパイル使用メモリ 68,356 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-21 23:35:59
合計ジャッジ時間 3,008 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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 "Possible"
   echo score


when isMainModule:
   main()
0