제출 #753528

#제출 시각아이디문제언어결과실행 시간메모리
753528piOOEBroken Device (JOI17_broken_device)C++17
0 / 100
39 ms2456 KiB
#include "Annalib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll Y = 983154202215176696LL; vector<int> p = {76, 28, 116, 65, 25, 94, 61, 39, 87, 128, 55, 79, 73, 107, 52, 89, 82, 74, 109, 1, 115, 18, 88, 9, 72, 21, 77, 127, 130, 30, 8, 35, 56, 63, 27, 59, 78, 60, 41, 148, 46, 124, 143, 93, 4, 96, 10, 100, 44, 67, 149, 36, 85, 50, 138, 122, 132, 49, 105, 118, 91, 84, 113, 110, 83, 2, 101, 6, 97, 43, 22, 134, 119, 31, 45, 20, 66, 57, 80, 120, 33, 108, 14, 54, 104, 146, 3, 24, 69, 37, 141, 70, 117, 15, 64, 19, 111, 86, 129, 140, 136, 51, 106, 102, 58, 126, 92, 145, 26, 13, 7, 121, 12, 38, 16, 103, 99, 71, 114, 34, 5, 53, 40, 147, 144, 98, 142, 90, 135, 32, 17, 29, 68, 133, 81, 0, 125, 48, 42, 123, 23, 139, 11, 112, 131, 95, 75, 47, 137, 62}; const string B = "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"; void Anna(int N, long long X, int K, int P[]) { vector<int> a(N), used(N); X ^= Y; for (int i = 0; i < K; ++i) { used[P[i]] = true; } if (X & 1) { if (!used[p[0]]) { a[p[0]] = 1; } else if (!used[p[1]]) { a[p[1]] = 1; } else { a[p[2]] = 1; } } for (int i = 3, b = 1; i < N; ++i) { if (!used[p[i]] && (X >> b & 1) == (B[i] - '0')) { a[p[i]] = 1; b += 1; } } for (int i = 0; i < N; i++) { Set(i, a[i]); } }
#include "Brunolib.h" #include <bits/stdc++.h> using namespace std; using ll = long long; constexpr ll Y = 983154202215176696LL; vector<int> p = {76, 28, 65, 116, 25, 94, 61, 39, 87, 128, 55, 79, 73, 107, 52, 89, 82, 74, 109, 1, 115, 18, 88, 9, 72, 21, 77, 127, 130, 30, 8, 35, 56, 63, 27, 59, 78, 60, 41, 148, 46, 124, 143, 93, 4, 96, 10, 100, 44, 67, 149, 36, 85, 50, 138, 122, 132, 49, 105, 118, 91, 84, 113, 110, 83, 2, 101, 6, 97, 43, 22, 134, 119, 31, 45, 20, 66, 57, 80, 120, 33, 108, 14, 54, 104, 146, 3, 24, 69, 37, 141, 70, 117, 15, 64, 19, 111, 86, 129, 140, 136, 51, 106, 102, 58, 126, 92, 145, 26, 13, 7, 121, 12, 38, 16, 103, 99, 71, 114, 34, 5, 53, 40, 147, 144, 98, 142, 90, 135, 32, 17, 29, 68, 133, 81, 0, 125, 48, 42, 123, 23, 139, 11, 112, 131, 95, 75, 47, 137, 62}; const string B = "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"; long long Bruno(int N, int A[]) { ll X = 0; if (A[p[0]] || A[p[1]] || A[p[2]]) { X = 1; } for (int i = 3, b = 1; i < N; ++i) { if (A[p[i]]) { X |= ll(B[i] - '0') << b; b += 1; } } X ^= Y; return X; }
#Verdict Execution timeMemoryGrader output
Fetching results...