Submission #118076

# Submission time Handle Problem Language Result Execution time Memory
118076 2019-06-18T06:41:35 Z 이온조(#2889) Lamps (JOI19_lamps) C++14
4 / 100
140 ms 8568 KB
#include <bits/stdc++.h>
using namespace std;

int A[1000009], B[1000009];

int main() {
    int N; scanf("%d",&N);
    for(int i=1; i<=N; i++) scanf("%1d",&A[i]);
    for(int i=1; i<=N; i++) scanf("%1d",&B[i]);
    int ans = 0;
    for(int i=1; i<=N; i++) if(B[i] - B[i-1] == 1) ++ans;
    printf("%d", ans);
    return 0;
}

Compilation message

lamp.cpp: In function 'int main()':
lamp.cpp:7:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int N; scanf("%d",&N);
            ~~~~~^~~~~~~~~
lamp.cpp:8:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=1; i<=N; i++) scanf("%1d",&A[i]);
                             ~~~~~^~~~~~~~~~~~~
lamp.cpp:9:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(int i=1; i<=N; i++) scanf("%1d",&B[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 360 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 256 KB Output is correct
7 Correct 134 ms 8532 KB Output is correct
8 Correct 136 ms 8440 KB Output is correct
9 Correct 140 ms 8452 KB Output is correct
10 Correct 135 ms 8440 KB Output is correct
11 Correct 135 ms 8496 KB Output is correct
12 Correct 137 ms 8540 KB Output is correct
13 Correct 135 ms 8540 KB Output is correct
14 Correct 134 ms 8568 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 -