結果
問題 | No.1034 テスターのふっぴーさん |
ユーザー |
|
提出日時 | 2020-05-09 06:13:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 583 bytes |
コンパイル時間 | 623 ms |
コンパイル使用メモリ | 66,688 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 20:39:23 |
合計ジャッジ時間 | 1,504 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 WA * 29 |
ソースコード
#include <iostream>#include <vector>using namespace std;int main(){int Q;cin >> Q;for(int i = 0; i < Q; i++){long long N, I, J;cin >> N >> I >> J;long long sou = min(I, min(J, min(N - 1 - I, N - 1 - J)));long long t = (N - 1)*4, s = t - 8 * sou;long long tim = (t + s + 8)*sou/2;tim = tim + 2*(s/4);long long x = N - 1 - sou, y = N - 1 - sou;if(J == y || I == x - s) cout << tim + (I + J - x - y) << endl;else if(I == x || J == y - s/ 4) cout << tim - (I + J - x - y) << endl;}}