QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#471264#8726. Magic ShowHHHashmap0 1ms1968kbC++141.6kb2024-07-10 20:13:012024-07-10 20:13:02

Judging History

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

  • [2024-07-10 20:13:02]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:1968kb
  • [2024-07-10 20:13:01]
  • 提交

Alice

#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
mt19937 rd(1919810);
int bit[5010],tr[5010],now=0;
pair<int,int> sid[5010];
vector<int> ibit[70];
vector<pair<int,int>> ret;
queue<int> Q;
void init()
{
   srand(114514);
   for(int i=3;i<=5000;i++)
   {
      bit[i]=rand()%60;
      tr[i]=rand()%2+1;
   }
   for(int i=3;i<=5000;i++) ibit[bit[i]].push_back(i);
   return;
}
void print()
{
   shuffle(sid+1,sid+1+now,rd);ret.clear();ret.push_back({1,2});
   for(int i=1;i<=now;i++) ret.push_back({sid[i].first,sid[i].second});
   return;
}
vector<std::pair<int, int>> Alice()
{
   ll X,d;
   init();
   X=setN(5000);
   while(X)
   {
      d=__lg(X);
      Q.push(d);
      X-=(1ll<<d);
   }
   for(int i=59;i>=0;i--)
   {
      if(i==Q.front())
      {
         Q.pop();
         for(auto to:ibit[i]) sid[++now]={to,tr[to]};
         continue;
      }
      for(auto to:ibit[i]) sid[++now]={to,3-tr[to]};
   }
   print();
   return ret;
}

Bob

#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int bit2[5010],tr2[5010],res2[70];
ll calc()
{
   ll ans=0,dd=1;
   for(int i=0;i<=59;i++)
   {
      if(res2[i]) ans+=dd;
      dd*=2ll;
   }
   return ans;
}
void init2()
{
   srand(114514);
   for(int i=3;i<=5000;i++)
   {
      bit2[i]=rand()%60;
      tr2[i]=rand()%2+1;
   }
   return;
}
long long Bob(std::vector<std::pair<int, int>> V)
{
   init2();
   int m,x,y;
   for(int i=0;i<V.size();i++)
   {
      x=V[i].first;y=V[i].second;
      if(x==1) continue;
      if(tr2[x]==y) res2[bit2[x]]=1;
   }
   return calc();
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1968kb,1864kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 1
2787 2
161 1
756 2
1913 2
3331 2
1869 1
235 2
2571 2
2054 1
3089 2
1098 2
2284 2
976 2
2531 2
3620 1
4909 1
2410 1
1529 2
2173 1
1391 2
1984 1
4837 2
468...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 1
2787 2
161 1
756 2
1913 2
3331 2
1869 1
235 2
2571 2
2054 1
3089 2
1098 2
2284 2
976 2
2531 2
3620 1
4909 1
2410 1
1529 2
2173 1
1391 2
1984 1
4837 2
468...

output:

2
5000 3673
1 2
1 3
1 8
1 9
1 10
1 13
1 14
1 16
1 17
1 18
1 19
1 20
1 24
1 26
1 33
1 36
1 38
1 41
1 44
1 45
1 53
1 55
1 56
1 59
1 61
1 62
1 63
1 65
1 69
1 70
1 71
1 72
1 75
1 79
1 83
1 86
1 87
1 90
1 91
1 93
1 94
1 97
1 100
1 101
1 103
1 104
1 105
1 106
1 109
1 111
1 116
1 117
1 120
1 128
1 129
1 13...

input:

2
5000 3673
1 2
1 3
1 8
1 9
1 10
1 13
1 14
1 16
1 17
1 18
1 19
1 20
1 24
1 26
1 33
1 36
1 38
1 41
1 44
1 45
1 53
1 55
1 56
1 59
1 61
1 62
1 63
1 65
1 69
1 70
1 71
1 72
1 75
1 79
1 83
1 86
1 87
1 90
1 91
1 93
1 94
1 97
1 100
1 101
1 103
1 104
1 105
1 106
1 109
1 111
1 116
1 117
1 120
1 128
1 129
1 13...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1968kb,1860kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 1
2787 2
161 2
756 2
1913 2
3331 1
1869 1
235 2
2571 2
2054 1
3089 2
1098 2
2284 2
976 2
2531 2
3620 1
4909 1
2410 2
1529 2
2173 2
1391 2
1984 1
4837 2
468...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 1
2787 2
161 2
756 2
1913 2
3331 1
1869 1
235 2
2571 2
2054 1
3089 2
1098 2
2284 2
976 2
2531 2
3620 1
4909 1
2410 2
1529 2
2173 2
1391 2
1984 1
4837 2
468...

output:

2
5000 3673
1 2
1 3
1 8
1 9
1 10
1 14
1 16
1 17
1 18
1 19
1 20
1 24
1 33
1 36
1 38
1 41
1 44
1 53
1 55
1 59
1 61
1 63
1 65
1 68
1 69
1 70
1 71
1 72
1 76
1 83
1 86
1 87
1 93
1 94
1 95
1 97
1 98
1 100
1 101
1 103
1 104
1 105
1 107
1 109
1 116
1 119
1 120
1 122
1 129
1 132
1 137
1 139
1 142
1 144
1 145...

input:

2
5000 3673
1 2
1 3
1 8
1 9
1 10
1 14
1 16
1 17
1 18
1 19
1 20
1 24
1 33
1 36
1 38
1 41
1 44
1 53
1 55
1 59
1 61
1 63
1 65
1 68
1 69
1 70
1 71
1 72
1 76
1 83
1 86
1 87
1 93
1 94
1 95
1 97
1 98
1 100
1 101
1 103
1 104
1 105
1 107
1 109
1 116
1 119
1 120
1 122
1 129
1 132
1 137
1 139
1 142
1 144
1 145...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1968kb,1864kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 2
2787 2
161 2
756 1
1913 1
3331 1
1869 1
235 1
2571 2
2054 1
3089 1
1098 2
2284 2
976 1
2531 2
3620 2
4909 2
2410 1
1529 2
2173 2
1391 2
1984 1
4837 1
468...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1849 2
2787 2
161 2
756 1
1913 1
3331 1
1869 1
235 1
2571 2
2054 1
3089 1
1098 2
2284 2
976 1
2531 2
3620 2
4909 2
2410 1
1529 2
2173 2
1391 2
1984 1
4837 1
468...

output:

2
5000 3673
1 2
1 5
1 6
1 7
1 8
1 9
1 12
1 19
1 20
1 23
1 24
1 26
1 27
1 30
1 33
1 38
1 41
1 46
1 49
1 53
1 55
1 56
1 59
1 62
1 63
1 67
1 68
1 69
1 71
1 72
1 73
1 75
1 79
1 81
1 83
1 86
1 89
1 91
1 93
1 94
1 96
1 100
1 101
1 103
1 104
1 107
1 111
1 112
1 116
1 117
1 119
1 124
1 125
1 128
1 135
1 137...

input:

2
5000 3673
1 2
1 5
1 6
1 7
1 8
1 9
1 12
1 19
1 20
1 23
1 24
1 26
1 27
1 30
1 33
1 38
1 41
1 46
1 49
1 53
1 55
1 56
1 59
1 62
1 63
1 67
1 68
1 69
1 71
1 72
1 73
1 75
1 79
1 81
1 83
1 86
1 89
1 91
1 93
1 94
1 96
1 100
1 101
1 103
1 104
1 107
1 111
1 112
1 116
1 117
1 119
1 124
1 125
1 128
1 135
1 137...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Incorrect answer.