Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
211 B
0
Indexable
Never
#include <iostream>

using namespace std;

int main() {
	int n, i, v, s;
	int m = 0;
	int k = -1;

	cin >> n;

for (i = 1; i <= n; i++) {

	cin >> v >> s;

	if (s && v > m){	
		m = v;
		k = i;
	}
}
	cout << k;
}