dd
Anonymous
c_cpp
11/01/2023 6:46 PM
368 B
16
Indexable
#include <iostream>
using namespace std;
int main()
{
int a;
int v, s;
int max = 0;
int d = -1;
cin >> a;
for (int i = 1; i <= a; i++)
{
cin >> v >> s;
if (s == 1)
{
if (v > max)
{
d = i;
max = v;
}
}
}
cout << d;
}Editor is loading...