結果
問題 |
No.1034 テスターのふっぴーさん
|
ユーザー |
|
提出日時 | 2020-04-24 21:50:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 1,545 ms |
コンパイル使用メモリ | 167,036 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-15 02:42:57 |
合計ジャッジ時間 | 2,500 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; using ll = long long ; using P = pair<int,int> ; const int INF = 1e9; const int MOD = 1000000007; void solve(){ ll N,I,J; cin >> N >> I >> J; ll k = min({I,J,N-1-J,N-1-I}); ll ans = 2*k*(2*N-k-1); if(k==I){ ans += J-k+1; }else if(k==N-1-J){ ans += N-2*k-1; ans += I-k+1; }else if(k==N-1-I){ ans += 2*(N-2*k-1); ans += N-k-J; } else if(k==J){ ans += 3*N-6*k-3; ans += N-k-I; } cout << ans-1 << endl; return; } int main(){ int q; cin >> q; rep(i,q) solve(); return 0; }