結果

問題 No.50 おもちゃ箱
ユーザー masa
提出日時 2015-02-07 17:09:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 502 ms
コンパイル使用メモリ 59,316 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-23 10:40:52
合計ジャッジ時間 1,844 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other AC * 7 WA * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:17: warning: ‘q’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   19 |         cout << q << endl;
      |                 ^

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

int main() {
	int w, d;

	cin >> w >> d;
	int q;
	while (d > 0) {
		q = w / d / d;
		w -= q;
		d--;
	}
	cout << q << endl;
	return 0;
}
0