Submission #677368

# Submission time Handle Problem Language Result Execution time Memory
677368 2023-01-03T06:08:19 Z Cross_Ratio None (JOI15_walls) C++14
0 / 100
9 ms 1276 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
int A[200005];
int B[200005];
signed main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int N, M;
    cin >> N >> M;
    int i, j;
    for(i=0;i<N;i++) cin >> A[i] >> B[i];
    for(i=0;i<M;i++) {
        int c;
        cin >> c;
        if(c<A[i]) cout << A[i] - c << '\n';
        else if(c <= B[i]) cout << "0\n";
        else cout << c - B[i] << '\n';
    }
}

Compilation message

walls.cpp: In function 'int main()':
walls.cpp:12:12: warning: unused variable 'j' [-Wunused-variable]
   12 |     int i, j;
      |            ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 1276 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Output isn't correct
2 Halted 0 ms 0 KB -