結果

問題 No.128 お年玉(1)
ユーザー 一ノ瀬卯月一ノ瀬卯月
提出日時 2019-02-11 14:19:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 236 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 55,068 KB
実行使用メモリ 9,748 KB
最終ジャッジ日時 2024-04-08 19:44:58
合計ジャッジ時間 11,721 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 72 ms
6,676 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 WA -
testcase_10 AC 342 ms
6,676 KB
testcase_11 AC 2,659 ms
6,676 KB
testcase_12 AC 339 ms
6,676 KB
testcase_13 AC 126 ms
6,676 KB
testcase_14 AC 351 ms
6,676 KB
testcase_15 AC 689 ms
6,676 KB
testcase_16 AC 72 ms
6,676 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:28: warning: ‘c’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |         for (long i = 0; i < c; i += 1000)
      |                          ~~^~~

ソースコード

diff #

#include <iostream>

using namespace std;
int main()
{
	long a, b, c, d = 0;
	cin >> a >> b;
	if ((a / b) % 1000 != 0)
	{
		c = a / b - (a / b) % 1000;
	}

	for (long i = 0; i < c; i += 1000)
	{
		d += 1000;
	}

	cout << d;
	return 0;
}
0