Submission #833617

# Submission time Handle Problem Language Result Execution time Memory
833617 2023-08-22T07:11:39 Z vjudge1 Exam (eJOI20_exam) C++17
0 / 100
36 ms 980 KB
#include <bits/stdc++.h>
using namespace std; 
#define ll long long

int main()
{
	int n; 
	cin >> n; 
	int height[n + 5]; 
	int targets[n + 5]; 
	for(int i = 0; i < n; i++)
	{
		cin >> height[i]; 
	}

	for(int i = 0; i < n; i++)
	{
		cin >> targets[i];
	}
	
	int target = targets[0]; 
	int temp = 0; 
	ll res = 0; 
	int ok = 0; 
	for(int i = 0; i < n; i++)
	{
		if(height[i] < target)
		{
			if(ok == 0)
			{
				temp++; 
			}
			else
			{
				res++; 
			}
		}
		else if(height[i] > target)
		{
			ok = 0; 
			temp = 0; 
		}
		else if(height[i] == target)
		{
			res += temp; 
			ok = 1; 
			res++; 
		}
	}
	cout << res << endl; 

	return 0; 
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 12 ms 340 KB Output is correct
3 Correct 36 ms 980 KB Output is correct
4 Incorrect 21 ms 980 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -