#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int a[100][100];
// чтение
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> a[i][j];
}
}
int max = a[0][0], max_i = 0, max_j = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (a[i][j] > max) {
max = a[i][j];
max_i = i;
max_j = j;
}
}
}
cout << max_i << " " << max_j;
return 0;
}
Объяснение:
#include <iostream>
#include <vector>
using namespace std;
int main() {int m, n, cx, cy;
cin >> m >> n;
vector<int>a;
a.reserve(m*n);
for (int i = 0;i < m;++i) {
for(int j = 0;j < n;++j) {
int v;
cin >> v;
a.push_back(v);
}
}
int x;
int value = 0;
cin >> x;
for (int k = 0;k < x;++k) {
cin >> cx >> cy;
if((a[cy-1 + (cx-1)*cy]) != -100) {
value += a[cy-1 + (cx-1)*cy];
a[cy-1 + (cx-1)*cy] = -100;
}
}cout << value;
}
Объяснение:
Ага! Из ЯЛицея!
Ладно держи!
n = set()
n1 = set()
a = input()
while a != '':
n.add(a)
a = input()
a1 = input()
while a1 != '':
n1.add(a1)
a1 = input()
intersection = n & n1
if intersection == set():
print('EEMPTY')
else:
for e in intersection:
print(e)
print('\n')
по PEP8 ошибки исправь
и переменные переименуй
P. S. ' в Wing может не пойти. В этом случае замени их на ковычки