Submission #426604

# Submission time Handle Problem Language Result Execution time Memory
426604 2021-06-14T07:43:25 Z 반딧불(#7615) Bodyguard (JOI21_bodyguard) C++17
0 / 100
559 ms 796792 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n, q;
int t[3002], a[3002], b[3002]; ll c[3002];

ll mat[12002][6002][2];
ll DP[6002][2];

int main(){
    scanf("%d %d", &n, &q);
    for(int i=1; i<=n; i++){
        scanf("%d %d %d %lld", &t[i], &a[i], &b[i], &c[i]);
        a[i] *= 2, b[i] *= 2, t[i] *= 2, c[i] /= 2;

        if(a[i] < b[i]){
            for(int x=a[i], y=t[i]; x<b[i]; x++, y++){
                mat[y][x][1] = max(mat[y][x][1], c[i]);
            }
        }
        else{
            for(int x=a[i], y=t[i]; x>a[i]; x--, y++){
                mat[y][x][0] = max(mat[y][x][0], c[i]);
            }
        }
    }
}

Compilation message

bodyguard.cpp: In function 'int main()':
bodyguard.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%d %d", &n, &q);
      |     ~~~~~^~~~~~~~~~~~~~~~~
bodyguard.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%d %d %d %lld", &t[i], &a[i], &b[i], &c[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 559 ms 796792 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 57 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 57 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 57 ms 332 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 559 ms 796792 KB Output isn't correct
2 Halted 0 ms 0 KB -