結果
問題 | No.1034 テスターのふっぴーさん |
ユーザー |
|
提出日時 | 2020-04-26 19:22:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,028 bytes |
コンパイル時間 | 946 ms |
コンパイル使用メモリ | 78,964 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 19:01:26 |
合計ジャッジ時間 | 1,501 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include<iostream>#include<string>#include<iomanip>#include<cmath>#include<vector>#include<algorithm>#include<utility>using namespace std;#define int long long#define endl "\n"constexpr long long INF = (long long)1e18;constexpr long long MOD = 1'000'000'007;struct fast_io {fast_io(){std::cin.tie(nullptr);std::ios::sync_with_stdio(false);};} fio;signed main(){cout<<fixed<<setprecision(10);int Q;cin>>Q;for(int _ = 0; _ < Q; _++){int N, I, J;int a, b, c, d, e;int ans = 0;cin>>N>>I>>J;a = I;b = N - 1 - J;c = N - 1 - I;d = J;e = min(min(a, b), min(c, d));ans = 4 * (N - e) * e;//cout<<e<<" "<<ans<<endl;if(a == e) {ans += (N - e - 1) * 0;ans += J - e;} else if(b == e) {ans += (N - e - 1) * 1;ans += I - e;} else if(c == e) {// cout<<"<>"<<endl;ans += (N - e - 1) * 2;ans += N - 1 - J - e;} else {ans += (N - e - 1) * 3;ans += N - 1 - I - e;}cout<<ans<<endl;}return 0;}