Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
100153 | Kevin | 求元素在矩阵中的位置 | C++ | Accepted | 1 MS | 280 KB | 326 | 2024-12-05 15:33:00 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[101][101]; int n,m; 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; }