Submission #1843330


Source Code Expand

#include <iostream>
#include <cstdio>
using namespace std;

int n, c, mn = 2e9, mx, md;
int main()
{
	int t;
	cin >> n >> t;
	while (n--) {
		scanf("%d", &t);
		if (t < mn) mn = t, mx = 0;
		if (t > mx) {
			mx = t;
			if (mx - mn > md) md = mx - mn, c = 0;
			if (mx - mn == md) c++;
		}
	}
    cout << c << endl;
    return 0;
}

Submission Info

Submission Time
Task D - An Invisible Hand
User Abra_Stone
Language C++14 (GCC 5.4.1)
Score 400
Code Size 350 Byte
Status AC
Exec Time 13 ms
Memory 256 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:11:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &t);
                  ^

Judge Result

Set Name sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 15
Set Name Test Cases
sample sample_01.txt, sample_02.txt, sample_03.txt
All large_01.txt, large_02.txt, random_01.txt, random_02.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, spec_01.txt, spec_02.txt, spec_03.txt, spec_04.txt, spec_05.txt, spec_06.txt
Case Name Status Exec Time Memory
large_01.txt AC 13 ms 256 KB
large_02.txt AC 11 ms 256 KB
random_01.txt AC 13 ms 256 KB
random_02.txt AC 13 ms 256 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
small_01.txt AC 1 ms 256 KB
small_02.txt AC 1 ms 256 KB
spec_01.txt AC 13 ms 256 KB
spec_02.txt AC 13 ms 256 KB
spec_03.txt AC 12 ms 256 KB
spec_04.txt AC 13 ms 256 KB
spec_05.txt AC 13 ms 256 KB
spec_06.txt AC 13 ms 256 KB