結果
問題 | No.1034 テスターのふっぴーさん |
ユーザー |
|
提出日時 | 2020-04-28 22:59:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 383 bytes |
コンパイル時間 | 2,081 ms |
コンパイル使用メモリ | 191,308 KB |
最終ジャッジ日時 | 2025-01-10 03:06:12 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>int main(){int q;std::cin >> q;for(int i = 0; i < q; ++i){long long N, I, J;std::cin >> N >> I >> J;long long x = std::min({I, J, N-1-I, N-1-J});long long ans = 2*(N-1-x)-(I+J);if(I <= J) ans *= -1LL;ans += 4*x*(N-x) + 2*(N-1-2*x);std::cout << ans << '\n';}return 0;}