結果
| 問題 |
No.1034 テスターのふっぴーさん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-20 18:19:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 624 bytes |
| コンパイル時間 | 1,671 ms |
| コンパイル使用メモリ | 165,912 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-22 22:33:39 |
| 合計ジャッジ時間 | 2,215 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}