結果

問題 No.51 やる気の問題
ユーザー masa
提出日時 2015-02-07 17:09:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 255 bytes
コンパイル時間 485 ms
コンパイル使用メモリ 59,280 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 10:41:41
合計ジャッジ時間 1,361 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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