結果

問題 No.1508 Avoid being hit
ユーザー chocoruskchocorusk
提出日時 2021-05-14 23:58:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,615 bytes
コンパイル時間 3,501 ms
コンパイル使用メモリ 192,388 KB
実行使用メモリ 8,356 KB
最終ジャッジ日時 2023-07-25 12:16:59
合計ジャッジ時間 10,577 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 5 ms
8,064 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 4 ms
8,224 KB
testcase_06 AC 4 ms
8,012 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 5 ms
8,220 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 5 ms
8,036 KB
testcase_16 AC 4 ms
8,212 KB
testcase_17 AC 4 ms
8,060 KB
testcase_18 AC 5 ms
8,092 KB
testcase_19 AC 4 ms
8,184 KB
testcase_20 AC 5 ms
8,036 KB
testcase_21 AC 5 ms
8,268 KB
testcase_22 AC 5 ms
8,212 KB
testcase_23 AC 5 ms
8,088 KB
testcase_24 WA -
testcase_25 WA -
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 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 AC 5 ms
8,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
map<int, int> pr[100010];
int main()
{
    cout<<"NO"<<endl;
    return 0;
    int n, q; cin>>n>>q;
	int a[100010], b[100010];
	for(int i=0; i<q; i++){
		cin>>a[i]; a[i]--;
	}
	for(int i=0; i<q; i++){
		cin>>b[i]; b[i]--;
	}
    for(int i=-5; i<=5; i++){
        int x=a[0]+i;
        if(x>=0 && x<n) pr[0][x]=0;
    }
    for(int i=0; i<q; i++){
        for(auto p:pr[i]){
            int x=p.first;
            for(int k=-1; k<=1; k++){
                int y=x+k;
                if(y<0 || y>=n) continue;
                int d1=abs(y-a[i]), d2=abs(y-b[i]);
                if(d1>0 && d2>0 && (d1<=5 || d2<=5)){
                    pr[i+1][y]=x;
                }
            }
        }
    }
    if(pr[q].empty()){
        cout<<"NO"<<endl;
        return 0;
    }
    cout<<"YES"<<endl;
    int x=pr[q].begin()->first;
    vector<int> ans;
    for(int i=q; i>=0; i--){
        ans.push_back(x);
        x=pr[i][x];
    }
    reverse(ans.begin(), ans.end());
    for(auto y:ans) cout<<y+1<<endl;
    return 0;
}
0