QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#668376#8726. Magic Show_Alexande_0 49ms1896kbC++142.6kb2024-10-23 14:03:542024-10-23 14:03:54

Judging History

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

  • [2024-10-23 14:03:54]
  • 评测
  • 测评结果:0
  • 用时:49ms
  • 内存:1896kb
  • [2024-10-23 14:03:54]
  • 提交

Alice

#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;
mt19937 rnd ( 1145141 );

const int N = 5005;

int n;
int rd[N], tmp[N];
vector < pair < int, int > > e;

vector < int > rnd_2 ( int lim ) {
	for ( int i = 1; i <= lim; i ++ ) {
		tmp[i] = i;
	}
	for ( int i = 1; i <= lim; i ++ ) {
		swap ( tmp[i], tmp[rnd () % lim + 1] );
	}
	vector < int > res;
	for ( int i = 1; i <= 2; i ++ ) {
		res.push_back ( tmp[i] );
	}
	return res;
}

vector < pair < int, int > > Alice () {
	long long x = setN ( 4980 );
	for ( int i = 1; i <= n; i ++ ) {
		rd[i] = i;
	}
	for ( int i = 1; i <= n; i ++ ) {
		swap ( rd[i], rd[rnd () % n + 1] );	
	}
    for ( int i = 2; i <= 100; i ++ ) {
        e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
    }
    for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
        for ( int k = i; k <= i + 80 - 1; k ++ ) {
            vector < int > tmp = rnd_2 ( i - 1 );
            if ( ( x >> ( long long ) j ) & 1ll ) {
                e.push_back ( { rd[k], rd[tmp[0]] } );
            }
            else {
                e.push_back ( { rd[k], rd[tmp[1]] } );
            }
        }
    }
	return e;
}

Bob

#include <bits/stdc++.h>
#include "Bob.h"

using namespace std;
mt19937 rnd ( 1145141 );

const int N = 5005;

int n;
int rd[N], tmp[N];
set < pair < int, int > > mp;

vector < int > rnd_2 ( int lim ) {
	for ( int i = 1; i <= lim; i ++ ) {
		tmp[i] = i;
	}
	for ( int i = 1; i <= lim; i ++ ) {
		swap ( tmp[i], tmp[rnd () % lim + 1] );
	}
	vector < int > res;
	for ( int i = 1; i <= 2; i ++ ) {
		res.push_back ( tmp[i] );
	}
	return res;
}

long long Bob ( vector < pair < int, int > > e ) {
	for ( pair < int, int > it : e ) {
		mp.insert ( it );
		mp.insert ( { it.second, it.first } );
	}
	for ( int i = 1; i <= n; i ++ ) {
		rd[i] = i;
	}
	for ( int i = 1; i <= n; i ++ ) {
		swap ( rd[i], rd[rnd () % n + 1] );	
	}
	for ( int i = 2; i <= 100; i ++ ) {
		e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
	}
	long long x = 0;
	for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
        long long val = -1;
        for ( int k = i; k <= i + 80 - 1; k ++ ) {
            vector < int > tmp = rnd_2 ( i - 1 );
            if ( mp.find ( { rd[k], rd[tmp[0]] } ) != mp.end () ) {
                val = 1;
                break;
            }
            if ( mp.find ( { rd[k], rd[tmp[0]] } ) != mp.end () ) {
                val = 0;
                break;
            }
        }
        if ( val ) {
            x += ( 1ll << ( long long ) j );
        }
    }
	return x;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 49ms = 49ms + 0ms
memory: 1892kb,1740kb

input:

1
4005

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 48ms = 48ms + 0ms
memory: 1896kb,1736kb

input:

1
17476204

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 48ms = 48ms + 0ms
memory: 1892kb,1740kb

input:

1
355365355024496523

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Edges returned by Alice() have invalid node.