Submission #2383284
Source Code Expand
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <climits>
using namespace std;
#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define uniq(x) (x).erase(unique(all(x)),(x).end())
typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z
const int MAX = 128;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const int MOD = 1000000007;
unsigned mat[32][MAX][MAX];
unsigned vec[MAX], res[MAX];
void solve(void){
int K, M;
cin >> K >> M;
M -= K;
repr(K, i) scanf("%u", &vec[i]);
rep(K, i) scanf("%u", &mat[0][0][i]);
rep(K-1, i) mat[0][i+1][i] = UINT32_MAX;
rep(31, m) {
rep(K, y) {
rep(K, x) {
rep(K, t) mat[m+1][y][x] ^= mat[m][y][t] & mat[m][t][x];
}
}
}
repr(32, m) {
rep(M/(1<<m), yuiinori) {
rep(K, i) {
rep(K, j) res[i] ^= vec[j] & mat[m][i][j];
}
rep(K, i) {
vec[i] = res[i];
res[i] = 0;
}
}
/*
printf("%d\n", m);
rep(K, k) printf("%3u ", vec[k]);
putchar('\n');
*/
M %= (1<<m);
}
cout << vec[0] << endl;
}
int main(void){
solve();
return 0;
}
Submission Info
Submission Time |
|
Task |
D - 漸化式 |
User |
sifi_border |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1947 Byte |
Status |
WA |
Exec Time |
41 ms |
Memory |
1920 KB |
Compile Error
./Main.cpp: In function ‘void solve()’:
./Main.cpp:48:36: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
repr(K, i) scanf("%u", &vec[i]);
^
./Main.cpp:49:41: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
rep(K, i) scanf("%u", &mat[0][0][i]);
^
Judge Result
Set Name |
All |
Score / Max Score |
0 / 100 |
Status |
|
Set Name |
Test Cases |
All |
random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_1.txt, sample_2.txt, sample_3.txt, small_1.txt, small_2.txt |
Case Name |
Status |
Exec Time |
Memory |
random_01.txt |
AC |
1 ms |
384 KB |
random_02.txt |
AC |
1 ms |
384 KB |
random_03.txt |
WA |
1 ms |
512 KB |
random_04.txt |
AC |
1 ms |
512 KB |
random_05.txt |
WA |
1 ms |
512 KB |
random_06.txt |
AC |
2 ms |
640 KB |
random_07.txt |
AC |
3 ms |
896 KB |
random_08.txt |
AC |
7 ms |
1152 KB |
random_09.txt |
AC |
39 ms |
1920 KB |
random_10.txt |
AC |
41 ms |
1920 KB |
random_11.txt |
AC |
41 ms |
1920 KB |
random_12.txt |
AC |
41 ms |
1920 KB |
random_13.txt |
AC |
41 ms |
1920 KB |
random_14.txt |
AC |
40 ms |
1920 KB |
random_15.txt |
AC |
41 ms |
1920 KB |
sample_1.txt |
AC |
1 ms |
384 KB |
sample_2.txt |
AC |
1 ms |
384 KB |
sample_3.txt |
AC |
2 ms |
896 KB |
small_1.txt |
AC |
1 ms |
384 KB |
small_2.txt |
AC |
1 ms |
384 KB |