結果

問題 No.966 引き算をして門松列(その1)
ユーザー ate
提出日時 2020-07-08 22:38:15
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 70,452 KB
最終ジャッジ日時 2025-01-11 17:04:51
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 1 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
void solve();
signed main(){
    int t;
    std::cin>>t;
    while(t--)solve();
}
void solve(){
    int64_t a,b,c;
    std::cin>>a>>b>>c;
    if(std::max({a,b,c})==b||std::min({a,b,c})==b)std::cout<< 0 <<std::endl;
    else std::cout<< std::min(std::max(a,c)+1-b,b-std::min(a,c)+1) <<std::endl;
}
0