QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#521052 | #8726. Magic Show | Misty7 | 0 | 89ms | 2020kb | C++14 | 806b | 2024-08-15 20:30:12 | 2024-08-15 20:30:12 |
Judging History
Alice
#include <bits/stdc++.h>
#include "Alice.h"
using i64 = long long;
constexpr int N = 5000;
std::vector<std::pair<int, int>> Alice () {
i64 n = setN(N);
std::vector<std::pair<int, int>> edges;
for (int i = 1; i < n; i++) {
edges.emplace_back(n % i + 1, i + 1);
}
return edges;
}
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using i64 = long long;
constexpr i64 limit = 1E15;
i64 lcm (i64 a, i64 b) {
return a / std::__gcd(a, b) * b;
}
i64 Bob (std::vector<std::pair<int, int>> edges) {
i64 ans = 0, per = 0;
for (auto [x, y] : edges) {
x--, y--;
while (ans % x != y) {
ans += per;
}
per = lcm(per, y);
if (per >= limit) {
break;
}
}
return ans;
}
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: 1820kb,1764kb
input:
1 4005
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 89ms = 89ms + 0ms
memory: 2020kb,1768kb
input:
1 17476204
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Number of edges returned by Alice() is not n-1.
Subtask #3:
score: 0
Time Limit Exceeded
Test #25:
score: 0
Time Limit Exceeded
input:
1 355365355024496523