제출 #1365929

#제출 시각아이디문제언어결과실행 시간메모리
1365929kmath628Exam (eJOI20_exam)C++20
13 / 100
31 ms67356 KiB
#include <bits/stdc++.h>
using namespace std;
int a[100009],b[100009],dp[5009][5009];
int main(){
    int n,i,j;
    scanf("%d",&n);
    for(i=1;i<=n;i++) scanf("%d",&a[i]);
    for(i=1;i<=n;i++) scanf("%d",&b[i]);
    for(i=1;i<=n;i++){
        for(j=i;j<=n;j++){
            dp[i][j]=max(dp[i][j-1], (int)(a[j]==b[i]) + dp[i-1][j]);
        }
    }
    printf("%d\n",dp[n][n]);
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

exam.cpp: In function 'int main()':
exam.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
exam.cpp:7:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     for(i=1;i<=n;i++) scanf("%d",&a[i]);
      |                       ~~~~~^~~~~~~~~~~~
exam.cpp:8:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     for(i=1;i<=n;i++) scanf("%d",&b[i]);
      |                       ~~~~~^~~~~~~~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…