QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#669075 | #8726. Magic Show | pyiming | 0 | 0ms | 1872kb | C++14 | 1.3kb | 2024-10-23 17:12:22 | 2024-10-23 17:12:30 |
Alice
#include"Alice.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=5e3;
// int exgcd(int a,int b,int &x0,int &y0){
// if(b==0){
// x0=1;
// y0=0;
// return a;
// }
// int g=exgcd(b,a%b,y0,x0);
// y0-=a/b*x0;
// return g;
// }
ll setN(int n);
vector<pair<int,int>> Alice(){
ll x=setN(N);
vector<pair<int,int>> edges;
for(int i=2;i<=N;i++){
edges.push_back({x%i,i});
}
return edges;
}
Bob
#include"Bob.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int V=1e18;
int exgcd(int a,int b,int &x0,int &y0){
if(b==0){
x0=1;
y0=0;
return a;
}
int g=exgcd(b,a%b,y0,x0);
y0-=a/b*x0;
return g;
}
ll Bob(vector<pair<int,int>> edges){
vector<pair<int,int>> t;
__int128 n=1;
for(auto i:edges){
int x=i.first,y=i.second;
if(x>y){
swap(x,y);
}
n*=y;
t.push_back({x,y});
if(n>V){
break;
}
}
__int128 X=0;
for(auto i:t){
int a=i.first,b=i.second;
__int128 m=n/b;
int x,y;
exgcd(m%b,b,x,y);
x=(x%b+b)%b;
X=(X+a*m*x)%n;
}
return X;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1864kb,1764kb
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: 0ms = 0ms + 0ms
memory: 1872kb,1768kb
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: 0ms = 0ms + 0ms
memory: 1868kb,1768kb
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.