2021 CCPC 桂林站 ADEGIK (持续更新)

本文探讨了两个游戏场景:一是在有向图中,Alice 和 Bob 的策略博弈,涉及最小环的购买与删除;二是关于道路税收问题,计算不同目的地的最少支付。通过贪心算法和二分查找,解决了如何最大化或最小化费用的问题。
摘要由CSDN通过智能技术生成

A

Solution

签到,ban了就让x-1x,总共打满2x-1

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD 1000000007
#define intmax 2147483647
#define memmax 0x7fffffff

ll t;

void solve()
{
    ll n;
    cin >> n;
    cout << 2 * n - 1 << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

	cin >> t;
    while (t--)
        solve();
}

D

Description

JB holds the belief that assumption is all you need to solve a problem. In order to prove that, JB has given you two permutations of numbers from 1 1 1 to n n n: A A A and B B B, and JB wants you to output a sequence of element swapping operation ( x i , y i ) (x_i,y_i) (xi,yi) on A A A, so that:

  1. every pair of swapped element forms an inversion pair (i.e. x i < y i x_i<y_i xi<yi and A x i > A y i A_{x_i}>A_{y_i} Axi>Ayi when the i i i-th operation is being performed)
  2. A A A will become B B B at the end of the swapping sequence.

or determine it is impossible. Help prove JB’s belief by solving this problem!

Input

There are multiple test cases. The first line of the input contains one integer T T T indicating the number of test cases. For each test case:

The first line contains one integer n n n ( 1 ≤ n ≤ 2021 1≤n≤2021 1n2021), indicating the number elements in A A A and B B B.

The second line contains n n n distinct integers A 1 , A 2 , … , A n ( 1 ≤ A i ≤ n ) A_1,A_2,…,A_n (1≤A_i≤n) A1,A2,,An(1Ain), indicating the array A A A.

The third line contains n n n distinct integers B 1 , B 2 , … , B n ( 1 ≤ B i ≤ n ) B_1,B_2,…,B_n (1≤B_i≤n) B1,B2,,Bn(1Bin), indicating the array B B B.

It is guaranteed that the sum of n n n in all test cases will not exceed 2021 2021 2021.

Output

For each test case, if there doesn’t exist a sequence, output the one line containing one integer -1.

Otherwise, in the first line output one integer k ( 0 ≤ k ≤ n ( n − 1 ) 2 ) k (0≤k≤\frac{n(n−1)}{2}) k(0k2n(n1)), indicating the length of the swapping sequence. Then, output k k k line each containing two integers x i x_i xi and y i y_i yi ( 1 ≤ x i < y i ≤ n 1≤x_i<y_i≤n 1xi<yin), indicating the i i i-th operation s w a p ( A x i , A y i ) swap(A_{x_i},A_{y_i}) swap(Axi,Ayi).

Solution

1.n的大小和k的限定都支持一个 O ( n 2 ) O(n^2) O(n2) 的算法。

对此,冒泡和选择都可以。

2.swap细节。

由于题意说明,只允许逆序对进行置换,该题解决定从左到右进行排序。

遍历每一位元素下标i,显然,前i-1位已然有序。

如果该位上a[i]b[i]上的一样,就没有换的必要了;

如果该位上a[i]要比b[i]的小,a[i]前面的已经有序,没有换的必要;由于只能逆序对交换元素,a[i]的后面再怎么换也只能换比a[i]更小的,无解,输出-1

如果该位上a[i]要比b[i]的大,遍历a[i]后面的每一位元素a[j],如果存在小于a[i](符合交换条件)、大于等于b[i](逼近b[i]),则进行交换;

此处解释为什么这样的方法可行:

​ 在进行每一次交换后,a[i]的值势必会渐渐接近b[i]最后等于b[i],而不断地交换也可以使得当前较大的元素最大限度地留在较前的位置(较早地被swap了而不是找到匹配元素再进行交换)。

最后输出即可。

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD 1000000007
#define intmax 2147483647
#define memmax 0x7fffffff

int t;
int n;
int a[2105], b[2105];
vector<pair<int, int> >v;

void solve()
{
    v.clear();

    scanf("%d", &n);
    for(int i=1; i<=n; i++)
        scanf("%d", &a[i]);
    for(int i=1; i<=n; i++)
        scanf("%d", &b[i]);


    // 从前往后构造有序
    for(int i=1; i<=n; i++)
    {
        if(a[i] == b[i])
            continue;
        
        // b[i]比a[i]更大
        // 由于需要用逆序对来置换
        // 无法换到b[i]
        if(a[i] < b[i])
        {
            printf("-1\n");
            return;
        }

        int j = i+1;
        while(a[i] > b[i])
        {
            // 把相对较大的元素换来
            // 由于全排列的唯一性,可以换到b[i]
            if(a[i] > a[j] && a[j] >= b[i])
            {
                v.push_back(make_pair(i, j));
                swap(a[i], a[j]);
            }
            j++;
        }
    }

    int sz = v.size();
    printf("%d\n", sz);
    for(int i=0; i<sz; i++)
        printf("%d %d\n", v[i].first, v[i].second);
}

int main()
{
    scanf("%d", &t);
    while (t--)
    {
        solve();
    }
    
    return 0;
}

E

Description

Alice and Bob are playing a game on a directed graph G G G. There are n n n vertices in G G G, labeled by 1 , 2 , … , n 1,2,…,n 1,2,,n. Initially, there are no edges in G G G. Alice will first buy some direct edges from the shop and then add them into G G G. After that, Bob needs to delete edges until there are no edges in G G G. In a deletion round, Bob can delete a subset of edges S S S from G G G, such that when only keeping edges in S S S, the graph is acyclic. Note that Alice can buy nothing, and in such a case the number of deletion rounds is 0 0 0.

There are m m m edges in the shop. Alice has c c c dollars, so the total price of edges she will buy should not exceed c c c. Alice wants to maximize the number of deletion rounds while Bob wants to minimize it. Both Alice and Bob will play optimally. Please write a program to predict the number of deletion rounds.

Input

The input contains only a single case.

The first line of the input contains three integers n n n, m m m and c c c ( 2 ≤ n ≤ 2000 , 1 ≤ m ≤ 5000 , 1 ≤ c ≤ 1 0 9 2≤n≤2000, 1≤m≤5000, 1≤c≤10^9 2n2000,1m5000,1c109), denoting the number of vertices in G G G, the number of edges in the shop, and how many dollars Alice has.

In the next m m m lines, the i i i-th line ( 1 ≤ i ≤ m ) (1≤i≤m) (1im) contains three integers u i u_i ui, v i v_i vi and p i p_i pi ( 1 ≤ u i , v i ≤ n , u i ≠ v i , 1 ≤ p i ≤ 100000 1≤u_i,v_i≤n, u_i≠v_i, 1≤p_i≤100000 1ui,vin,ui=vi,1pi100000), denoting a directed edge in the shop. Alice can pay p i p_i pi dollars to buy it, and add an edge from vertex u i u_i ui to vertex v i v_i vi in G G G.

Output

Print a single line containing an integer, denoting the number of deletion rounds.

Solution

1.显然,当Alice一条边都买不起的时候,答案为0。

此处不难,可以用遍历边的权重查出。

2.题意写删掉的边的集合中,是不能有环的。也就说,如果Alice买了一个环,Bob需要两次才能删掉。

一次用来破坏环,一次把剩余的边删掉。

3.如果Alice买不起一个环,那么Bob只需要一次就能删掉。

4.因此现在问题变成了:Alice能不能买得起一个环,根据贪心思想,问题也转化为求给出有向边的最小环问题。

此处用的是 D i j s k t r a Dijsktra Dijsktra算法。

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD 1000000007
#define intmax 2147483647
#define memmax 0x7fffffff

int dis[2005][2005];//最短路
bool vis[2005];//vis为真表示已经有确定最短路

struct edge
{
	int next;//编号
   	int to;//指向
   	int weight;//权值

}edge[200005];

int head[200005];//i为起点最后一条边的编号
int cnt = 0;//结构体下标指针

inline void addedge(int u, int v, int w)
{
   	cnt++;//加边
   	//与这个边起点相同的上一条边的编号
   	//若为第一条边,head[u]的值就为0
   	//类似于链表的存储方法
   	edge[cnt].next = head[u];
   	//指向v(终点)
   	edge[cnt].to = v;
   	//权为w(权值)
   	edge[cnt].weight = w;

   	//更新以u为起点上一条边的编号
   	head[u] = cnt;
}

//该node用于堆优化使用
struct node 
{
   	int dis;//最短路
   	int pos;//下标

    node(int a, int b)
    {
        dis = a;
        pos = b;
    }

   	//小顶堆运算符重载(关键)
   	bool operator <(const node& x)const
   	{
   	    return x.dis < dis;//小顶堆
   	}
};


ll n, m, c;

inline void dijsktra(int n, int start)
{
    // 初始化走过的点,点start到所有点的距离为无穷
    memset(vis, false, sizeof(vis));
    for(int i=1; i<=n; i++)
        dis[start][i] = intmax;

    priority_queue<node> q;
    dis[start][start] = 0;
    q.push(node(0, start));

   	while(!q.empty())
   	{
    	node tmp = q.top();
       	q.pop();

       	int x = tmp.pos;//取起点
       	if(vis[x] == true)
        	continue;

       	vis[x] = true;
       	//遍历边
       	for(int i=head[x]; i!=0; i=edge[i].next)
       	{
           	//列举终点
           	int y = edge[i].to;

           	//松弛
           	if(!vis[y] && dis[start][x] + edge[i].weight < dis[start][y])
           	{
               	dis[start][y] = dis[start][x]+edge[i].weight;

               	//确保该点已得到松弛下询问
                q.push((node){dis[start][y], y});

           	}
       	}
   	}
}


void solve()
{
    cin >> n >> m >> c;

    ll minw = intmax;
    for (int i = 1; i <= m; i++)
    {
        ll u, v, w;
        cin >> u >> v >> w;

        minw = min(minw, w);

        addedge(u, v, w);
    }

    // Alice一条边都买不起,输出0
    if (c < minw)
    {
        cout << 0 << endl;
        return;
    }
	
    // 求多源最短路径
    for(int i=1; i<=n; i++)
        dijsktra(n, i);

    int ans = intmax;
	// 求最小环
    for(int i=1; i<=n; i++)
        for(int j=i+1; j<=n; j++)
            // 确保在有路可走的情况下更新
            if(dis[i][j] != intmax && dis[j][i] != intmax)
                ans = min(dis[i][j]+dis[j][i], ans);


    // 可以买最小环,答案为2
    if (c >= ans)
        cout << 2 << endl;
    else
        cout << 1 << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    solve();
}

G

Description

JB is playing a game. There are n n n cities in the game, numbered as 1 , 2 , ⋯ , n 1,2,⋯,n 1,2,,n. The i i i-th city and the j j j-th city are adjacent if and only if i = j − 1 i=j−1 i=j1 or i = j + 1 i=j+1 i=j+1. Initially, some of the cities are occupied by JB.

The game runs in rounds. At the beginning of a round, each occupied city can mark at most one adjacent unoccupied city as the target of attack. At the end of the round, all the attack targets marked become occupied. The game ends when all the cities are occupied.

JB wants to occupy all the cities in minimum rounds. Can you help him?

Input

There are multiple test cases. The first line of the test case contains a positive integer T T T, indicating the number of test cases. For each test case:

The first line contains an integer n ( 1 ≤ n ≤ 1 0 6 ) n (1≤n≤10^6) n(1n106), indicating the number of cities.

The next line contains a string s s s of length n n n. It’s guaranteed s s s only contains 0 and 1. The i i i-th character describes the initial state of the i i i-th city: if s i = ′ 1 ′ s_i= '1' si=1, the i i i-th city is occupied by JB initially. Otherwise, the i i i-th city is not occupied initially.

It’s guaranteed that the sum of n n n over all the test cases doesn’t exceed 1 0 6 10^6 106. It’s also guaranteed that there is at least one 1 in s s s.

Output

For each test case, output one line, containing the minimum number of rounds to occupy all the cities.

Solution

1.该题可以用二分法寻找答案

这里要注意left要取为0而不是1,因为有可能存在全1的情况,此时答案为0。

2.check函数的编写。

枚举几个例子不难看出,对于每一个1,如果左右都有0,那它需要选择先将一边的一个0变成1,然后再两边一起将0变为1。

例子:000100->001100->011110->111111

此处定义一个len=0,如果len为负则表明可以这个长度可以实现,否则不行。

遍历字符串,对于len的操作:

如果遇到了0

​ 就令len++,表明被用1s时间;

如果遇到了1

​ 如果此时len<num,表明此时给定的限定次数没有用完,令len=-num,即初始化len

​ 如果len==num,表明该区间运用了先复制一个1再自动将其他变为1的策略,令len=-max(num-1, 0),意思为后面的区间只能用num-1次,不然就会超出预定时间;

如果len>num,表明超出限定次数,不成立,返回false

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD 1000000007
#define intmax 2147483647
#define memmax 0x7fffffff

ll t;
ll n;
char s[1000005];

// true: num too large
bool check(ll num)
{
    ll len = 0;
    for (int i = 1; i <= n; i++)
    {
        if (s[i] == '0')
        {
            // 每一次遇到0,就消耗一次次数
            len++;
        }
        else // s[i] == '1'
        {
            // 次数没有用完,更新回原始次数
            if (len < num)
                len = -num;

            // 刚好用完次数,也就是占用了先复制一端的机会
            // len需要更新为num-1
            else if (len == num)
                len = -max(num - 1, 0ll);
            // 超过给定次数,num太小了
            else // len > num
                return false;
        }

    }

    // 机会不够用
    if (len > 0)
        return false;
    return true;
}

void solve()
{
    cin >> n;
    cin >> (s + 1);

    // left 有可能为0
    ll left = 0, right = n;
    while (left < right)
    {
        ll mid = left + ((right - left) >> 1);

        if (check(mid))
            right = mid;
        else
            left = mid + 1;
    }
	// 找到第一个够用的长度
    cout << left << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> t;
    for (int i = 1; i <= t; i++)
    {
        solve();
    }
}

I

Description

There are n n n soldiers in JB kingdom, numbered as 1 , 2 , ⋯ , n 1,2,⋯,n 1,2,,n. The i i i-th soldier has a power value of i i i.

There is a tournament in the kingdom now. The soldiers need to be divided into several groups where each soldier belongs to exactly one group. Note that it’s allowed for a group to contain only one single soldier. For some unknown reason, some soldiers have a disease called PTSD (post-traumatic stress disorder). The soldiers with PTSD don’t like being the second strongest soldier in their groups. Formally speaking, a soldier with PTSD will be upset if there is exactly one other soldier with a larger power value than him in his group.

JB, the king of JB kingdom, wants to maximize the sum of the power values of the soldiers who feel upset because of PTSD. You are asked to help him divide the soldiers.

Input

There are multiple test cases. The first line of the input contains a positive integer T T T, indicating the number of test cases. For each test case:

The first line contains an integer n ( 1 ≤ n ≤ 1 0 6 ) n (1≤n≤10^6) n(1n106), indicating the number of soldiers.

The second line contains a string s s s of length n n n. It’s guaranteed that s s s only contains ‘0’ and ‘1’. The 𝑖i-th character describes the i i i-th soldier: If si= '1', the i i i-th soldier has PTSD. Otherwise, the i i i-th soldier doesn’t have PTSD.

It’s guaranteed that the sum of n n n of all test cases doesn’t exceed 1 0 6 10^6 106.

Output

For each test case, output one line containing an integer, indicating the maximum sum of power values of the upset soldiers.

Solution

1.签到题,善用贪心思想

由题意不难看出,最理想的情况是每一个1都有其后面的0形成两两配对,对答案的贡献为1的下标+1,但实际情况不会这么乐观。

由于一个1不会对答案形成什么贡献,但两个1对答案的贡献为第一个1的下标+1。

基于贪心思想,我们要尽可能让下标大的1得到配对,由于配对数是决定的了,所以不会出现若干个小的1配对大于一个大的1配对。

于是策略变为:从后往前遍历字符串,如果该位为1,在该位后面找0,找到0就贡献答案并抹去1和0;不然就找1,一起抹去;都找不到就对答案没有贡献。

2.实现:find函数

Code

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define MOD 1000000007
#define intmax 2147483647
#define memmax 0x7fffffff

ll t;
ll n;
string s;

void solve()
{
    cin >> n >> s;

    ll ans = 0;
    for (int i = n - 1; i >= 0; i--)
    {
        if (s[i] == '1')
        {
            // 找0
            int ind0 = s.find("0", i + 1);
            if (ind0 != s.npos)
            {
                ans += i + 1;
                s[i] = '#';
                s[ind0] = '#';
            }
            // 找1
            else
            {
                int ind1 = s.find("1", i + 1);
                if (ind1 != s.npos)
                {
                    ans += i + 1;
                    s[i] = '#';
                    s[ind1] = '#';
                }
            }
        }
    }

    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> t;
    while (t--)
        solve();
}

K

Description

JB received his driver’s license recently. To celebrate this fact, JB decides to drive to other cities in Byteland. There are n n n cities and m m m bidirectional roads in Byteland, labeled by 1 , 2 , … , n 1,2,…,n 1,2,,n. JB is at the 1-st city, and he can only drive on these m m m roads. It is always possible for JB to reach every city in Byteland.

The length of each road is the same, but they are controlled by different engineering companies. For the i-th edge, it is controlled by the c i c_i ci-th company. If it is the k k k-th time JB drives on an edge controlled by the t t t-th company, JB needs to pay k × w t k×w_t k×wt dollars for tax.

JB is selecting his destination city. Assume the destination is the k k k-th city, he will drive from city 1 1 1 to city k k k along the shortest path, and minimize the total tax when there are multiple shortest paths. Please write a program to help JB calculate the minimum number of dollars he needs to pay for each possible destination.

Input

The input contains only a single case.

The first line of the input contains two integers n n n and m m m ( 2 ≤ n ≤ 50 , n − 1 ≤ m ≤ n ( n − 1 ) 2 2≤n≤50, n−1≤m≤\frac{n(n−1)}{2} 2n50,n1m2n(n1)), denoting the number of cities and the number of bidirectional roads.

The second line contains mm integers w 1 , w 2 , … , w m w_1,w_2,…,w_m w1,w2,,wm ( 1 ≤ w i ≤ 10000 1≤w_i≤10000 1wi10000), denoting the base tax of each company.

In the next m m m lines, the i i i-th line ( 1 ≤ i ≤ m ) (1≤i≤m) (1im) contains three integers u i u_i ui, v i v_i vi and c i c_i ci ( 1 ≤ u i , v i ≤ n , u i ≠ v i , 1 ≤ c i ≤ m 1≤u_i,v_i≤n, u_i≠v_i, 1≤c_i≤m 1ui,vin,ui=vi,1cim), denoting denoting an bidirectional road between the u i u_i ui-th city and the v i v_i vi-th city, controlled by the c i c_i ci-th company.

It is guaranteed that there are at most one road between a pair of city, and it is always possible for JB to drive to every other city.

Output

Print n − 1 n−1 n1 lines, the k k k-th ( 1 ≤ k ≤ n − 1 1≤k≤n−1 1kn1) of which containing an integer, denoting the minimum number of dollars JB needs to pay when the destination is the ( k + 1 ) (k+1) (k+1)-th city.

Solution

BFS

先用一遍BFS,把1到各个点的最短路的长度搜出来。

DFS

判断当前最短路是否为最优解,

判断这条边是不是属于最短路的一条:dis[u]+1 == dis[v]

坑点

无向图要记得加两条边

Code

/*************************************
 * @file_name:      main.cpp.
 * @author:         minamidesi.
 * @time:           2022年-02月-25日. 19:51:45
*************************************/
#include <bits/stdc++.h>
#include <unordered_map>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define itn int
#define memmax 0x7fffffff
#define fi first
#define se second
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define endl '\n'

const ll MOD = 1000000007;
const int intmax = 2147483647;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 1000000000;
const ll ulmax = 4294967295ll;

// OUTPUT
template <class a, class b>
ostream &operator<<(ostream &os, const pair<a, b> &p)
{
    os << "(" << p.first << " " << p.second << ")";
    return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v)
{
    os << "[";
    if (!v.size())
        os << "]";
    else
        for (int i = 0; i < v.size(); ++i)
            os << v[i] << ",]"[i == v.size() - 1];
    return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &s)
{
    os << "{";
    if (!s.size())
        os << "}";
    else
        for (typename set<T>::iterator it = s.begin(); it != s.end(); it++)
            os << *it << ",}"[*it == *s.rbegin()];
    return os;
}

inline ll read()
{
    ll x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - 48;
        ch = getchar();
    }
    return x * f;
}

inline void write(ll x)
{ //快写
    char F[200];
    ll tmp = x > 0 ? x : -x;
    if (x < 0)
        putchar('-');
    ll cnt = 0;
    while (tmp > 0)
    {
        F[cnt++] = tmp % 10 + '0';
        tmp /= 10;
    }
    while (cnt > 0)
        putchar(F[--cnt]);
}

ll n, m;
ll w[10000];

struct edge
{
    ll next, to;
    ll c;
} edge[10005];

ll cnt;
ll head[100];
void addedge(ll u, ll v, ll w)
{
    cnt++;
    edge[cnt].next = head[u];
    edge[cnt].to = v;
    edge[cnt].c = w;
    head[u] = cnt;
}

ll res[100];
ll dis[100];  // 最短路长度
ll k[10000];  // 边经过的次数
ll cost[100]; // 到每个点的花费

void bfs()
{
    for (int i = 1; i <= n; i++)
        dis[i] = intmax;

    queue<ll> q;
    q.push(1);
    dis[1] = 0;

    while (!q.empty())
    {
        ll u = q.front();
        q.pop();

        for (ll i = head[u]; i; i = edge[i].next)
        {
            ll v = edge[i].to;

            if (dis[u] + 1 < dis[v])
            {
                dis[v] = dis[u] + 1;
                q.push(v);
            }
        }
    }
}

void dfs(ll u, ll sum)
{
    // 更新到达该点的最小花费
    cost[u] = min(cost[u], sum);

    for (ll i = head[u]; i; i = edge[i].next)
    {
        ll v = edge[i].to;

        // the path to the shortest
        if (dis[u] + 1 == dis[v])
        {
            // 归属那个国家所管
            k[edge[i].c]++;

            // add the cost to the sum
            dfs(v, sum + k[edge[i].c] * w[edge[i].c]);

            k[edge[i].c]--;
        }
    }
}

void solve()
{
    cin >> n >> m;
    for (int i = 1; i <= m; i++)
    {
        cin >> w[i];
    }
    for (int i = 1; i <= m; i++)
    {
        ll u, v, c;
        cin >> u >> v >> c;
        // 无向图记得加两条边
        addedge(u, v, c);
        addedge(v, u, c);
    }

    bfs(); // 搜出最短路

    for (int i = 1; i <= n; i++)
    {
        cost[i] = intmax;
    }
    // 从最短路中找出最少代价的
    dfs(1, 0);

    // cout << "ans = \n";

    for (int i = 2; i <= n; i++)
    {
        cout << cost[i] << endl;
    }
}

void run_code()
{
    solve();
}

void run_code_with_time()
{
    clock_t start, finish;
    double totaltime;
    start = clock();

    run_code();

    finish = clock();
    totaltime = (double)(finish - start) / CLOCKS_PER_SEC;
    printf("此程序的运行时间为%.36lf秒!\n ", totaltime);
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    //run_code_with_time();

    run_code();

    return 0;
}
  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值