제출 #1000019

#제출 시각아이디문제언어결과실행 시간메모리
1000019daffuwuGlobal Warming (CEOI18_glo)C++14
28 / 100
2093 ms3132 KiB
#include <bits/stdc++.h> using namespace std; #define fr first #define sc second mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); int n, x, t[200069], ans, dp[200069][2]; int main() { int i, j; scanf("%d%d", &n, &x); for (i=1; i<=n; i++) { scanf("%d", t+i); for (j=0; j<=i-1; j++) { if (t[j]<t[i]) { dp[i][0] = max(dp[i][0], dp[j][0]+1); dp[i][1] = max(dp[i][1], dp[j][1]+1); } if (t[j]-x<t[i]) dp[i][1] = max(dp[i][1], dp[j][0]+1); } ans = max(ans, max(dp[i][0], dp[i][1])); } printf("%d\n", ans); }

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

glo.cpp: In function 'int main()':
glo.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d%d", &n, &x);
      |     ~~~~~^~~~~~~~~~~~~~~~
glo.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d", t+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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...