結果
| 問題 | No.1057 素敵な日 |
| コンテスト | |
| ユーザー |
define
|
| 提出日時 | 2020-05-22 21:22:38 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 609 bytes |
| 記録 | |
| コンパイル時間 | 1,219 ms |
| コンパイル使用メモリ | 209,148 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-10 05:49:14 |
| 合計ジャッジ時間 | 2,047 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 7 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/algorithm:62,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:53,
from main.cpp:1:
In function 'constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = long long int]',
inlined from 'int main()' at main.cpp:25:22:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:239:7: warning: 'b' is used uninitialized [-Wuninitialized]
239 | if (__b < __a)
| ^~
main.cpp: In function 'int main()':
main.cpp:25:24: note: 'b' was declared here
25 | int a=max(A,B),b=min(a,b);
| ^
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define len(s) (int)s.size()
#define pb push_back
template<class T> inline bool chmin(T &a, T b){
if(a>b){a=b;return true;}
return false;
}
template<class T> inline bool chmax(T &a, T b){
if(a<b){a=b;return true;}
return false;
}
constexpr int mod = 1e9+7;
constexpr int inf = 3e18;
signed main(){
int A,B;
cin>>A>>B;
int a=max(A,B),b=min(a,b);
if(a-b<=1)cout<<a+b-1<<endl;
else cout<<b*2<<endl;
}
define