Compare commits
No commits in common. "1ca2eb288fd5ca11c4a5f7a1b8c028fc97dd3d72" and "2b278cb1d199b22b858fe194d613ac1714a4fa76" have entirely different histories.
1ca2eb288f
...
2b278cb1d1
10
input.txt
10
input.txt
|
@ -1,5 +1,5 @@
|
||||||
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
|
xxx xxx xxx xxx x x x xxx xxx xxx xxx xxx xxx
|
||||||
x x x x x x x x x x x x x x x x x x x x x
|
x x x x x x x x x x x x x x x x x x
|
||||||
xxx x xxx xxx x x xxx xxx xxx xxx xxx xxx xxx x x x xxx x xxx
|
xxx xxx xxx xxx xxx xxx x xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
|
||||||
x x x x x x x x x x x x x x x x x x x
|
x x x x x x x x x x x x x x x x x
|
||||||
xxx x xxx xxx xxx xxx xxx xxx x xxx x xxx
|
xxx xxx xxx xxx x x xxx xxx xxx xxx xxx xxx
|
||||||
|
|
12
maker.cpp
12
maker.cpp
|
@ -35,18 +35,6 @@ int main(){
|
||||||
}
|
}
|
||||||
// cout << endl;
|
// cout << endl;
|
||||||
}
|
}
|
||||||
// for(int i=0;i<12;i++){
|
|
||||||
// if(i<10){
|
|
||||||
// for(int j=0;j<5;j++){
|
|
||||||
// datas[j]+=numbers[i][j];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// for(int j=0;j<5;j++){
|
|
||||||
// datas[j]+=sign[i-10][j];
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
for(int i=0;i<=10;i++){
|
for(int i=0;i<=10;i++){
|
||||||
if(i%2==1){
|
if(i%2==1){
|
||||||
int signx = randn(1,2);
|
int signx = randn(1,2);
|
||||||
|
|
137
solver.cpp
137
solver.cpp
|
@ -1,137 +0,0 @@
|
||||||
#include <bits/stdc++.h>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
string datas[5];
|
|
||||||
int data[5][256];
|
|
||||||
int models[12][5][5]={
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,0,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,0,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,0,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,0,0,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,1,0,1,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,1,0},
|
|
||||||
{0,1,1,1,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,0,0,0,0},
|
|
||||||
{0,0,1,0,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,1,0,0},
|
|
||||||
{0,0,0,0,0}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{0,0,0,0,0},
|
|
||||||
{0,0,0,0,0},
|
|
||||||
{0,1,1,1,0},
|
|
||||||
{0,0,0,0,0},
|
|
||||||
{0,0,0,0,0}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
int rec(int x,int y){
|
|
||||||
for(int i=0;i<5;i++){
|
|
||||||
for(int j=-1;j<=3;j++){
|
|
||||||
if(data[i][x+j] != models[y][i][j+1]) return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
freopen("input.txt","r",stdin);
|
|
||||||
string s = "";
|
|
||||||
for(int i=0;i<5;i++){
|
|
||||||
getline(cin,datas[i]);
|
|
||||||
data[i][0]=0;
|
|
||||||
datas[i]+=" ";
|
|
||||||
}
|
|
||||||
for(int i=0;i<5;i++){
|
|
||||||
for (int j=1;j<=datas[i].size();j++){
|
|
||||||
if(datas[i][j-1] == 'x') data[i][j]=1;
|
|
||||||
else data[i][j]=0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(int i=1;i<=datas[0].size()-4;i++){
|
|
||||||
if(data[0][i] == 0 && data[0][i+1] == 0 && data[0][i+2] == 0){
|
|
||||||
if(rec(i,10)){
|
|
||||||
s+="+";
|
|
||||||
}
|
|
||||||
else if(rec(i,11)){
|
|
||||||
s+="-";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for(int k=0;k<10;k++){
|
|
||||||
if(rec(i,k)){
|
|
||||||
s+=k+'0';
|
|
||||||
i+=2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cout << s;
|
|
||||||
return 0;
|
|
||||||
}
|
|
BIN
solver.exe
BIN
solver.exe
Binary file not shown.
|
@ -1 +1 @@
|
||||||
return 0;
|
c
|
Loading…
Reference in New Issue