Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
107292 | 李谨睿 | 求元素在矩阵中的位置 | C++ | Wrong Answer | 0 MS | 272 KB | 324 | 2025-01-17 15:22:43 |
#include<iostream> using namespace std; int main() { int n, f,c=0; cin >> n >> f; int a[n][n]; for (int j = 0; j < n; j++) { for (int i = 0; i < n; i++) { cin >> a[i][j]; if (f == a[i][j]) { cout << i << " " << j; c=1; break; } } } if(c==0){ cout<<-1; } return 0; }
------Input------
3 2 1 4 7 2 5 8 3 6 9
------Answer-----
1 0
------Your output-----
0 1