山东大学(威海)程序设计竞赛2020新星赛(线上模拟赛)题解

山东大学(威海)程序设计竞赛2020新星赛(线上模拟赛)题解

factorial(数论,简单模拟)

In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.

输入格式

Input consists of several lines of integer numbers. The first line contains an integer T, which is the number of cases to be tested, followed by T lines, one integer 1 ≤ n ≤ 10000000 on each line.

1≤T≤10

输出格式

The output contains the number of digits in the factorial of the integers appearing in the input.

输入样例

1
2
3
2
10
20

输出样例

1
2
7
19

题目大意

求N的阶乘的位数。看一下题目给的数据范围,不可能求出阶乘的结果再取对数的。那么就直接取对数。因为阶乘就是乘积,所以在对数运算下会直接变成加法。那么答案就显而易见。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <bits/stdc++.h>
using namespace std;

int _;
int main(){
for (scanf("%d",&_);_;_--){
int a;
scanf("%d",&a);
double s = 0;
for (int i = 1;i<=a;++i){
s += log10(i);
}
printf("%d\n",(int) s + 1);
}
return 0;
}

exam(排序算法,模拟)

The final exam is over. In order to give rewards, the teacher should rank the students in the class.

There are N students in the class. This semester, they have learned K courses.

The student number of the i-th student is Xi, and his score of the j-th course is expressed as Aij.

The ranking rules are as follows:

If the scores of two students are different, the first course with different scores will be the basis for ranking, and the one with higher scores will come first.

If the scores of the two students are identical, the one with the smaller student number will come first.

输入格式

The first line contains N, K (N≤1000,K≤10).

In the following N lines, the i-th line contains K+1 integers X**i Ai*1 *Ai2 Ai3 … Ai**k. (X**i<100000,Aij<100000)

Guarantee student number is different.

输出格式

A line contains n integers, which are the student numbers from the first to the last, separated by spaces.

There should be a space after the last number

输入样例

1
2
3
4
5
4 3
1 1 2 3
2 1 3 3
3 2 2 2
4 2 2 3

输出样例

1
4 3 2 1

题目大意

按照给定规则给所有的学生成绩排序。规则是按照两个学生第一个不相同的学科成绩排序,大的在前。如果完全相同就按照学号大小升序排序。

实际上就是改变sort的cmp函数。由于这题使用结构体定义学生的,所以可以直接在结构体内重载小于运算符。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <bits/stdc++.h>
using namespace std;

const int maxn = 1000 + 5;

int n,k;

struct node{
int num;
int sc[15];
bool operator < (const node & b) const{
for (int i = 0;i < k;++i){
if (sc[i] != b.sc[i]){
return sc[i] > b.sc[i];
}
}
return num < b.num;
}
}stu[maxn];

int main(){
scanf("%d%d",&n,&k);
for (int i = 0;i < n;++i){
int nu;scanf("%d",&nu);
stu[i].num = nu;
for (int j = 0;j < k;++j){
scanf("%d",&stu[i].sc[j]);
}
}
sort(stu,stu+n);
for (int i = 0;i < n;++i){
printf("%d ",stu[i].num);
}
return 0;
}

stack(超级水题,模拟)

Xiaoming is learning stack. Stack is a last in, first out data structure. There are only two operations: adding an element to the end of the stack and taking out the end element. Now Xiaoming asks you to help him simulate the operation of the stack.

输入格式

The first line contains an integer n indicating how many operations there are. (N≤100000)

Next N lines, two integers A and B per line. A = 1 means to add B to the tail of the stack, A = 2 means to take out the tail element of B times. (B<100000)

The stack is initially empty. Ensure that elements are not removed from the empty stack.

输出格式

The first line, an integer m, indicates how many elements are left in the stack.

The second line, m integers, lists the m elements from the beginning to the end of the stack, separated by spaces.

输入样例

1
2
3
4
5
6
5
1 2
1 4
2 1
1 3
1 5

输出样例

1
2
3
2 3 5

题目大意

没什么好说的。stack<int>秒过。注意最后要再倒一下输出。我的方法是再开一个栈就行。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <bits/stdc++.h>
using namespace std;

stack<int> st;

int main(){
int n;
scanf("%d",&n);
for (int i = 0;i < n;++i){
int a;scanf("%d",&a);
if (a == 1){
int x;scanf("%d",&x);
st.push(x);
}else{
int x;scanf("%d",&x);
for (int i = 0;i < x;++i){
st.pop();
}
}
}
cout << st.size() << endl;
stack<int> ans;
while (st.size()){
int x = st.top();
ans.push(x);
st.pop();
}
while (ans.size()){
cout << ans.top() << " ";
ans.pop();
}
return 0;
}

Hateful Fat(数论,计算几何)

LCY lost his pen when he was studying, which is really a bad situation, because his eyes have been blocked by his fat. So can you tell him the positional relationship between him and the pencil?

图片 1.png

For given three points p0,p1,p2,

print “ COUNTER_CLOCKWISE” if p0,p1,p2 make a counterclockwise turn (1)

print “ CLOCKWISE” if p0,p1,p2 make a clockwise turn (2),

print “ ONLINE_BACK” if p2 is on a line p2,p0,p1 in this order (3),

print “ ONLINE_FRONT “if p2 is on a line p0,p1,p2 in this order (4),

print “ ON_SEGMENT” if p2 is on a segment p0p1(5).

Input:

In the first line, integer coordinates of p0 and p1 are given.

The next line gives an integer q, which represents the number of queries.

Then, q queries are given for integer coordinates of p2.

Output:

For each query, print the above mentioned status.

Sample Input:

1
2
3
4
5
0 0 2 0
3
-1 1
-1 -1
2 0

Sample Output:

1
2
3
COUNTER_CLOCKWISE
CLOCKWISE
ON_SEGMENT

题目大意

给出P0P1和P0P2两条直线,求在直角坐标系中两条直线的位置关系。计算即可。过程看代码。就是写着写着容易乱……

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <bits/stdc++.h>
using namespace std;

int X0,Y0,X1,Y1,X2,Y2;
int main(){
while (~scanf("%d%d%d%d",&X0,&Y0,&X1,&Y1)){
int xx = X1 - X0;
int yy = Y1 - Y0;
int m;
for (scanf("%d",&m);m;m--){
scanf("%d%d",&X2,&Y2);
int xxx = X2 - X0;
int yyy = Y2 - Y0;
int s = xx * yyy - xxx * yy;
if (s > 0){
cout << "COUNTER_CLOCKWISE\n";
}
else if (s < 0){
cout << "CLOCKWISE\n";
}
else{
if (Y1 == Y0 && Y2 == Y0){
if ((double) xxx / xx < 0)
cout << "ONLINE_BACK\n";
else{
if (abs(xxx) > abs(xx)){
cout << "ONLINE_FRONT\n";
}else{
cout << "ON_SEGMENT\n";
}
}
}
else if (X1 == X0 && X2 == X0){
if ((double) yyy / yy < 0)
cout << "ONLINE_BACK\n";
else{
if (abs(yyy) > abs(yy)){
cout << "ONLINE_FRONT\n";
}else{
cout << "ON_SEGMENT\n";
}
}
}
else{
if ((double) xxx / xx < 0)
cout << "ONLINE_BACK\n";
else{
if (abs(xxx) > abs(xx))
cout << "ONLINE_FRONT\n";
else
cout << "ON_SEGMENT\n";

}
}
}
}
}
return 0;
}

prime(数论,素数筛)

Xiaoming is learning prime number, which is a integer greater than 1 and can only be divided by 1 and itself. Xiao Ming has learned how to judge whether a number is prime. Now, he wants to know how many prime numbers are in [1, N].

输入格式

An integer N.(N<=10000000)

输出格式

An integer represents how many prime numbers are in [1, N].

输入样例

1
10

输出样例

1
4

题目大意

求[1,N]之间的素数个数。看数据范围肯定不能直接求,不然这题还有什么意思……埃氏筛不知道能过嘛(估计能),我用的欧拉筛,稳定输出。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;

const int maxn = 10000000 + 5;
bool prime[maxn];
vector<int> primes;
void make_prime(int n)
{
memset(prime,1,sizeof(prime));
prime[1] = 0;
for (int i = 2;i <= n;i++)
{
if (prime[i])
primes.push_back(i);
for (int p : primes)
{
if (p * i > n)
break;
prime[p * i] = 0;
if (i % p == 0)
break;
}
}
}

int main(){
int n;
scanf("%d",&n);
make_prime(n);
int ans = 0;
for (int i = 1;i <= n;++i){
if (prime[i]){
ans++;
}
}
printf("%d\n",ans);
return 0;
}

lcy‘s weight(高精度)

During the holiday, LCY has been eating snacks, but sometimes he also exercises, so his weight has been changing. At the same time, LCY is an excellent college student, so he records the change of his weight the day before every day. But n days later, he found that he could not know how heavy he was now, but he could remember his weight on the first day as M. So LCY found smart you. I hope you can help him calculate his weight now, so can you help him?

Input

The first line gives two integers, N and M, representing the days lcy experienced and the weight of the first day.(n≤104,m≤1010000)

Then n lines followed.

Each line contains two integers x and y.(y≤1010000)

When x equals 1, it means that LCY’s current weight is y heavier than the previous day.

When x equals 2, it means that LCY’s current weight is y lighter than the previous day.

When x equals 3, it means that LCY’s current weight is y times heavier than the previous day.

Ensure LCY’s weight is always less than 1010000

Output

Output a single line represents the weight after n days of LCY

Input Sample

1
2
3
4
5
4 70
1 3
3 10
2 100
3 10000000000

Output Sample

1
6300000000000

题目大意

高精度加法减法和乘法,不会用java,用不了python,简直噩梦。来个模板,注意,用string会t掉。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
struct bign
{
int len,s[N];
bign() { memset(s,0,sizeof(s)); len=1; }
bign(int num) { *this=num; }
bign(char *num) { *this=num; }
bign operator =(int num)
{
char c[N];
sprintf(c,"%d",num);
*this=c;
return *this;
}
bign operator =(const char *num)
{
len=strlen(num);
for (int i=0;i<len;i++) s[i]=num[len-1-i]-'0';
return *this;
}
string str()
{
string res="";
for (int i=0;i<len;i++) res=(char)(s[i]+'0')+res;
return res;
}
void clean()
{
while (len>1&&!s[len-1]) len--;
}
bign operator +(const bign &b)
{
bign c;
c.len=0;
for (int i=0,g=0;g||i<len||i<b.len;i++)
{
int x=g;
if (i<len) x+=s[i];
if (i<b.len) x+=b.s[i];
c.s[c.len++]=x%10;
g=x/10;
}
return c;
}
bign operator -(const bign &b)
{
bign c;
c.len=0;
int x;
for (int i=0,g=0;i<len;i++)
{
x=s[i]-g;
if (i<b.len) x-=b.s[i];
if (x>=0) g=0;
else{
x+=10;
g=1;
};
c.s[c.len++]=x;
}
c.clean();
return c;
}
bign operator *(const bign &b)
{
bign c;
c.len=len+b.len;
for (int i=0;i<len;i++) for (int j=0;j<b.len;j++) c.s[i+j]+=s[i]*b.s[j];
for (int i=0;i<c.len-1;i++) { c.s[i+1]+=c.s[i]/10; c.s[i]%=10; }
c.clean();
return c;
}
bool operator <(const bign &b)
{
if (len!=b.len) return len<b.len;
for (int i=len-1;i>=0;i--)
if (s[i]!=b.s[i]) return s[i]<b.s[i];
return false;
}
bign operator +=(const bign &b)
{
*this=*this+b;
return *this;
}
bign operator -=(const bign &b)
{
*this=*this-b;
return *this;
}
};
istream& operator >>(istream &in,bign &x)
{
string s;
in>>s;
x=s.c_str();
return in;
}
ostream& operator <<(ostream &out,bign &x)
{
out<<x.str();
return out;
}

int main(){
bign a;
int t;
scanf("%d",&t);
cin >> a;
for (int i = 0;i < t;++i){
int num;bign b;
cin >> num >> b;
if(num == 1){
a += b;
}else if (num == 2){
a -=b;
}else{
a = a * b;
}
}
cout << a << endl;
return 0;
}

附上java的大整数代码(总体来说要比c++快那么一点点)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import java.util.*;
import java.math.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int n;
BigInteger a,b;
n = cin.nextInt();
a = cin.nextBigInteger();
for (int i = 0;i < n;++i) {
int a1;
a1 = cin.nextInt();
b = cin.nextBigInteger();
if (a1 == 1) {
a = a.add(b);
}else if (a1 == 2) {
a = a.subtract(b);
}else if (a1 == 3) {
a = a.multiply(b);
}
}
System.out.println(a);
}
}

Prepare for CET-6(字符串,字典树Trie)

In order to prepare the CET-6 exam, LCY is reciting English words recently. Because he is already very clever, he can only recite n words to get full marks. He is going to memorize K words every day. But he found that if the length of the longest prefix shared by all the strings in that day is a**i, then he could get a**i laziness value. The lazy LCY must hope that the lazier the better, so what is the maximum laziness value he can get?

For example:

The group {RAINBOW, RANK, RANDOM, RANK} has a laziness value of 2 (the longest prefix is ‘RA’).

The group {FIRE, FIREBALL, FIREFIGHTER} has a laziness value of 4 (the longest prefix is ‘FIRE’).

The group {ALLOCATION, PLATE, WORKOUT, BUNDLING} has a laziness value of 0 (the longest prefix is ‘’).

Input

The first line of the input gives the number of test cases, T. T test cases follow. Each test case begins with a line containing the two integers N and K. Then, N lines follow, each containing one of Pip’s strings.

2≤N≤105

2≤KN

Each of Pip’s strings contain at least one character.

Each string consists only of letters from A to Z.

K divides N.

The total number of characters in Pip’s strings across all test cases is at most .

Output

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the maximum sum of scores possible.

Input sample

1
2
3
4
5
6
7
8
9
10
11
12
13
2
2 2
KICK
START
8 2
G
G
GO
GO
GOO
GOO
GOOO
GOOO

Output Sample

1
2
Case #1: 0
Case #2: 10

题目大意

先用字典树求各节点的前缀数目,然后求对K的贡献和即可。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <bits/stdc++.h>
using namespace std;

const int maxn = 1e6 + 5;

string s[maxn];
int tree[maxn][30];
int ans[maxn];
int cnt;

void in(string a){
int u = 0;
for (int i = 0;i < a.size();++i){
int num = a[i] - 'A';
if(!tree[u][num]){
tree[u][num] = ++cnt;
}
ans[tree[u][num]]++;
u = tree[u][num];
}
}

int main(){
int _;
scanf("%d",&_);
for (int i = 1;i <= _;++i){
memset(ans,0,sizeof(ans));
memset(tree,0,sizeof(tree));
cnt = 0;
int n,k;
scanf("%d%d",&n,&k);
for (int i = 1;i <=n;++i){
cin >> s[i];
in(s[i]);
}
int sum = 0;
for (int i = 0;i <= cnt;++i){
sum += ans[i] / k;
}
printf("Case #%d: %d\n",i,sum);
}
return 0;
}

Computer Games(博弈论)

LCY is playing games with his computer at home. Each playing card has two attributes: A**i and B**i, LCY and his computer take turns selecting playing cards,with LCY going first. In each turn, a player can select one card, as long as that playing card either has an A**i greater than each of the all soldiers selected so far, or has a B**i greater than each of the all cards selected so far.

To be precise:

let A**i and B**i be the values for the i-th cards, for i from 1 to N, and let S be the set of cards that have been selected so far. Then a player can select card x if and only if at least one of the following is true:

A**x>A*sfor all *s in S

B**x>B**s for all s in S

If no selection can be made, then the selection process ends and the player with more playing cards win. LCY wants to select more cards and win the game. If both players play optimally to accomplish their goals, can LCY succeed?

输入格式

The first line of each case contains a positive integer N, the number of cards. N more lines follow; the i-th of these line contains two integers Ai and Bi, indicating the values of the i-th cards.(N≤4000,0≤A**i,B*i*≤10000)

输出格式

For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is YES or NO, indicating whether LCY can guarantee that he selects more cards than computer, even if computer plays optimally to prevent this.

Input Sample

1
2
3
4
5
6
7
8
9
10
11
12
13
3
3
10 2
1 10
10 3
3
10 1
10 10
1 10
3
10 2
1 10
4 9

Output Sample

1
2
3
Case #1: NO
Case #2: YES
Case #3: YES

题目大意

1、玩家先手,所以只要保证到电脑拿牌的时候无法再拿的时候就一定赢;

2、无法再拿的条件:当前牌堆中的排的两面都不存在比已拿牌堆中更大的牌;

3、对AI和BI排序,如果存在同一张牌的正反面的次序相同,就一定能赢。

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<climits>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}());
const ll mod=1000000007;
//int rnd(int x) { return mrand() % x;}
//ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int t,n;
struct node{
int x,y;
}a[4010];


int main(){
// freopen("1.in","r",stdin);
// freopen("1.out","w",stdout);
cin>>t;
int ge=1;
while(t--){
cout<<"Case #"<<ge<<": ";
ge++;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i].x>>a[i].y;
}
int maxx = -1,maxy=-1;
int nx=1e4+10,ny=1e4+10;
int ok=0;
while(nx!=maxx&&ny!=maxy){
maxx=nx;
maxy=ny;
for(int i=1;i<=n;i++){
if(a[i].x<maxx&&a[i].y<maxy){
if(nx==maxx){
nx=a[i].x;
}
if(ny==maxy){
ny=a[i].y;
}
nx= max(nx,a[i].x);
ny=max(ny,a[i].y);
}
}
for(int i=1;i<=n;i++){
if(a[i].x==nx&&a[i].y==ny){
ok=1;
break;
}
}
if(ok)break;
}
// cout<<"Case #"<<ge<<": ";
if(ok){
cout<<"YES"<<endl;
}
else cout<<"NO"<<endl;
}
return 0;
}

sort(签到题,排序)

Xiaoming is tired of asking for help. This time he wants to test you.

He gave you N integers. Please find the number with the largest M.

输入格式

The first row has two numbers N, M (0<mn≤1000000).

The second line contains N integers that are different and are all in the interval [- 500000,500000].

输出格式

Output the number of the first M in the order of large to small.

输入样例

1
2
5 3 
3 -35 92 213 -644

输出样例

1
213 92 3

题目大意

降序排序,输出前M个数

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <bits/stdc++.h>
using namespace std;

int a[1000000];

bool cmp(int a,int b){
return a > b;
}

int main(){
int n,m;
scanf("%d%d",&n,&m);
for (int i = 0;i < n;++i){
scanf("%d",&a[i]);
}
sort(a,a+n,cmp);
for (int i = 0;i < m;++i){
printf("%d ",a[i]);
}
return 0;
}

lcy eats biscuits(图的遍历,搜索回溯剪枝)

In order to grow nine abdominal muscles, LCY began to eat all the N biscuits in his room, but LCY didn’t like walking, because walking would cause his abdominal muscles to become smaller.How long does he have to run to get n biscuits. At the beginning, LCY is at (0,0)

Input

The first line is a positive integer N.(N≤14)

Next, there are 2 real numbers in each line, representing the coordinates of the ith biscuits.(−10000≤x**i,y*i*≤10000)

The distance formula between two points is√(x1−x2)2+(y1−y2)2

Output

A number, representing the minimum distance to run, with 2 decimal places reserved.

Input Sample

1
2
3
4
5
4
1 1
1 -1
-1 1
-1 -1

Output Sample

1
7.41

题目大意

从0开始,走完全部的点需要的最少时间。其中距离按照两点之间的距离来算。

暴力搜索是对的。但是要注意两个条件:

1、对于这种两两之间都是可走的就无需建图,直接算会方便的多。

2、注意递归结束条件,根据开始条件的不同而不同。

3、当前的距离已经比之前最小距离大的时候,无需进行下一步运算。(剪枝)

题解

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <bits/stdc++.h>
using namespace std;

const int maxn = 20 + 5;
const int INF = 0x3f3f3f3f;

double x[maxn],y[maxn];
int n;
bool vis[maxn];
double ans = INF;

double cal(int i,int j){
return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}

void dfs(int x,int ss,double sum){
if(ss == n){
ans = min(sum,ans);
return;
}
if(sum >= ans){
return;
}
for (int i = 1;i <= n;++i){
if (!vis[i]){
vis[i] = 1;
dfs(i,ss+1,sum + cal(x,i));
vis[i] = 0;
}
}
}

int main(){
scanf("%d",&n);
for (int i = 1;i <= n;++i){
scanf("%lf%lf",&x[i],&y[i]);
}
x[0] = 0;
y[0] = 0;
vis[0] = 1;
dfs(0,0,0.0);
printf("%.2f\n",ans);
return 0;
}

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×