2020/11/22 Simulation Tournament

I'm dead

I don’t want to say anything. There are 41 people, including Jiaozuo No. 1 Middle School, Zheng Wai, and Taiyuan No. 5 Middle School. A total of 41 people, with a perfect score of 400, I can get 22 for 20 points. It must be that none of them have a good code. Is playing me. But I still deducted my 28reating value after 22, which is disgusting. Also, when I want to put the question on the csdn, because the PDF file sent by the teacher, if you copy it directly, you can't paste the data.
Among them, "Wonderful Point", "Magic Array", "Choice", and "Average" are not the original questions found on Luogu.
However, according to the teacher who disconnected the internet during our exam, we should be able to search the original questions under the powerful Baidu.
Not much BB

Topic

Insert picture description here
Insert picture description here

Insert picture description here
Insert picture description hereInsert picture description here
None of the four questions were written.

T1

At first glance it is graph theory, so I jumped decisively in order to score.
Finally, when I came back to this question, I felt that it had little to do with the shortest path of graph theory, but there was no time to think about how to write it.

T2

When I look at the data range, I know that it is beyond the scope of my ability. After all, I only started learning in the summer vacation, and I am too good at it. But I have done all sorts of questions, and I have written 20 points with the master. Then see that min(d,k)=0 in 10% of the data; in this case, the answer is the number of all permutations, which should be n*(n-1)*...1, plus a special judgment should be another 10 Points, but I forgot this formula at the time, so in the end there was only 20.

T3

It's a tree and an ancestor, not at all, but I saw 10% of the data except a[1] where a[i] is smaller than a[fa]. I thought I could get 10 points by outputting n-1. It seems that I am too young.

T4

There is no idea at all, and a sample is output, 0 points.

Teacher's solution

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

But I still don’t know how to QAQ

Only T1 finally knocked it out by himself.

#include <bits/stdc++.h>
using namespace std;
long long r[1000100], n, x, y, z, a = 9999999999, ans;
int read() {
    
    
    int num = 0;
    bool flag = 1;
    char c = getchar();
    for (; c < '0' || c > '9'; c = getchar())
        if (c == '-')
            flag = 0;
    for (; c >= '0' && c <= '9'; c = getchar()) num = (num << 1) + (num << 3) + c - '0';
    return flag ? num : -num;
}
int main() {
    
    
    freopen("node.in", "r", stdin);
    freopen("node.out", "w", stdout);
    n = read();
    for (long long i = 1; i < n; i++) {
    
    
        x = read(), y = read(), z = read();
        r[x] = max(r[x], z);
        r[y] = max(r[y], z);
    }
    for (long long i = 1; i <= n; i++)
        if (a > r[i]) {
    
    
            a = r[i];
            ans = i;
        }
    printf("%lld", ans);
    return 0;
}

It was indeed within the scope of ability, but I didn't expect it at the time! When handing in the paper and leaving, the teacher also said that T1 is very watery.
Okay, that's it.

I'm dead QAQ

Guess you like

Origin blog.csdn.net/ydsrwex/article/details/109962092