結果
問題 |
No.1034 テスターのふっぴーさん
|
ユーザー |
|
提出日時 | 2021-06-20 18:20:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 640 bytes |
コンパイル時間 | 1,326 ms |
コンパイル使用メモリ | 166,288 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-22 22:33:43 |
合計ジャッジ時間 | 2,088 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define P pair<int, int> int main() { int q; cin >> q; rep(qi,q) { ll n, i, j; cin >> n >> i >> j; ll r = n; r = min(r, n-1-i); r = min(r, n-1-j); r = min(r, i); r = min(r, j); i -= r, j -= r; ll ans = n*n-(n-r*2)*(n-r*2); ll n2 = n-r*2; if (i == 0) { ans += j; } else if (j == n2-1) { ans += n2+i-1; } else if (i == n2-1) { ans += 3*n2-j-3; } else if (j == 0) { ans += 4*n2-i-5; } cout << ans << endl; } cout << endl; }