結果

問題 No.51 やる気の問題
ユーザー たつお
提出日時 2023-09-29 14:47:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 218 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 62,848 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-22 08:58:22
合計ジャッジ時間 2,294 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 RE * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:14:17: warning: 'rate' may be used uninitialized [-Wmaybe-uninitialized]
   14 |         cout << rate;
      |                 ^~~~
main.cpp:8:13: note: 'rate' was declared here
    8 |         int rate;
      |             ^~~~

ソースコード

diff #

#include <iostream>
using namespace std;

int main(void){
//input
	int work,day; cin >> work >> day;
//calc
	int rate;
	for(int i=day;i>0;i--){
		rate = work / (int)(i * i);
		work -= rate;
	}
//output
	cout << rate;
}
0