Submission #104750

# Submission time Handle Problem Language Result Execution time Memory
104750 2019-04-09T05:35:27 Z mzhao Lamps (JOI19_lamps) C++11
4 / 100
24 ms 12264 KB
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
#define D(x...) printf(x)
#else
#define D(x...)
#endif

#define MN 1000009

int N, A[MN], B[MN], ans;
string AA, BB;

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> N >> AA >> BB;
	for (int i = 0; i < N; i++) {
		A[i] = AA[i] == '1';
		B[i] = BB[i] == '1';
	}
	for (int i = 0, C; i < N; i++) {
		if ((!i || B[i] != B[i-1]) && B[i]) ans++;
	}
	printf("%d\n", ans);
}

Compilation message

lamp.cpp: In function 'int main()':
lamp.cpp:22:18: warning: unused variable 'C' [-Wunused-variable]
  for (int i = 0, C; i < N; i++) {
                  ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 24 ms 12232 KB Output is correct
8 Correct 19 ms 12236 KB Output is correct
9 Correct 16 ms 12244 KB Output is correct
10 Correct 17 ms 12264 KB Output is correct
11 Correct 20 ms 12244 KB Output is correct
12 Correct 17 ms 12244 KB Output is correct
13 Correct 19 ms 12244 KB Output is correct
14 Correct 19 ms 12244 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -