QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#788260 | #5903. Xeno-archaeology | Eibon | 12 | 8ms | 3724kb | C++23 | 1.2kb | 2024-11-27 16:22:46 | 2024-11-27 16:22:46 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[1001],b[1001];
char c[1001];
inline char get(int x,int y,int u,int v){
u-=x;
v-=y;
return (max(abs(u),abs(v))&1)?'#':'.';
}
inline bool check(int x,int y){
for (int i=1;i<=n;i++){
if (get(x,y,a[i],b[i])!=c[i]){
return false;
}
}
return true;
}
int main(){
// freopen("D.in","r",stdin);
// freopen("D.out","w",stdout);
int T;
cin>>T;
for (int test_case=1;test_case<=T;test_case++){
cout<<"Case #"<<test_case<<": ";
cin>>n;
for (int i=1;i<=n;i++){
cin>>a[i]>>b[i]>>c[i];
}
for (int dis=0;dis<=201;dis++){
for (int x=dis;x>=-dis;x--){
if (x==dis or x==-dis){
if (check(x,0)){
cout<<x<<" 0\n";
goto egg;
}
}else{
if (x>=0){
if (check(x,dis-x)){
cout<<x<<" "<<dis-x<<"\n";
goto egg;
}
if (check(x,x-dis)){
cout<<x<<" "<<x-dis<<"\n";
goto egg;
}
}else{
if (check(x,dis+x)){
cout<<x<<" "<<dis+x<<"\n";
goto egg;
}
if (check(x,-dis-x)){
cout<<x<<" "<<-dis-x<<"\n";
goto egg;
}
}
}
}
}
cout<<"Too damaged\n";
egg:;
}
return 0;
}
详细
Subtask #1:
score: 12
Accepted
Test #1:
score: 12
Accepted
time: 7ms
memory: 3724kb
input:
50 1 0 0 . 1 0 0 # 3 0 0 # 0 1 # 1 0 # 5 50 30 # 49 30 # 49 31 # 49 32 # 50 32 # 2 -98 0 # 99 50 . 4 88 88 . 88 89 . 89 88 . 89 89 . 89 48 12 . 43 66 . 83 63 # 51 51 . -85 65 # 4 -22 # -75 -79 . 2 -17 # -57 -66 . -82 -51 . -33 64 # 90 40 . -29 50 . -30 73 . 5 -58 . 8 -35 # 76 54 . -91 35 . -95 50 # ...
output:
Case #1: 0 0 Case #2: 1 0 Case #3: 1 1 Case #4: 50 31 Case #5: 1 0 Case #6: Too damaged Case #7: Too damaged Case #8: Too damaged Case #9: -59 3 Case #10: 0 0 Case #11: -86 78 Case #12: -62 1 Case #13: -40 17 Case #14: Too damaged Case #15: 1 0 Case #16: 0 -26 Case #17: 201 0 Case #18: -101 100 Case...
result:
ok 50 lines
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 8ms
memory: 3640kb
input:
50 736 -635197572891798 -244824021659868 # 362794489034032 -677184647696532 # -320348303750089 -495621403120601 . -946880625534191 -143990370594873 # -724662984195181 -114177838293467 . -34955462613239 -896259548370857 . 39793409400074 -634771697162784 # -268086268222123 -741085061218071 . 368751280...
output:
Case #1: Too damaged Case #2: Too damaged Case #3: Too damaged Case #4: Too damaged Case #5: Too damaged Case #6: Too damaged Case #7: Too damaged Case #8: Too damaged Case #9: Too damaged Case #10: Too damaged Case #11: Too damaged Case #12: Too damaged Case #13: Too damaged Case #14: Too damaged C...
result:
wrong answer 1st lines differ - expected: 'Case #1: -402299503129410 237602221737985', found: 'Case #1: Too damaged'