結果
| 問題 |
No.51 やる気の問題
|
| コンテスト | |
| ユーザー |
mag
|
| 提出日時 | 2020-07-07 21:45:03 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 419 bytes |
| コンパイル時間 | 1,551 ms |
| コンパイル使用メモリ | 165,184 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-10-01 20:34:04 |
| 合計ジャッジ時間 | 3,024 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 RE * 6 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:16: warning: 'hoge' may be used uninitialized [-Wmaybe-uninitialized]
20 | cout<<(hoge>0?hoge:0)<<endl;
| ~~~~~~~^~~~~~~~
main.cpp:12:6: note: 'hoge' was declared here
12 | ll hoge;
| ^~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)
int main(){
cin.tie(nullptr);ios_base::sync_with_stdio(false);
int w,d;
cin>>w>>d;
ll hoge;
int shake=d;
rep(i,d){
hoge=w/(shake*shake);
//cout<<w<<" "<<w/(shake*shake)<<" "<<hoge<<endl;
w-=hoge;
shake--;
}
cout<<(hoge>0?hoge:0)<<endl;
}
mag