제출 #1238691

#제출 시각아이디문제언어결과실행 시간메모리
1238691JerBouquet (EGOI24_bouquet)C++20
18 / 100
20 ms2728 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 5; int l[MAXN], r[MAXN]; int n; int dp[MAXN]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d%d", &l[i], &r[i]); fill(dp, dp + n, 1); int res = 0; for (int i = 0; i < n; i++) for (int j = i - 1; j >= max(0, i - 6); j--) if (j + r[j] < i and j < i - l[i]) dp[i] = max(dp[i], dp[j] + 1), res = max(res, dp[i]); printf("%d\n", res); return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf("%d%d", &l[i], &r[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...