結果
問題 | No.966 引き算をして門松列(その1) |
ユーザー | ate |
提出日時 | 2020-07-08 22:38:15 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 858 ms |
コンパイル使用メモリ | 73,632 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-04-15 07:47:32 |
合計ジャッジ時間 | 1,073 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 29 ms
6,944 KB |
ソースコード
#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; }