Submission #993419

# Submission time Handle Problem Language Result Execution time Memory
993419 2024-06-05T15:09:10 Z alexander707070 Magic Show (APIO24_show) C++17
0 / 100
1 ms 600 KB
#include <bits/stdc++.h>
#include "Alice.h"

#define MAXN 5007
using namespace std;

int perm[MAXN],to[MAXN],ot[MAXN];
vector< pair<int,int> > edges;

vector< pair<int,int> > Alice(){
    
    long long x = setN(5000);
    int n=5000;

    for(int i=1;i<=n;i++)perm[i]=i;
    for(int i=1;i<=n;i++){
        swap(perm[i],perm[(i*23+76)%n+1]);
    }

    for(int i=2;i<=n;i++){
        to[i]=(i*12+72)%n+1;

        if(to[i]>1)ot[i]=to[i]-1;
        else ot[i]=2;
    }

    for(long long i=60;i>=0;i--){
        if(((1LL<<i)&x)>0){
            for(int f=2;f<=n;f++){
                if(f%61==i)edges.push_back({perm[to[f]],perm[f]});
            }
        }else{
            for(int f=2;f<=n;f++){
                if(f%61==i)edges.push_back({perm[ot[f]],perm[f]});
            }
        }
    }

    return edges;
}
#include<bits/stdc++.h>
#include "Bob.h"

#define MAXN 5007
using namespace std;

int permm[MAXN],tot[MAXN];
int rev[MAXN];
long long ans;

long long Bob(vector< pair<int,int> > e){
	
    int n=5000;

    for(int i=1;i<=n;i++)permm[i]=i;
    for(int i=1;i<=n;i++){
        swap(permm[i],permm[(i*23+76)%n+1]);
    }

    for(int i=1;i<=n;i++)rev[permm[i]]=i;
    for(int i=2;i<=n;i++)tot[i]=(i*12+72)%n+1;

    for(int i=0;i<e.size();i++){
        e[i].first=rev[e[i].first];
        e[i].second=rev[e[i].second];

        if(e[i].first>e[i].second)swap(e[i].first,e[i].second);

        if(tot[e[i].second]==e[i].first){
            ans|=(1LL<<(e[i].second%61));
        }
    }
	
    return ans;
}

Compilation message

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:23:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |     for(int i=0;i<e.size();i++){
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -