QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#559886 | #8221. 多方计算 | Fido_Puppy | 0 | 105ms | 56092kb | C++23 | 1.5kb | 2024-09-12 10:12:40 | 2024-09-12 10:12:42 |
Judging History
answer
#include <bits/stdc++.h>
// #include "mpc.h"
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back
#define rz resize
#define MP make_pair
#define MT make_tuple
#define IT iterator
#define fi first
#define se second
#define For(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define Rep(i, a, b) for (int i = (int)(a); i >= (int)(b); --i)
#define CLR(a, v) memset(a, v, sizeof(a))
#define CPY(a, b) memcpy(a, b, sizeof(a))
#define debug cerr << "ztxakking\n"
#define y0 ztxaknoi
#define y1 ztxakioi
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using vi = vector<int>;
template<typename T>
using V = vector<T>;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
struct player {
bool last_message;
array<int, 4096> memory;
};
int precalc(int n, int m);
bool transmit(player &player, int round, int position);
int N, M;
int precalc(int n, int m) {
N = n, M = m;
return n + m + 3;
}
bool transmit(player &player, int round, int position) {
int p = round - position - 1, t = player.last_message;
if (p < 0) {
if (p >= -8) p = p + M + 4;
else p = p + M + 19;
}
if (p < 0) return 0;
int i = p;
for ( ; player.memory[i]; ++i) player.memory[i] = 0;
player.memory[i] = 1;
int u = player.memory[p];
if (position < N) player.memory[p] = 0;
return u;
}
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
memory: 5988kb
input:
5 5 3185997250635081508 10243950506680270049
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #2:
score: 0
Wrong Answer
Test #37:
score: 0
Wrong Answer
time: 10ms
memory: 32040kb
input:
1000 1 17833636513278974999 18032835279213373306
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #3:
score: 0
Wrong Answer
Test #73:
score: 0
Wrong Answer
time: 10ms
memory: 32124kb
input:
1000 10 7581650225429700886 16046788410942473709
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #4:
score: 0
Wrong Answer
Test #109:
score: 0
Wrong Answer
time: 17ms
memory: 31668kb
input:
1000 30 15510757929061591914 2629686482095382587
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #5:
score: 0
Wrong Answer
Test #145:
score: 0
Wrong Answer
time: 1ms
memory: 5992kb
input:
3 1000 341353812123787886 3685575517089631424
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #6:
score: 0
Wrong Answer
Test #181:
score: 0
Wrong Answer
time: 1ms
memory: 6160kb
input:
10 1000 18326939717248212778 15447461170187547045
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #7:
score: 0
Wrong Answer
Test #217:
score: 0
Wrong Answer
time: 13ms
memory: 18480kb
input:
500 1000 3911210051670624968 2787181900148297327
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #8:
score: 0
Wrong Answer
Test #253:
score: 0
Wrong Answer
time: 31ms
memory: 32600kb
input:
1000 1000 2442055921391744378 15448328346037637846
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #9:
score: 0
Wrong Answer
Test #289:
score: 0
Wrong Answer
time: 58ms
memory: 43884kb
input:
1500 1500 8660688640427922501 1436138393991664715
output:
4123764187648
result:
points 0.0 Correct Answer. 0
Subtask #10:
score: 0
Wrong Answer
Test #325:
score: 0
Wrong Answer
time: 105ms
memory: 56092kb
input:
2000 2000 6596342253746377097 6195418207254921855
output:
4123764187648
result:
points 0.0 Correct Answer. 0