Summer Camp Day10 Simulation Competition Summary(全英文版)

# Summer Camp Day10 Simulation Competition Summary

Today is Summer Camp Day 10 (Day 114514) friendly third simulation match, - Me too - Happy - (sha) - Fast - (bi) - Hit - * - Score - (too low)

During the competition

I spent an hour and a half debugging the third question, but in the end, for some unknown reason, I couldn’t figure out the BFS. In the end, I even cheated and got 63 points. After thinking hard, although I got a friendly score, I didn’t get a single AC -. It’s really a pity.

Post match summary

I still can’t talk for an hour and a half on one question, otherwise it would be a bit disadvantageous, When encountering a problem, you should first think about the feasibility of the code before writing it, otherwise you will be like me, unable to tune it for 1.5 hours and fly away,话不多说,直接上题解(全网无小号,认准代码后的卬字印,超、防抄伪代码哦!);

T1 Answer to the question

Time limit: 1000ms

Space limit: 65536kB

Given a set [1,2,3,…, n], all its elements share n! Arrange the species.

List all arrangements in order of recruitment size and label them one by one. When n=3, all arrangements are as follows:

1.“123”

2.“132”

3.“213”

4.“231“

5.“312”

6.“321”

Given n and k, return the kth permutation.。

Input format

The first line inputs two integers n and k.

Output format

Output the kth sequence.

Example.Input 1

3 3

Output 1

213

Input 2

4 9

Output 2

2314

Data Range

1<=n <=9

1<=k <=n !

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define int long long
using namespace std;
const int maxx = INT_MAX;
const int minn = INT_MIN;
const int N = 105;
int n, a[N], vis[N], m, ans;
int f(int p)
{
	if (n条件)
	{
		if (ans条件)
		{
			for (int i = 1; i <= n; i++)
			{
			    输出
				ans++;
			}
		}
		ans++;
		return 0;
	}
	for (int i = 1; i <= n; i++)
	{
		if (是不是标记了)
		{
			标记
			a[p] = i;
			搜进去
			回溯
		}
	}
	return 0;
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	DFS进去
	return 0;
} 
//        __   _____
//       / / /  __  \
//      / /  | /   \ |
//     / /   | |   | |
//	  | |    | |   | |
//    | | __ | |   | |
//    | |/ / | |   | |
//    | / /  | |  _| |
//    \__/   | |  \__/
//           | |
//           | |  tomato.卬  
//           \_/

T2 Answer to the question

Time limit: 1000ms

Space limit: 262144kB

Title Description Time

: 1s Space: 256M

Title description:

There are on the number line

N points, numbered as one1 to n。

Xiaoxin has M intervals, which may overlap. Xiaoxin needs to choose

one

M − 1 interval covers as many points as possible. Afterwards, Xiaoxin wants to know the number of uncovered points and the number of unselected intervals. If there are multiple intervals that meet the conditions, output the largest one.

Input format:

The first line contains two integers

n, m。

next

M rows, each row containing two integers

L ,i,R, i

Output format:

Output two integers. The first integer represents the number of the unselected interval. If there are multiple intervals that meet the criteria, output the largest one with the number from

one

Starting from 1; The second number represents the number of uncovered points.

Example 1 Input:

10 4

1 6

4 9

3 4

5 8

Four points were not covered, namely

[seven,eight,nine,ten]

[7,8,9,10];

Do not select thethree

3 intervals, there are

one

One point was not covered, namely

[ten]

[10];

Do not select the

four

4 intervals, there are

one

One point was not covered, namely

[ten]

[10] .

So I don’t choose

three

3 or

four

4 intervals, with the smallest number of points not covered, all are

One

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define int long long
using namespace std;
const int maxx = INT_MAX;
const int minn = INT_MIN;
const int N = 1e5 + 10;
int a[N], b[N];
int l[N], r[N];
int n, m;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> m;
	for (int i = 1; i <= m; i++)
	{
		输入
		差分
	}
	int cnt1 = n;
	for (int i = 1; i <= n; i++)
	{
		前缀和
		差分
	}
	int pos = 0;
	int ret = 114514;
	for (int i = 1; i <= m; i++)
	{
		if (ret大小条件)
		{
			ret = 赋值;
			pos = i;
		}
	}
	输出
	return 0;
} 
//        __   _____
//       / / /  __  \
//      / /  | /   \ |
//     / /   | |   | |
//	  | |    | |   | |
//    | | __ | |   | |
//    | |/ / | |   | |
//    | / /  | |  _| |
//    \__/   | |  \__/
//           | |
//           | |  tomato.卬  
//           \_/

T3
Time limit: 1000ms
Space limit: 262144kB
Title Description
Time: 1s Space: 256M
Title description:
There is one
A map of n × m, with an open space of ‘.’, The high-rise building is’ # ‘, and Xiaoxin’s home is’ S’.
Xiaoxin wants to find a path to exercise, which requires starting from home, not passing through the same open space, and finally returning home. For the purpose of exercising, the length of this path must be at least
four
4. That is to say, except for the endpoint and the starting point both being homes, the number of different open spaces passed through should be at least
three
3.
Xiaoxin wants to know if such a path exists. Of course, Xiaoxin cannot pass through places with high-rise buildings, so there may not be such a path.
Input format:
The first line contains two integers
n,m。
Next includes one
A map of n × m, which only contains’. ‘,’ # ‘,’ Three characters of S’.
Output format:
If there is a path to exercise the body, output ‘Yes’, otherwise output’ No '.
Example 1 Input:
4 4

#.#.
#S#.

Example 1 Output:
Yes
Example 2 Input:
4 4
.#…
#.#.
#S#.

Example 2 Output:
No

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cuchar>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <shared_mutex>
#include <charconv>
#include <filesystem>
using namespace std;
int n, m, t, k, maxx, a, b;
int vis[1000011];
int st;
map<pair<int, int>, char> mp;
int dxs[4] = { 自己推 };
int dys[4] = {  };
void dfs(int x, int y) {
    for (有几个方向) {
        int xx = dxs[i] + x;
        int yy = dys[i] + y; 
         if (是不是到了) {
            cout << "Yes" << endl;
            exit(0);//相当于return 0;
        }
        if (防越界) {
            标记
            mp[{xx, yy}] = '#';
            dfs(xx, yy);
            回溯
        }
    }
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            char x;
            cin >> x;
            mp[{i, j}] = x;
            if (存下起点) {
                a = i; b = j;
                标记障碍
            }
        }
    }
    DFS进去
    cout << "No" << endl;
    return 0;
}
//        __   _____
//       / / /  __  \
//      / /  | /   \ |
//     / /   | |   | |
//	  | |    | |   | |
//    | | __ | |   | |
//    | |/ / | |   | |
//    | / /  | |  _| |
//    \__/   | |  \__/
//           | |
//           | |  tomato.卬  
//           \_/

T4
这个我有点不会了。。。有没有人给我讲一下啊
Time limit: 1000ms
Space limit: 524288kB
Title Description
[Title Description]
Daha is already an adult, and web games were still popular in his time. He has such a game in his memory.
The character starts at position (1,1) in the maze and eventually reaches position (n, n), where there are some obstacles that cannot be walked. At the same time, some points in the maze are colored dots, and the color of the colored dots changes once per second according to the color sequence of this point. After the change, it will cycle again. For example, this colored dot will change like this, “1 2 4”, so it is 1 in the first second, 2 in the second, 4 in the third, and 1 in the fourth second, repeating in sequence. When you reach the colored point, you can choose to walk it directly up as a regular point, or you can choose to teleport it to any colored point that is currently the same color as it, and teleport it without taking time. Daha can walk up, down, left, and right, taking 1 second to complete each step. He can also choose not to move and wait for a second, because maybe after waiting for a second, the next step can be directly teleported. Daha has already learned some algorithms, and he wants to know what is the shortest time to reach (n, n)?
[Input Format]
The first line is an integer n
Next n lines, each containing n integers separated by spaces. Each integer is either 0 or 1, where 0 represents an empty space and 1 represents an obstacle. Ensure that both the starting and ending points are 0
Next line, an integer t representing the number of colored grids
Next, in line t, the first and second integers xi and yi represent the coordinates of this colored grid; The third integer mi represents the color sequence length of the i-th colored grid, followed by mi integers representing the color transformation order of the current colored point
[Output Format]
An integer representing the shortest time to reach the endpoint. If the endpoint cannot be reached, output -1
[Sample Input]
five
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 1 1 1
0 0 1 0 0
three
2 2 3 1 2 3
3 4 5 1 2 1 2 4
5 4 4 5 5 5 4
[Sample Output]
twenty-one

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cuchar>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <shared_mutex>
#include <charconv>
#include <filesystem>
using namespace std;
#define maxn 1145
#define maxt 11
int mp[maxn][maxn];
int mxy[maxn][maxn];
int m[maxt];
int n, t;
pair<int, int> nodem[maxt];
int col[maxt][maxt];
int dis[maxn][maxn];
struct node
{
	int x, y;
};
queue<node>q;
int dir[4][2] = { 1,0,-1,0,0,1,0,-1 };
void bfs()
{
	memset(dis, 0x3f, sizeof(dis));
	q.push({ 1,1 });
	mp[1][1] = 1;
	dis[1][1] = 0;
	while (!q.empty())
	{
		node p = .......;
		q........;
		int x = p.x, y = p.y;
		if (x ...... && y ......) {
			cout << dis[n][n] << endl;
			exit(0);
		}
		int num = .....;
		int ti = ......;
		if (num) {
			for (int k = 0; k <= 114; k++)
			{
				int c = col.....[(......) % .........;
				for (int i = 1; i <= t; i++) {
					if (......)continue;
					if (.........) % m[i]]) {
						if (...........)
						{
							.................... = dis[x][y] + k;
							q.push({ ....................... });
						}

					}
				}
			}

		}
		int xx, yy;
		for (int i = 0; i < 4; i++) {
			xx = x + dir[i][0];
			yy = y + dir[i][1];
			if (....................)continue;
			if (.........................) {
				dis[xx][yy] = dis[x][y] + 1;
				q.push({ xx,yy });
			}
		}
	}
}
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> mp[i][j];
		}
	}
	cin >> t;
	int tx, ty;
	for (int i = 1; i <= t; i++) {
		cin >> tx >> ty;
		nodem[i] = { ......};
		mxy[tx][ty] = ....;
		cin >> m[i];
		for (int j = 1; j <= m[i]; j++) {
			cin >> col[i][j];
		}
		col[i][0] = col[i][m[i]];
	}
	bfs();
	cout << -1 << endl;
}
//        __   _____
//       / / /  __  \
//      / /  | /   \ |
//     / /   | |   | |
//	  | |    | |   | |
//    | | __ | |   | |
//    | |/ / | |   | |
//    | / /  | |  _| |
//    \__/   | |  \__/
//           | |
//           | |  tomato.卬  
//           \_/

创作不易,点占

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值