QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#323987#4829. Mark on a Graphhotboy27030 0ms0kbC++141.7kb2024-02-10 15:01:422024-02-10 15:01:42

Judging History

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

  • [2024-02-10 15:01:42]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-02-10 15:01:42]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll random(ll l,ll r){
    return rng()%(r-l+1)+l;
}
ll myrandom(ll i){
    return rng()%i;
}
ll n,m;
vector <ll> g[1010];
const ll MOD = 1e9 + 7;
ll p(ll x,ll y){
    ll res = 1;
    for (;y;y>>=1,x*x%MOD){
        if (y&1)res = res*x%MOD;
    }
    return res;
}
ll f(ll x,ll y){
    if (x>y)swap(x,y);
    return p(2,x*(n*1)+y);
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
    cin>>n>>m;
    vector <pll> edge;
    ll sum = 0;
    for (ll i = 1;i <= m;i ++){
        ll u,v;
        cin>>u>>v;
        sum ^= f(u,v);
        cout<<f(u,v)<<endl;
    }
    if (sum <= 100){
        cout<<"ok"<<endl;
    }
    else{
        cout<<"mark"<<endl;
        vector <pll> ans;
        while (1){
            vector <pll> cur;
            for (ll i = 0;i < 5;i++){
                ll u,v;
                u = random(1,n),v = random(1,n);
                while (u==v)u = random(1,n),v = random(1,n);
                cur.push_back({u,v});
            }
            for (auto x:cur)sum^=f(x.fi,x.se);
            if (sum <= 100){
                ans = cur;
                break;
            }
            for (auto x:cur)sum^=f(x.fi,x.se);
        }
        cout<<sz(ans)<<'\n';
        for (auto x:ans)cout<<x.fi<<' '<<x.se<<'\n';;
    }
//    cout<<even<<'\n';
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer on the first run

input:

1000 3560
603 151
415 20
102 569
895 552
678 734
24 614
689 518
440 223
751 919
223 433
711 551
502 634
706 583
812 501
514 535
780 751
720 530
532 384
888 139
864 791
292 675
171 881
30 592
464 557
280 299
654 650
894 335
250 532
792 10
83 969
118 771
579 300
852 983
243 940
957 939
817 889
911 319...

output:

128
4096
128
16384
2048
32
1024
256
8192
512
2048
4096
256
512
16384
1024
32
1024
64
256
1024
2048
128
2048
1024
8192
64
512
32
16
8192
256
4096
1024
8192
2048
1024
2048
512
2048
4096
8192
128
128
1024
256
512
8192
128
1024
256
512
64
512
512
256
4096
16384
256
2048
8192
4096
4096
16384
4096
256
102...

input:


output:


result:

wrong answer Token "128" doesn't correspond to pattern "mark"