QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#648067#8934. Challenge NPCargtarg#Compile Error//C++201.1kb2024-10-17 16:52:332024-10-17 16:52:34

Judging History

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

  • [2024-10-17 16:52:34]
  • 评测
  • [2024-10-17 16:52:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define pii pair<int, int>
void solve();

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
//    cin >> T;
    while (T--)solve();
    return 0;
}
void solve(){
    int _;
    cin>>_;
    const int n=1021;
    vector<int>a,b,c;
    int cnt=0;
    vector<int>ans(n+10);
    a.push_back(1);
    b.push_back(2);
    c.push_back(3);
    vector<pii>m;
    auto pb=[&](int x,int y)->void{
        m.push_back({x,y});
    };
    pb(1,2);
    ans[1]=1,ans[2]=2,ans[3]=3;
    cnt=3;
    while(cnt<n){
        cnt++;
        ans[cnt]=3;
        for(int it:a){
            pb(it,cnt);
        }
        pb(2,cnt);
        cnt++;
        ans[cnt]=1;
        for(int it:c){
            pb(it,cnt);
        }
        pb(2,cnt);
        c.push_back(cnt-1);
        a.push_back(cnt);
    }
    cout<<n<<" "<<m.size()<<' '<<3<<endl;
    for(int i=1;i<=n;i++)cout<<ans[i]<<' ';
    cout<<endl;
    for(auto [i,j]:m){
        cout<<i<<' '<<j<<endl;a
    }
}

Details

answer.code: In function ‘void solve()’:
answer.code:55:32: error: expected ‘;’ before ‘}’ token
   55 |         cout<<i<<' '<<j<<endl;a
      |                                ^
      |                                ;
   56 |     }
      |     ~