Submission #382846

# Submission time Handle Problem Language Result Execution time Memory
382846 2021-03-28T10:05:30 Z aris12345678 Exam (eJOI20_exam) C++14
0 / 100
3 ms 492 KB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 1e6+5;
int a[mxN], b[mxN];

int main() {
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    bool check = false;
    int ans = 0;
    for(int i = 0; i < n; i++) {
        scanf("%d", &b[i]);
        if(a[i] < b[i])
            ans++;
        else if(a[i] == b[i])
            check = true, ans++;
    }
    if(check)
        printf("%d\n", ans);
    else
        printf("0\n");
    return 0;
}

Compilation message

exam.cpp: In function 'int main()':
exam.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    9 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
exam.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   11 |         scanf("%d", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~
exam.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |         scanf("%d", &b[i]);
      |         ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -