結果
| 問題 | No.3544 Robot on Torus (C++) |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-05-21 01:42:50 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 488 bytes |
| 記録 | |
| コンパイル時間 | 1,313 ms |
| コンパイル使用メモリ | 212,280 KB |
| 実行使用メモリ | 6,400 KB |
| スコア | 169 |
| 最終ジャッジ日時 | 2026-05-21 01:42:58 |
| 合計ジャッジ時間 | 5,954 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int h,w;
cin >> h >> w;
vector<string> MAP(h);
for (int i=0;i<h;i++){
cin>>MAP[i];
}
int x,y;
x=0;
y=0;
for (int i=0;i<h;i++){
for (int j=0;j<w;j++){
if (MAP[i][j]=='R'){
x=i;
y=j;
}
}
}
for (int tests=0;tests<1000000;tests++){
if (MAP[(x+1)%h][(y+1)%w]!='#'){
x=(x+1)%h;
y=(y+1)%w;
}
else{
cout<<x+1<<" "<<y+1<<endl;
return 0;
}
}
cout<<"loop"<<endl;
return 0;
}
titia