結果
| 問題 | No.3606 Ice Grid Game |
| コンテスト | |
| ユーザー |
Rubikun
|
| 提出日時 | 2026-07-31 21:44:57 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,879 bytes |
| 記録 | |
| コンパイル時間 | 1,594 ms |
| コンパイル使用メモリ | 231,392 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-31 21:45:08 |
| 合計ジャッジ時間 | 2,525 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define vvii vector<vector<pair<int,int>>>
#define vvll vector<vector<pair<ll,ll>>>
#define vst vector<string>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define mkunique(x) sort(all(x));(x).erase(unique(all(x)),(x).end())
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=15<<26;
map<tuple<vvi,int,int>,bool> MA;
bool solve(vvi S,int R,int C){
int H=si(S),W=si(S[0]);
if(MA.count({S,R,C})) return MA[{S,R,C}];
vi dh={-1,0,1,0},dw={0,-1,0,1};
int h=R,w=C;
for(int k=0;k<4;k++){
int toh=h+dh[k],tow=w+dw[k];
if(toh<0||toh>=H||tow<0||tow>=W||S[toh][tow]) continue;
vvi sv=S;
while(1){
int toh=h+dh[k],tow=w+dw[k];
if(toh<0||toh>=H||tow<0||tow>=W||S[toh][tow]) break;
S[h][w]=true;
h=toh;
w=tow;
}
if(!solve(S,h,w)) return MA[{sv,R,C}]=true;
S=sv;
}
return MA[{S,R,C}]=false;
}
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
int Q;cin>>Q;
while(Q--){
int H,W,R,C;cin>>H>>W>>R>>C;R--;C--;
if(H==1&&W==1) cout<<"Bob\n";
else cout<<"Alice\n";
}
return 0;
for(int H=1;H<=5;H++){
for(int W=1;W<=5;W++){
vvi S(H,vi(W));
for(int h=0;h<H;h++){
for(int w=0;w<W;w++){
cout<<solve(S,h,w);
}
cout<<"\n";
}
cout<<"\n";
}
}
/*
int Q;cin>>Q;
while(Q--){
int H,W,R,C;cin>>H>>W>>R>>C;R--;C--;
bool win=false;
for(int q=0;q<2;q++){
for(int qq=0;qq<2;qq++){
bool ok=true;
if(R==0){
ok=false;
}else{
if(C){
ok&=f(H,W,R,C);
}
if(C+1<W){
C=W-1-C;
ok&=f(H,W,R,C);
C=W-1-C;
}
}
if(ok) win=true;
C=W-1-C;
}
swap(H,W);
swap(R,C);
}
if(win) cout<<"Alice\n";
else cout<<"Bob\n";
}
*/
}
Rubikun