Submission #2176334


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int a[100000], c[100000];
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	for(int i = 0;i < n;i++)scanf("%d", &a[i]);
	for(int i = 0;i < n;i++)scanf("%d", &c[i]);
	for(int i = n;i < m;i++){
		int x = 0;
		for(int j = 0;j < n;j++){
			int y = a[i-j-1] & c[j];
			x = x^y;
		}
		a[i] = x;
	}
	//for(int i = 0;i < m;i++)printf("%d ", a[i]);
	printf("%d\n", a[m-1]);
	return 0;
}

Submission Info

Submission Time
Task D - 漸化式
User Ryoga_0212
Language C++14 (GCC 5.4.1)
Score 0
Code Size 445 Byte
Status RE
Exec Time 108 ms
Memory 640 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:7:23: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &n, &m);
                       ^
./Main.cpp:8:44: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 0;i < n;i++)scanf("%d", &a[i]);
                                            ^
./Main.cpp:9:44: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 0;i < n;i++)scanf("%d", &c[i]);
                                            ^

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 4
WA × 2
RE × 14
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 RE 98 ms 640 KB
random_02.txt RE 98 ms 640 KB
random_03.txt WA 1 ms 256 KB
random_04.txt AC 1 ms 256 KB
random_05.txt WA 1 ms 256 KB
random_06.txt AC 1 ms 256 KB
random_07.txt RE 102 ms 640 KB
random_08.txt RE 103 ms 640 KB
random_09.txt RE 106 ms 640 KB
random_10.txt RE 108 ms 640 KB
random_11.txt RE 108 ms 640 KB
random_12.txt RE 106 ms 640 KB
random_13.txt RE 107 ms 640 KB
random_14.txt RE 107 ms 640 KB
random_15.txt RE 108 ms 640 KB
sample_1.txt AC 1 ms 256 KB
sample_2.txt AC 1 ms 256 KB
sample_3.txt RE 102 ms 640 KB
small_1.txt RE 100 ms 640 KB
small_2.txt RE 99 ms 640 KB