結果

問題 No.858 わり算
コンテスト
ユーザー MarcusAureliusAntoninus
提出日時 2019-08-09 21:35:59
言語 C++17(gcc12)
(gcc 12.4.0 + boost 1.89.0)
コンパイル:
g++-12 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 216 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,710 ms
コンパイル使用メモリ 199,228 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-07 19:18:28
合計ジャッジ時間 2,037 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:19: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘int64_t*’ {aka ‘long int*’} [-Wformat=]
    6 |         scanf("%lld%lld", &A, &B);
      |                ~~~^       ~~
      |                   |       |
      |                   |       int64_t* {aka long int*}
      |                   long long int*
      |                %ld
main.cpp:6:23: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 3 has type ‘int64_t*’ {aka ‘long int*’} [-Wformat=]
    6 |         scanf("%lld%lld", &A, &B);
      |                    ~~~^       ~~
      |                       |       |
      |                       |       int64_t* {aka long int*}
      |                       long long int*
      |                    %ld
main.cpp:7:20: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ {aka ‘long int’} [-Wformat=]
    7 |         printf("%lld.", A / B);
      |                 ~~~^    ~~~~~
      |                    |      |
      |                    |      int64_t {aka long int}
      |                    long long int
      |                 %ld
main.cpp:12:28: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ {aka ‘long int’} [-Wformat=]
   12 |                 printf("%lld", A / B);
      |                         ~~~^   ~~~~~
      |                            |     |
      |                            |     int64_t {aka long int}
      |                            long long int
      |                         %ld
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%lld%lld", &A, &B);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <bits/stdc++.h>

int main()
{
	int64_t A, B;
	scanf("%lld%lld", &A, &B);
	printf("%lld.", A / B);
	for (int i{}; i < 50; i++)
	{
		A %= B;
		A *= 10;
		printf("%lld", A / B);
	}
	putchar('\n');

	return 0;
}
0