結果

問題 No.51 やる気の問題
ユーザー たつお
提出日時 2023-09-29 14:35:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 213 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 63,852 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-22 08:47:09
合計ジャッジ時間 1,989 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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 / (i * i);
		work -= rate;
	}
//output
	cout << rate;
}
0