結果

問題 No.1034 テスターのふっぴーさん
ユーザー first_vilfirst_vil
提出日時 2020-04-24 21:42:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 54,152 KB
最終ジャッジ日時 2024-04-23 03:06:08
合計ジャッジ時間 2,231 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,188 KB
testcase_01 AC 40 ms
53,780 KB
testcase_02 AC 40 ms
52,756 KB
testcase_03 AC 37 ms
52,128 KB
testcase_04 AC 38 ms
52,940 KB
testcase_05 AC 38 ms
52,088 KB
testcase_06 AC 39 ms
52,348 KB
testcase_07 AC 39 ms
52,336 KB
testcase_08 AC 38 ms
52,952 KB
testcase_09 AC 37 ms
52,620 KB
testcase_10 AC 37 ms
52,736 KB
testcase_11 AC 38 ms
52,832 KB
testcase_12 AC 38 ms
52,952 KB
testcase_13 AC 38 ms
53,292 KB
testcase_14 AC 38 ms
52,488 KB
testcase_15 AC 40 ms
53,124 KB
testcase_16 AC 38 ms
52,772 KB
testcase_17 AC 38 ms
53,900 KB
testcase_18 AC 39 ms
52,420 KB
testcase_19 AC 38 ms
52,200 KB
testcase_20 AC 40 ms
53,764 KB
testcase_21 AC 40 ms
54,032 KB
testcase_22 AC 41 ms
52,856 KB
testcase_23 AC 39 ms
53,480 KB
testcase_24 AC 40 ms
54,036 KB
testcase_25 AC 40 ms
53,256 KB
testcase_26 AC 39 ms
52,756 KB
testcase_27 AC 41 ms
52,820 KB
testcase_28 AC 40 ms
54,152 KB
testcase_29 AC 39 ms
53,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  n,y,x=map(int,input().split())
  m=min(y,x,n-y-1,n-x-1)
  lv=n-m*2
  ans=n*n-lv*lv
  y-=m;x-=m
  if y==0:print(ans+x)
  elif x==lv-1:print(ans+lv-1+y)
  elif y==lv-1:print(ans+lv-1+lv-1+lv-x-1)
  else:print(ans+lv-1+lv-1+lv-1+lv-y-1)
0