結果
問題 | No.1057 素敵な日 |
ユーザー |
![]() |
提出日時 | 2020-05-22 21:22:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 609 bytes |
コンパイル時間 | 2,959 ms |
コンパイル使用メモリ | 191,460 KB |
最終ジャッジ日時 | 2025-01-10 14:02:31 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 7 |
コンパイルメッセージ
In file included from /usr/include/c++/13/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51, 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: /usr/include/c++/13/bits/stl_algobase.h:238:7: warning: ‘b’ is used uninitialized [-Wuninitialized] 238 | 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; }