結果

問題 No.46 はじめのn歩
コンテスト
ユーザー Hiroki Ohta
提出日時 2016-12-12 22:33:32
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 268 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 576 ms
コンパイル使用メモリ 57,856 KB
最終ジャッジ日時 2026-05-23 11:45:04
合計ジャッジ時間 1,530 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:5:3: error: 'uint32_t' was not declared in this scope
    5 |   uint32_t a, b;
      |   ^~~~~~~~
main.cpp:2:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    1 | #include <iostream>
  +++ |+#include <cstdint>
    2 | 
main.cpp:6:15: error: 'a' was not declared in this scope
    6 |   std::cin >> a >> b;
      |               ^
main.cpp:6:20: error: 'b' was not declared in this scope
    6 |   std::cin >> a >> b;
      |                    ^
main.cpp:8:11: error: expected ';' before 'quotinent'
    8 |   uint32_t quotinent = b / a;
      |           ^~~~~~~~~~
      |           ;
main.cpp:9:11: error: expected ';' before 'remainder'
    9 |   uint32_t remainder = b % a;
      |           ^~~~~~~~~~
      |           ;
main.cpp:10:11: error: expected ';' before 'result'
   10 |   uint32_t result = remainder > 0 ? quotinent + 1
      |           ^~~~~~~
      |           ;
main.cpp:12:16: error: 'result' was not declared in this scope
   12 |   std::cout << result << std::endl;
      |                ^~~~~~

ソースコード

diff #
raw source code

#include <iostream>

int main() {

  uint32_t a, b;
  std::cin >> a >> b;

  uint32_t quotinent = b / a;
  uint32_t remainder = b % a;
  uint32_t result = remainder > 0 ? quotinent + 1
                    : quotinent;
  std::cout << result << std::endl;

  return 0;
}
0