Submission #3789568
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define int long long
//#define uint __int128_t
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define low(a,b) lower_bound(all(a),(b))-(a).begin()
#define upp(a,b) upper_bound(all(a),(b))-(a).begin()
#define fill(i,n) memset(i,n,sizeof(i))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<vint> vvint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007;
const ll INF=1e18;
int H,W;
char s[101][101];
int dp[101][101];
int dx[]={0,1,1};
int dy[]={1,0,1};
int f(int x,int y){
int &r=dp[x][y];
if(r!=-1)return r;
r=1;
rep(i,0,3){
int nx=x+dx[i],ny=y+dy[i];
if(nx==H||ny==W||s[nx][ny]=='#')continue;
if(f(nx,ny)==1)r=0;
}
return r;
}
signed main() {
IOS();
//(1ll<<N)シフト演算のオーバーフローに気をつける
cin>>H>>W;
rep(i,0,H)rep(j,0,W)cin>>s[i][j];
fill(dp,-1);
cout<<(f(0,0)?"Second":"Fifst")<<endl;
return 0;
}
Submission Info
Submission Time |
|
Task |
B - マス目と駒 |
User |
chocopuu |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2116 Byte |
Status |
WA |
Exec Time |
2 ms |
Memory |
384 KB |
Judge Result
Set Name |
Sample |
Dataset1 |
Dataset2 |
Score / Max Score |
0 / 0 |
0 / 30 |
0 / 70 |
Status |
|
|
|
Set Name |
Test Cases |
Sample |
sample-01.txt, sample-02.txt, sample-03.txt |
Dataset1 |
sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt |
Dataset2 |
sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, 02-14.txt, 02-15.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name |
Status |
Exec Time |
Memory |
01-01.txt |
WA |
1 ms |
384 KB |
01-02.txt |
WA |
1 ms |
384 KB |
01-03.txt |
AC |
1 ms |
384 KB |
01-04.txt |
AC |
1 ms |
384 KB |
01-05.txt |
WA |
1 ms |
384 KB |
01-06.txt |
WA |
1 ms |
384 KB |
01-07.txt |
WA |
1 ms |
384 KB |
01-08.txt |
AC |
1 ms |
384 KB |
01-09.txt |
WA |
1 ms |
384 KB |
01-10.txt |
AC |
1 ms |
384 KB |
01-11.txt |
WA |
1 ms |
384 KB |
01-12.txt |
AC |
1 ms |
384 KB |
01-13.txt |
AC |
1 ms |
384 KB |
01-14.txt |
AC |
1 ms |
384 KB |
01-15.txt |
AC |
1 ms |
384 KB |
02-01.txt |
WA |
2 ms |
384 KB |
02-02.txt |
WA |
1 ms |
384 KB |
02-03.txt |
WA |
1 ms |
384 KB |
02-04.txt |
WA |
1 ms |
384 KB |
02-05.txt |
WA |
1 ms |
384 KB |
02-06.txt |
AC |
2 ms |
384 KB |
02-07.txt |
WA |
2 ms |
384 KB |
02-08.txt |
WA |
2 ms |
384 KB |
02-09.txt |
AC |
2 ms |
384 KB |
02-10.txt |
AC |
2 ms |
384 KB |
02-11.txt |
WA |
2 ms |
384 KB |
02-12.txt |
AC |
1 ms |
384 KB |
02-13.txt |
AC |
1 ms |
384 KB |
02-14.txt |
WA |
1 ms |
384 KB |
02-15.txt |
AC |
1 ms |
384 KB |
sample-01.txt |
WA |
1 ms |
384 KB |
sample-02.txt |
AC |
1 ms |
384 KB |
sample-03.txt |
AC |
1 ms |
384 KB |