Submission #946439

#TimeUsernameProblemLanguageResultExecution timeMemory
946439Nhoksocqt1Alice, Bob, and Circuit (APIO23_abc)C++17
8 / 100
115 ms10916 KiB
#ifndef Nhoksocqt1 #include "abc.h" #endif // Nhoksocqt1 #include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f #define sz(x) int((x).size()) #define fi first #define se second #define names ajfhqwurhuqerw typedef long long ll; typedef pair<int, int> ii; template<class X, class Y> inline bool maximize(X &x, const Y &y) {return (x < y ? x = y, 1 : 0);} template<class X, class Y> inline bool minimize(X &x, const Y &y) {return (x > y ? x = y, 1 : 0);} mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int Random(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); } const int MAXN = 702; const int MAXM = 1003; string names[MAXN], letter[MAXM][2]; int n, m; int alice(const int n, const char names[][5], const unsigned short numbers[], bool outputs_alice[]) { int lA(0); for (int j = 15; j >= 0; --j) outputs_alice[lA++] = (numbers[0] >> j & 1); outputs_alice[lA++] = 0; return lA; for (int i = 0; i < n; ++i) { bool check(0); for (int j = 0; j < 4; ++j) { int val = 26; if(!check) check |= (names[i][j] == '\0'); if(!check) val = names[i][j] - 'a'; for (int k = 4; k >= 0; --k) outputs_alice[lA++] = val >> k & 1; } for (int k = 15; k >= 0; --k) outputs_alice[lA++] = numbers[i] >> k & 1; } return lA; } int bob(const int m, const char send[][5], const char recei[][5], bool outputs_bob[]) { return m; int lB(0); for (int i = 0; i < m; ++i) { bool check(0); for (int j = 0; j < 4; ++j) { int val = 26; if(!check) check |= (send[i][j] == '\0'); if(!check) val = send[i][j] - 'a'; for (int k = 4; k >= 0; --k) outputs_bob[lB++] = val >> k & 1; } check = 0; for (int j = 0; j < 4; ++j) { int val = 26; if(!check) check |= (recei[i][j] == '\0'); if(!check) val = recei[i][j] - 'a'; for (int k = 4; k >= 0; --k) outputs_bob[lB++] = val >> k & 1; } } return lB; } int circuit(const int la, const int lb, int ope[], int gate[][2], int outputs_circuit[][16]) { int l(la + lb); for (int j = 0; j < 16; ++j) { ope[l] = 8; gate[l][0] = gate[l][1] = 16; ++l; } if(lb > 0) { for (int j = 0; j < 16; ++j) { ope[l] = 8; gate[l][0] = gate[l][1] = j; ++l; } } for (int i = 0; i < 16; ++i) { outputs_circuit[0][15 - i] = l - 16; ++l; } return l; } #ifdef Nhoksocqt1 int main(void) { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define TASK "abc" if(fopen(TASK".inp", "r")) { freopen(TASK".inp", "r", stdin); freopen(TASK".out", "w", stdout); } return 0; } #endif // Nhoksocqt1
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...