Submission #72078

# Submission time Handle Problem Language Result Execution time Memory
72078 2018-08-26T05:10:04 Z 동진의 (#2167, kdk3776, define_chan, Jinpari) Easy Data Structure Problem (FXCUP3_easy) C++17
0 / 100
3 ms 248 KB
#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

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 time Memory Grader output
1 Incorrect 3 ms 248 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 248 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -