結果
問題 | No.1034 テスターのふっぴーさん |
ユーザー |
![]() |
提出日時 | 2020-04-25 00:27:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 846 bytes |
コンパイル時間 | 1,307 ms |
コンパイル使用メモリ | 123,420 KB |
最終ジャッジ日時 | 2025-01-10 00:45:30 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 30 |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> #include <fstream> #include <utility> #include <functional> #include <time.h> #include <stack> #include <array> #define popcount __builtin_popcount using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { int q; cin>>q; while(q--){ ll n, x, y; cin>>n>>x>>y; ll d=min({x, n-1-x, y, n-1-y}); x-=d, y-=d; ll ans=4*(n-1)*d-2*d*(d-1); if(x==0) ans+=y; else if(x==n-1-2*d) ans+=3*(n-1-2*d)-y; else if(y==0) ans+=4*(n-1-2*d)-x; else ans+=n-1-2*d+x; cout<<ans<<endl; } return 0; }