Compare commits

...

2 Commits

Author SHA1 Message Date
0b2c5f352e 整数拆段 2020-07-22 10:53:16 +08:00
6953000304 ??? 2020-07-22 10:10:42 +08:00
18 changed files with 190 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1 @@
#

Binary file not shown.

View File

@ -0,0 +1,36 @@
#include <iostream>
using namespace std;
int main()
{
long long a[11],all=0,da[11][11]={0};
char u;
while(cin>>u){
all++;
a[all]=u-'0';
}
// for(int i=1;i<=all;i++){
// cout<<a[i]<<" ";
// }
// cout<<endl;
for(int i=1;i<=all;i++){
for(int j=1;j<=i;j++){
da[i][j]=da[i-1][j]*10+a[i];
// cout<<da[i][j]<<" ";
}
// cout<<endl;
}
long long ans=-1;
for(int i=1;i<=all-3;i++){
for(int j=i+1;j<=all-2;j++){
for(int k=j+1;k<=all-1;k++){
long long now=da[all][k+1]*da[k][j+1]*da[j][i+1]*da[i][1];
// cout<<now<<endl;
if(now<ans||ans==-1){
ans=now;
}
}
}
}
cout<<ans;
return 0;
}

BIN
1670_numcut(zheng)/main.exe Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
2664256234

View File

@ -0,0 +1 @@
321427

View File

@ -0,0 +1 @@
1234

View File

@ -0,0 +1,18 @@
## z:\Chao\src\1670_numcut\test\in.txt
2020/07/22 ÖÜÈý 10:42:07.83
46374912
-----------------------------------------------
Process exited after 180 ms with return value 0
## z:\Chao\src\1670_numcut\test\in2.txt
2020/07/22 ÖÜÈý 10:42:07.83
2268
-----------------------------------------------
Process exited after 90 ms with return value 0
## z:\Chao\src\1670_numcut\test\in3.txt
2020/07/22 ÖÜÈý 10:42:07.83
24
-----------------------------------------------
Process exited after 90 ms with return value 0

3
2807_juxing/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1 @@
#

BIN
2807_juxing/doc/矩形.pdf Normal file

Binary file not shown.

80
2807_juxing/main.cpp Normal file
View File

@ -0,0 +1,80 @@
#include <iostream>
using namespace std;
struct xy {
int x[5], y[5];
} a[2];
int hx(int a, int b)
{
return a < b ? a : b;
}
int hd(int a, int b)
{
return a > b ? a : b;
}
void cfind()
{
for (int i = 1; i <= 4; i++) {
if (a[0].x[i] >= a[1].x[3] && a[0].x[i] <= a[1].x[4]) {
if (a[0].y[i] >= a[1].y[3] && a[0].y[i] <= a[1].y[4]) {
cout << "Y" << endl;
return;
}
}
}
a[1].x[3] = a[1].x[1];
a[1].y[3] = a[1].y[2];
a[1].x[4] = a[1].x[2];
a[1].y[4] = a[1].y[1];
a[0].x[3] = hx(a[0].x[1], a[0].x[2]);
a[0].y[3] = hx(a[0].y[2], a[0].y[1]);
a[0].x[4] = hd(a[0].x[1], a[0].x[2]);
a[0].y[4] = hd(a[0].y[2], a[0].y[1]);
for (int i = 1; i <= 4; i++) {
if (a[1].x[i] >= a[0].x[3] && a[1].x[i] <= a[0].x[4]) {
if (a[1].y[i] >= a[0].y[3] && a[1].y[i] <= a[0].y[4]) {
cout << "Y" << endl;
return;
}
}
}
cout << "N" << endl;
return;
}
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= 2; j++) {
int cx, cy;
cin >> cx >> cy;
a[0].x[j] = cx + 100000;
a[0].y[j] = cy + 100000;
}
a[0].x[3] = a[0].x[1];
a[0].y[3] = a[0].y[2];
a[0].x[4] = a[0].x[2];
a[0].y[4] = a[0].y[1];
for (int j = 1; j <= 2; j++) {
int cx, cy;
cin >> cx >> cy;
a[1].x[j] = cx + 100000;
a[1].y[j] = cy + 100000;
}
a[1].x[3] = hx(a[1].x[1], a[1].x[2]);
a[1].y[3] = hx(a[1].y[2], a[1].y[1]);
a[1].x[4] = hd(a[1].x[1], a[1].x[2]);
a[1].y[4] = hd(a[1].y[2], a[1].y[1]);
// for(int j=1;j<=4;j++){
// cout<<a[0].x[j]<<","<<a[0].y[j]<<endl;
// }
// for(int j=1;j<=4;j++){
// cout<<a[1].x[j]<<","<<a[1].y[j]<<endl;
// }
cfind();
}
return 0;
}

BIN
2807_juxing/main.exe Normal file

Binary file not shown.

3
2807_juxing/test/in.txt Normal file
View File

@ -0,0 +1,3 @@
2
1 1 6 6 4 7 9 2
-1 -1 4 4 1 1 2 2

6
2807_juxing/test/in2.txt Normal file
View File

@ -0,0 +1,6 @@
5
71477 10242 75962 97808 -51719 84770 -24057 -71111
82862 -71566 24935 16323 96922 -20780 37585 -94363
66083 -16416 -96013 -24708 70829 3060 60269 25518
-19043 74452 807 68912 -51897 74823 -13870 -34404
97218 50023 19848 41769 -21715 -44688 62372 91639

6
2807_juxing/test/in3.txt Normal file
View File

@ -0,0 +1,6 @@
5
-68701 -77642 -24308 -95981 -87068 38997 -61304 16257
80136 -73984 -31017 46761 -43215 28021 -73542 45727
16289 14381 -83054 -24610 -10238 15403 19532 -21933
95228 -62011 -6381 51659 -19048 -95222 -52091 -82002
-39644 72117 -8007 -64754 57946 87196 -56253 -25567

30
2807_juxing/test/out.txt Normal file
View File

@ -0,0 +1,30 @@
## z:\Chao\src\2807_juxing\test\in.txt
2020/06/25 ÖÜËÄ 21:38:43.75
Y
Y
-----------------------------------------------
Process exited after 170 ms with return value 0
## z:\Chao\src\2807_juxing\test\in2.txt
2020/06/25 ÖÜËÄ 21:38:43.75
N
Y
N
Y
Y
-----------------------------------------------
Process exited after 100 ms with return value 0
## z:\Chao\src\2807_juxing\test\in3.txt
2020/06/25 ÖÜËÄ 21:38:43.75
N
N
Y
N
Y
-----------------------------------------------
Process exited after 90 ms with return value 0