QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#754793#9521. Giving Directions in HarbinANIG#WA 0ms3712kbC++141.5kb2024-11-16 15:48:572024-11-16 15:48:57

Judging History

你现在查看的是最新测评结果

  • [2024-11-16 15:48:57]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3712kb
  • [2024-11-16 15:48:57]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

int L,R;

int k,idx;
vector<int> rec[1111];
vector<pair<int,int>> ver[1111];

void solve(int l,int r,int dep=0,int now=1){
    if(L<=l&&r<=R){
        rec[dep].emplace_back(now);
        return ;
    }
    int mid=(l+r)>>1;
    if(L<=mid){
        if(!l) solve(l,mid,dep+1,now);
        else{
            idx++;
            ver[now].emplace_back(idx,0);
            solve(l,mid,dep+1,idx);
        }
    }
    if(mid<R){
        idx++;
        ver[now].emplace_back(idx,1);
        solve(mid+1,r,dep+1,idx);
    }
}

int main(){

    cin>>L>>R;

    int mx=R;
    while((mx&-mx)!=mx) mx++;
    k=__lg(mx);
    cerr<<k<<endl;
    solve(0,mx-1);

    mx=-1;
    for(int i=0; i<1000; i++){
        if(rec[i].size()){
            mx=i;
            break;
        }
    }

    assert(mx!=-1);

    int Lim=k-mx;
    for(int i=idx+1; i<idx+Lim; i++){
        ver[i].emplace_back(i+1,0);
        ver[i].emplace_back(i+1,1);
    }

    for(int i=0; i<1000; i++){
        for(auto pt:rec[i]){
            ver[pt].emplace_back(k-i,0);
            ver[pt].emplace_back(k-i,1);
        }
    }

    int T=0;
    for(int i=1; i<1000; i++){
        if(ver[i].size()){
            T=i;
        }
    }

    for(int i=1; i<=T; i++){
        cout<<ver[i].size()<<' ';
        for(auto pt:ver[i]){
            cout<<pt.first<<' '<<pt.second<<' ';
        }
        cout<<'\n';
    }

    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3712kb

input:

1
2
S 2
E 1

output:

3 1 1 0 0 0 1 

result:

wrong answer Token parameter [name=f] equals to "1", doesn't correspond to pattern "[NSWE]" (test case 1)