Submission #813916

# Submission time Handle Problem Language Result Execution time Memory
813916 2023-08-08T04:32:31 Z 반딧불(#10119) Posters on the wall (CPSPC17_posters) C++17
20 / 100
184 ms 98236 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);
        x1++, y1++, x2++, 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);
        x1++, y1++;
        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:25:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         scanf("%d %d %d %d %d", &x1, &y1, &x2, &y2, &v);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 177 ms 98148 KB Output is correct
2 Correct 176 ms 98176 KB Output is correct
3 Correct 183 ms 98236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 98148 KB Output is correct
2 Correct 176 ms 98176 KB Output is correct
3 Correct 183 ms 98236 KB Output is correct
4 Correct 180 ms 98184 KB Output is correct
5 Correct 179 ms 98176 KB Output is correct
6 Correct 184 ms 98192 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 98148 KB Output is correct
2 Correct 176 ms 98176 KB Output is correct
3 Correct 183 ms 98236 KB Output is correct
4 Correct 180 ms 98184 KB Output is correct
5 Correct 179 ms 98176 KB Output is correct
6 Correct 184 ms 98192 KB Output is correct
7 Runtime error 2 ms 372 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 177 ms 98148 KB Output is correct
2 Correct 176 ms 98176 KB Output is correct
3 Correct 183 ms 98236 KB Output is correct
4 Correct 180 ms 98184 KB Output is correct
5 Correct 179 ms 98176 KB Output is correct
6 Correct 184 ms 98192 KB Output is correct
7 Runtime error 2 ms 380 KB Execution killed with signal 11
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 177 ms 98148 KB Output is correct
2 Correct 176 ms 98176 KB Output is correct
3 Correct 183 ms 98236 KB Output is correct
4 Correct 180 ms 98184 KB Output is correct
5 Correct 179 ms 98176 KB Output is correct
6 Correct 184 ms 98192 KB Output is correct
7 Runtime error 2 ms 372 KB Execution killed with signal 11
8 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 -