Submission #72078

#TimeUsernameProblemLanguageResultExecution timeMemory
72078동진의 (#118)Easy Data Structure Problem (FXCUP3_easy)C++17
0 / 100
3 ms248 KiB
#include <stdio.h> #include <stdlib.h> #include <iostream> using namespace std; int N, Q, L, R; int arr[100005]; void Query() { int min = arr[L]; for (int i = L+1; i <= R; i++) { if (arr[i] < min) min = arr[i]; } printf("%d\n", min); } int main() { scanf(" %d %d", &N, &Q); for (int i = 1; i <= N; i++) { scanf(" %d", &arr[i]); } for (int i = 0; i < Q; i++) { scanf(" %d %d", &L, &R); Query(); } return 0; }

Compilation message (stderr)

easy.cpp: In function 'int main()':
easy.cpp:22:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf(" %d %d", &N, &Q);
  ~~~~~^~~~~~~~~~~~~~~~~~
easy.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %d", &arr[i]);
   ~~~~~^~~~~~~~~~~~~~~~
easy.cpp:32:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %d %d", &L, &R);
   ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...