結果
| 問題 | No.51 やる気の問題 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-07-15 12:04:52 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 5,000 ms | 
| コード長 | 242 bytes | 
| コンパイル時間 | 534 ms | 
| コンパイル使用メモリ | 67,204 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-08 02:14:29 | 
| 合計ジャッジ時間 | 1,336 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:14:13: warning: 'res' may be used uninitialized [-Wmaybe-uninitialized]
   14 |     cout << res  << endl;
      |             ^~~
main.cpp:8:9: note: 'res' was declared here
    8 |     int res;
      |         ^~~
            
            ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int W, D;
    cin >> W >> D;
    int res;
    for(int i=D; i>0; i--){
        res = (int)((double)W / pow(i, 2));
        W -= res;
    }
    cout << res  << endl;
}
            
            
            
        