-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaptop.cpp
More file actions
60 lines (59 loc) · 1.17 KB
/
Copy pathlaptop.cpp
File metadata and controls
60 lines (59 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int MAX_N = 1e5 + 1;
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
void solve()
{
int n;
cin >> n;
int arr[n][4];
int max = INT_MIN;
int max1 = INT_MIN;
int max2 = INT_MIN;
// cin >> arr[0][0];
// cin >> arr[0][1];
// cin >> arr[0][2];
// cin >> arr[0][3];
int count = 0;
for (int i = 0; i < n; i++)
{
cin >> arr[i][0];
cin >> arr[i][1];
cin >> arr[i][2];
cin >> arr[i][3];
if (max < arr[i][0] && max1 < arr[i][1] && max2 < arr[i][2])
{
max = arr[i][0];
max1 = arr[i][1];
max2 = arr[i][2];
}
}
int min = INT_MAX;
int index;
for (int i = 0; i < n; i++)
{
if (max > arr[i][0] && max1 > arr[i][1] && max2 > arr[i][2])
{
continue;
}
else
{
if (min > arr[i][3])
{
min = arr[i][3];
index = i;
}
}
}
cout << index + 1;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
solve();
}