답안 #123351

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
123351 2019-07-01T08:08:19 Z 송준혁(#3022) Two Dishes (JOI19_dishes) C++14
0 / 100
7 ms 860 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

int N, M;
LL A[2020], S[2020];
LL B[2020], T[2020];
int D[2020][2020];

int main(){
    scanf("%d %d", &N, &M);
    for (int i=1; i<=N; i++){
        scanf("%lld %lld %*d", &A[i], &S[i]);
        A[i] += A[i-1];
    }
    for (int i=1; i<=M; i++){
        scanf("%lld %lld %*d", &B[i], &T[i]);
        B[i] += B[i-1];
    }
    for (int i=1; i<=N; i++) for (int j=1; j<=M; j++) D[i][j] = max(D[i-1][j] + ((A[i]+B[j] <= S[i]) ? 1 : 0), D[i][j-1] + ((A[i]+B[j] <= T[j]) ? 1 : 0));
    printf("%d\n", D[N][M]);
    return 0;
}

Compilation message

dishes.cpp: In function 'int main()':
dishes.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~~
dishes.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld %*d", &A[i], &S[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dishes.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld %*d", &B[i], &T[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 7 ms 860 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -