結果

問題 No.2375 watasou and hibit's baseball
ユーザー warabi0906warabi0906
提出日時 2023-06-22 17:52:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 832 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 169,472 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 17:28:12
合計ジャッジ時間 3,094 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,376 KB
testcase_01 AC 5 ms
4,376 KB
testcase_02 AC 5 ms
4,376 KB
testcase_03 WA -
testcase_04 AC 5 ms
4,380 KB
testcase_05 AC 5 ms
4,376 KB
testcase_06 AC 5 ms
4,376 KB
testcase_07 AC 6 ms
4,376 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 5 ms
4,376 KB
testcase_10 AC 5 ms
4,376 KB
testcase_11 AC 5 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 6 ms
4,380 KB
testcase_15 AC 6 ms
4,380 KB
testcase_16 AC 6 ms
4,376 KB
testcase_17 WA -
testcase_18 AC 6 ms
4,376 KB
testcase_19 AC 5 ms
4,376 KB
testcase_20 AC 5 ms
4,380 KB
testcase_21 WA -
testcase_22 AC 5 ms
4,376 KB
testcase_23 AC 6 ms
4,380 KB
testcase_24 AC 5 ms
4,376 KB
testcase_25 AC 5 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 5 ms
4,376 KB
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int N,A,B,X[15],Y[15],K[15];
int main(){
    int beg=clock();
    srand(time(NULL));
    scanf("%d%d%d",&N,&A,&B);
    for(int i=0;i<N;i++)scanf("%d%d%d",&X[i],&Y[i],&K[i]);
    auto d=[&](int a,int b){
        return abs(X[a]-X[b])+abs(Y[a]-Y[b]);
    };
    int ans=1;
    do{
        vector<int> P(N);iota(P.begin(),P.end(),0);
        random_device dev;
        mt19937 mt(dev());
        shuffle(P.begin(),P.end(),mt);
        int cnt=1;
        for(int i=1;i<N;i++){
            int m=0;
            m+=d(P[i-1],P[i]);
            if(1<i)m+=d(P[i-2],P[i]);
            if(m<A and abs(K[P[i]]-K[P[i-1]])<B)break;
            ++cnt;
        }
        ans=max(ans,cnt);
        if(3950<clock()-beg){
            printf("%d\n",ans);
            return 0;
        }
    }while(true);
}
0