Submission #813908

# Submission time Handle Problem Language Result Execution time Memory
813908 2023-08-08T04:30:43 Z 반딧불(#10119) Posters on the wall (CPSPC17_posters) C++17
0 / 100
177 ms 98100 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q, MOD;
int arr[5002][5002];

int main(){
    scanf("%d %d %d %d %d", &n, &q, &n, &q, &MOD);
    for(int i=1; i<=n; i++){
        int x1, y1, x2, y2;
        scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
        if(x1>x2) swap(x1, x2);
        if(y1>y2) swap(y1, y2);
        arr[x1][y1]++, arr[x1][y2]--;
        arr[x2][y1]--, arr[x2][y2]++;
    }
    for(int i=1; i<=5000; i++) for(int j=1; j<=5000; j++) arr[i][j] += arr[i][j-1] + arr[i-1][j] - arr[i-1][j-1];
    for(int i=1; i<=5000; i++) for(int j=1; j<=5000; j++) arr[i][j] += arr[i][j-1] + arr[i-1][j] - arr[i-1][j-1];
    for(int i=1; i<=q; i++){
        int x1, y1, x2, y2, v;
        scanf("%d %d %d %d %d", &x1, &y1, &x2, &y2, &v);
        if(x1>x2) swap(x1, x2);
        if(y1>y2) swap(y1, y2);
        x2--, y2--;
        printf("%d\n", arr[x2][y2] - arr[x2][y1-1] - arr[x1-1][y2] + arr[x1-1][y1-1]);
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d %d %d %d %d", &n, &q, &n, &q, &MOD);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         scanf("%d %d %d %d %d", &x1, &y1, &x2, &y2, &v);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 98100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 98100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 98100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 98100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 177 ms 98100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -