QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#468920 | #7180. Forward-Capturing Pawns | embusca# | WA | 0ms | 3612kb | C++20 | 1.3kb | 2024-07-09 03:59:14 | 2024-07-09 03:59:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rp(i,a,b) for(int i=a;i<b;i++)
void solvetask(){
string wk, wp, bk, v;
cin >> wk >> wp >> bk >> v;
if((v[0] == 'w' && wp[1] > bk[1]) || (v[0] == 'b' && wp[1] > bk[1]+1)){
cout << "Win\n";
return;
}
int wd = max(abs((wk[0]-'a') - (wp[0]-'a')), abs((wk[1]-'0') - (wp[1]-'0'))), bd = max(abs((bk[0]-'a') - (wp[0]-'a')), abs((bk[1]-'0') - (wp[1]-'0'))), dp = '8'-wp[1];
if(v[0] == 'b') bd--;
if((bk == "h8" && wp == "g7" && ((wk == "g6") || (wk == "h6"))) && v == "b"){
cout << "Draw\n";
return;
}
if((bk == "a8" && wp == "b7" && ((wk == "b6") || (wk == "a6")) || bd <= 1) && v == "b"){
cout << "Draw\n";
return;
}
if(bd < wd-1 && bd < dp){
if(wp[1] == '2'){
wp[1] = '4';
wd = max(abs((wk[0]-'a') - (wp[0]-'a')), abs((wk[1]-'0') - (wp[1]-'0'))), bd = max(abs((bk[0]-'a') - (wp[0]-'a')), abs((bk[1]-'0') - (wp[1]-'0'))), dp = '8'-wp[1];
if(v[0] == 'b') bd--;
}
if(bd < wd-1 && bd < dp) cout << "Draw\n";
else cout << "Win\n";
}
else cout << "Win\n";
}
int main(){
cin.tie(0)->sync_with_stdio(0);
ll t = 1;
cin >> t;
while(t--) solvetask();
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
input:
6 a2 d7 e7 w b6 d7 e7 b b6 d7 e7 w b5 a2 b2 w a6 a2 a4 b g6 g7 h8 b
output:
Win Draw Win Win Draw Draw
result:
wrong answer 1st lines differ - expected: 'Draw', found: 'Win'