제출 #570354

#제출 시각아이디문제언어결과실행 시간메모리
570354urd05Triple Jump (JOI19_jumps)C++17
5 / 100
4 ms444 KiB
#include <bits/stdc++.h> using namespace std; int arr[101]; int main() { int n,q; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&arr[i]); } scanf("%d",&q); for(int i=0;i<q;i++) { int l,r; scanf("%d %d",&l,&r); int ret=0; for(int i=l;i<=r;i++) { for(int j=i+1;j<=r;j++) { for(int k=j+1;k<=r;k++) { if (j-i<=k-j) { ret=max(ret,arr[i]+arr[j]+arr[k]); } } } } printf("%d\n",ret); } return 0; }

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

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