結果
| 問題 | No.3544 Robot on Torus (C++) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-05-16 20:38:25 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 283 bytes |
| 記録 | |
| コンパイル時間 | 1,706 ms |
| コンパイル使用メモリ | 211,564 KB |
| 実行使用メモリ | 6,400 KB |
| スコア | 374 |
| 最終ジャッジ日時 | 2026-05-16 20:38:34 |
| 合計ジャッジ時間 | 6,810 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
コンパイルメッセージ
main.cpp:2:66: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | using namespace std;int h,w,x,y,t=2e6,a,b;vector<string> s(2000);main(){cin>>h>>w;for(int i=0;i<h;i++){cin >> s[i];for(int j=0;j<w;j++)if(s[i][j]=='R')x=i,y=j;}while(t--) {if(s[a=(x+1)%h][b=(y+1)%w]=='#'){cout<<x+1<<" "<<y+1;return 0;}x=a,y=b;}cout<<"loop";}
| ^~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;int h,w,x,y,t=2e6,a,b;vector<string> s(2000);main(){cin>>h>>w;for(int i=0;i<h;i++){cin >> s[i];for(int j=0;j<w;j++)if(s[i][j]=='R')x=i,y=j;}while(t--) {if(s[a=(x+1)%h][b=(y+1)%w]=='#'){cout<<x+1<<" "<<y+1;return 0;}x=a,y=b;}cout<<"loop";}