Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
127811 | 田雨欣 | 求元素在矩阵中的位置 | C++ | Accepted | 1 MS | 280 KB | 370 | 2025-07-29 13:41:36 |
#include<bits/stdc++.h> using namespace std; int n, m, a[150][150]; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> a[i][j]; } } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (a[i][j] == m) { cout << i << " " << j; return 0; } } } cout << -1; return 0; }