結果
| 問題 | No.804 野菜が苦手 |
| コンテスト | |
| ユーザー |
hakuchanizkm
|
| 提出日時 | 2019-04-21 13:54:27 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 595 bytes |
| 記録 | |
| コンパイル時間 | 728 ms |
| コンパイル使用メモリ | 118,880 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-21 01:32:14 |
| 合計ジャッジ時間 | 2,435 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 9 WA * 10 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/string:53,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/locale_classes.h:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ios_base.h:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ios:46,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
from main.cpp:1:
In function 'constexpr const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]',
inlined from 'int main()' at main.cpp:31:19:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:263:7: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
263 | if (__a < __b)
| ^~
main.cpp: In function 'int main()':
main.cpp:28:9: note: 'ans' was declared here
28 | int ans;
| ^~~
ソースコード
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i, n) for(int i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
int main() {
int a,b,c,d;
cin>>a>>b>>c>>d;
int ans;
for(int i=0;i<a;i++){
if(i*c<=b&&i+i*c<=d){
ans=max(i,ans);
}
}
cout<<ans<<endl;
return 0;
}
hakuchanizkm