提出 #18377237


ソースコード 拡げる

#include<bits/stdc++.h>
#define   endl    '\n'
#define ll long long
#define se second
#define fi first
#define fast_io ios_base::sync_with_stdio (false) ; cin.tie(0) ; cout.tie(0) ;

using namespace std;


////****************************************************************************************************************************************************************************************************************////


 int main(){
    
     fast_io
      int r1,c1,r2,c2;
      cin>>r1>>c1>>r2>>c2;
      if(c1>c2){
        swap(r1,r2);
        swap(c1,c2);
      }
      int d1= r1-c1;
      int d2=r2-c2;
      int a1=r1+c1;
      int a2=r2+c2;
      if(r1 == r2 and c1==c2 ){cout<<0<<endl;}
      else if(d1==d2 or a1==a2 or abs(r2-r1)+abs(c2-c1)<=3){cout<<1<<endl;}
      else{
        bool flag=false;
         int R= r1;
         int C= c2-c1;
         if(r1>r2)R-=C;
         else R+=C;

         if(R%2 == r2%2)flag=true;
         else if(abs(R-r2)<=3)flag=true;
        //  if(abs(r2-r1)+abs(c2-c1)<=6)flag=true;
         
         if(flag)cout<<2<<endl;
         else cout<<3<<endl;
      }
      }

提出情報

提出日時
問題 C - Super Ryuma
ユーザ pro_30
言語 C++ (GCC 9.2.1)
得点 300
コード長 1157 Byte
結果 WA
実行時間 8 ms
メモリ 3660 KiB

ジャッジ結果

セット名 Sample All after_contest
得点 / 配点 0 / 0 300 / 300 0 / 0
結果
AC × 4
AC × 30
WA × 1
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, hand_01.txt, hand_02.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
after_contest after_contest_01.txt
ケース名 結果 実行時間 メモリ
after_contest_01.txt WA 8 ms 3568 KiB
hand_01.txt AC 2 ms 3660 KiB
hand_02.txt AC 2 ms 3504 KiB
random_01.txt AC 3 ms 3576 KiB
random_02.txt AC 4 ms 3548 KiB
random_03.txt AC 5 ms 3620 KiB
random_04.txt AC 5 ms 3544 KiB
random_05.txt AC 2 ms 3496 KiB
random_06.txt AC 3 ms 3492 KiB
random_07.txt AC 2 ms 3620 KiB
random_08.txt AC 2 ms 3552 KiB
random_09.txt AC 2 ms 3576 KiB
random_10.txt AC 2 ms 3472 KiB
random_11.txt AC 2 ms 3500 KiB
random_12.txt AC 2 ms 3496 KiB
random_13.txt AC 2 ms 3628 KiB
random_14.txt AC 2 ms 3624 KiB
random_15.txt AC 2 ms 3528 KiB
random_16.txt AC 3 ms 3552 KiB
random_17.txt AC 2 ms 3564 KiB
random_18.txt AC 2 ms 3624 KiB
random_19.txt AC 4 ms 3552 KiB
random_20.txt AC 4 ms 3564 KiB
random_21.txt AC 4 ms 3564 KiB
random_22.txt AC 2 ms 3548 KiB
random_23.txt AC 2 ms 3564 KiB
random_24.txt AC 4 ms 3564 KiB
sample_01.txt AC 2 ms 3548 KiB
sample_02.txt AC 2 ms 3476 KiB
sample_03.txt AC 3 ms 3436 KiB
sample_04.txt AC 3 ms 3596 KiB