有没有大佬知道“海上宝藏”这题怎么做!!
2025-12-01 21:43:30
发布于:浙江
有没有大佬知道“海上宝藏”这题怎么做!!
https://www.acgo.cn/problemset/info/92248?homeworkId=13900&teamCode=1897479532693164032
全部评论 5
@𝓐𝓘𝓮𝓻
退站了没有
没退的话麻烦把那个团退了2025-12-04 来自 浙江
0#include <iostream>
using namespace std;
char ch[110][1010];
int main(){
int n,m;
cin>>n>>m;
for(int i=0;i<=n-1;i++){
for(int j=0;j<=m-1;j++){
cin>>ch[i][j];
}
}
for(int i=0;i<=n-1;i++){
for(int j=0;j<=m-1;j++){
if(ch[i][j]'T'){
cout<<"("<<i<<","<<j<<")"<<" ";
}
}
}
cout<<endl;
for(int i=0;i<=n-1;i++){
for(int j=0;j<=m-1;j++){
if(ch[i][j]'S'){
cout<<"("<<i<<","<<j<<")"<<" ";
}
}
}
return 0;
}2025-12-04 来自 浙江
0
2025-12-05 来自 浙江
0
过了
2025-12-02 来自 浙江
0#include <iostream>
#include <vector>
#include <string>
using namespace std;int main() {
int n, m;
cin >> n >> m;vector<string> grid(n); vector<pair<int, int>> treasures; // 存储宝藏坐标 vector<pair<int, int>> traps; // 存储陷阱坐标 // 读取地图 for (int i = 0; i < n; i++) { cin >> grid[i]; } // 遍历所有位置 for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (grid[i][j] == 'T') { treasures.push_back({i, j}); // 宝藏 } else if (grid[i][j] == 'S') { traps.push_back({i, j}); // 陷阱 } } } // 输出宝藏坐标 for (int i = 0; i < treasures.size(); i++) { cout << "(" << treasures[i].first << "," << treasures[i].second << ")"; if (i != treasures.size() - 1) { cout << " "; } } cout << endl; // 输出陷阱坐标 for (int i = 0; i < traps.size(); i++) { cout << "(" << traps[i].first << "," << traps[i].second << ")"; if (i != traps.size() - 1) { cout << " "; } } cout << endl; return 0;}
2025-12-02 来自 浙江
0谢谢






2025-12-03 来自 浙江
0给别人代码也要用AI?
2025-12-25 来自 重庆
0可能是看错了
2025-12-25 来自 重庆
0
还要进团?
2025-12-01 来自 浙江
0我不知道
2025-12-02 来自 浙江
0



























有帮助,赞一个