結果
| 問題 | No.51 やる気の問題 |
| コンテスト | |
| ユーザー |
ant2357
|
| 提出日時 | 2016-06-12 22:54:24 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 5,000 ms |
| コード長 | 884 bytes |
| 記録 | |
| コンパイル時間 | 977 ms |
| コンパイル使用メモリ | 93,504 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 05:14:57 |
| 合計ジャッジ時間 | 1,606 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
from main.cpp:1:
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'int main()' at main.cpp:44:10:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:221:25: warning: 'yaruki' may be used uninitialized [-Wmaybe-uninitialized]
221 | { return _M_insert(__f); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:35:22: note: 'yaruki' was declared here
35 | double W, D, yaruki;
| ^~~~~~
ソースコード
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>
#include <numeric>
#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)
#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())
#define LL long long int
#define LD long double
#define PI 3.14159265358979
using namespace std;
//================================================
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
double W, D, yaruki;
cin >> W >> D;
for (int i = D; i > 0; i--) {
yaruki = floor(W / (D * D));
W -= yaruki;
D--;
}
cout << yaruki << "\n";
return 0;
}
ant2357