結果

問題 No.51 やる気の問題
ユーザー Knots
提出日時 2020-11-06 15:29:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 5,000 ms
コード長 502 bytes
コンパイル時間 1,833 ms
コンパイル使用メモリ 191,920 KB
最終ジャッジ日時 2025-01-15 20:03:28
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:28: warning: ‘saygo’ may be used uninitialized [-Wmaybe-uninitialized]
   12 | #define COUT(x) cout<<(x)<<"\n"
      |                            ^~~~
main.cpp:23:5: note: in expansion of macro ‘COUT’
   23 |     COUT(saygo);
      |     ^~~~
main.cpp:18:9: note: ‘saygo’ was declared here
   18 |     int saygo;
      |         ^~~~~

ソースコード

diff #

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using pii = pair<int,int>;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"
#define COUT15(x) cout << fixed << setprecision(15) << (x) << "\n";  

int main(){
    ll w,d;
    cin >> w >> d;
    int saygo;
    for(ll i=d;i>0;i--){
        saygo = w/(i*i);
        w -= saygo;
    }
    COUT(saygo);
}
0