結果
| 問題 | No.331 CodeRunnerでやれ |
| コンテスト | |
| ユーザー |
37zigen
|
| 提出日時 | 2016-05-28 13:22:08 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 834 bytes |
| 記録 | |
| コンパイル時間 | 2,327 ms |
| コンパイル使用メモリ | 77,152 KB |
| 実行使用メモリ | 133,396 KB |
| 最終ジャッジ日時 | 2024-07-16 23:49:56 |
| 合計ジャッジ時間 | 15,760 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 1 |
| other | TLE * 1 -- * 15 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class Main{
public static void main(String[] args){
new Main().solve();
}
void solve(){
Scanner sc=new Scanner(System.in);
//F,B,L,R
String s="";
int[][] map=new int[50][50];
int x=15;int y=15;
int[] dx={1,0,-1,0};
int[] dy={0,1,0,-1};
int d=0;
while(true){
boolean f=false;
if(map[y][x]!=0){
for(int i=1;i<3;i++){
if(map[y+dy[(d+i)%4]][x+dx[(d+i)%4]]==0){
System.out.println("R");
f=true;
d++;
break;
}
}
}
if(f=true)continue;
else if(!f){
System.out.println("F");
s=sc.nextLine();
if(s.equals("Merry Christmas!"))return;
else if(Integer.parseInt(s)>0){
x=x+dx[d%4];
y=y+dy[d%4];
map[y][x]=1;
}else if(Integer.parseInt(s)==0){
map[y][x]=-1;
}
}
}
}
}
37zigen