結果

問題 No.1034 テスターのふっぴーさん
ユーザー kilalakilala
提出日時 2020-04-24 23:19:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 521 ms
コンパイル使用メモリ 66,176 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-10-15 03:49:24
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 20 TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
 
int main()
{
    int q, n, i, j;
    cin >> q;
    while (q--) {
        long long ans = 0;
        cin >> n >> i >> j;
        int dep = min(i - 0, min(j - 0, min(n-1-i, n-1-j))) + 1;
        int q = (n-1)* 4;
        for (int i = 1; i < dep; ++i) ans += q, q -= 2; 
        if (i == dep - 1) ans += j - dep + 2;
    cout << ans << endl;
    }

    return 0;
}
0