Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
222 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	int n, i, v, s, m = 0, k = -1;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> v >> s;
		if (s and v > m)
		{
			m = v;
			k = i;
		}
	}
	cout << k;
}