2019icpc Shanghai station a star experience, first impressions DK Code

Since the summer training debut, the experience was okay, the process some trepidation.

At first thought it was an official team warm-up match just over a problem, there is a lot of pressure, is the night before the game know that this is a star team, a little sense of relief. Fortunately, also are playing Star team, or really possible blacksmith, although actually pretty good at half the overall state of our team, whistle or even close to the bronze medal zone, but the game is that everything is possible.
Familiar with the competition process, what to do at each stage, with the first experience, blue vest good hhhh.


The actual race, the feeling is great, pay more attention to the regional tournament title of the analysis of the topic, consideration of thinking, seen in a topic, how it was constructed running, what kind of algorithm to achieve, and we usually in front of a class of topics with labels do feel completely different.


For example, K question, I just do not know what to do with it, has been thinking about search, but do not know how to keep the best in after-effect.

After the game know that this is a bipartite graph, but this semester just to learn mathematics, not learn, no odd ring = bipartite graph!

Card team to conservative estimates more than three hours, get out. After the game I was captain gives bfs built map to find practice (feeling quite excellent), I learned a binary enumeration, wrote O (2 ^ 16 * m) enumeration looking approach. There are harvest it.


E title against magical thinking captain, said that no matter how to get the maximum number of edges of a graph can get a fixed n-1, verify it and found that indeed, come to the largest spanning tree approach, the code board, tune for a while, I did not clear the situation got tot leads to RE (overwrought, my pot, while the contribution of the penalty), it had, in fact, E title design time is not much, right? Feeling more than just 30 minutes? So think of what to do, or even guess, and can be verified, it can not be long yards out.


Problem B is said trie bare title, there is no other sentence is its string prefix, though could not see out the dictionary tree, but fortunately just do not have this (funny) on the board, copy board province of tune, and then discuss and teammates found longest 10 characters can be violent map, each record string, appeared to map to 1, has apparently not repeated, then the current traversal to break down each string substring 0 ~ k takes the position, Up O (10n)? Here I would like to convert to int conversion in addition to 10 and then come back, his teammates say directly consider substr, and then use substr although relatively small, but finally do come out. My teammates nb!

 

Then answer D good guess, the last few minutes of our team crazy to write code constructs, but finally did not adjust well, the lack of time machine, everyone has their own ideas and code, some confusion still did not grasp the time, the idea is not clear .

After the game I make up my D structure, but can not pay OJ, I do not know right.

 

Overall, although the results seem okay surface (in contrast with other teams), but in fact the game is indeed full of luck, I f their strength is not enough to overcome the suppression of all luck, efforts need it! Familiar with the board, mainly think and construction simulation.
Then BDEHK can be supplemented or familiar with it, strings, trees, and.

Code D (uncommitted):

(If I'm wrong and then change structure

 1 #include <bits/stdc++.h>
 2 #define debug(x) cout << #x << ": " << x << endl
 3 using namespace std;
 4 typedef long long ll;
 5 const int MAXN=2e5+7;
 6 const int INF=0x3f3f3f3f;
 7 const int MOD=1e9+7;
 8 
 9 int main()
10 {
11     ios::sync_with_stdio(false);
12     cin.tie(0);
13     int t;
14     cin>>t;
15     for(int i=1,n;i<=t;++i)
16     {
17         cin>>n;
18         cout<<"Case #"<<i<<": "<<n/2<<endl;
19         for(int j=1;j<=n/2;++j)
20         {
21             int t=j;
22             for(int k=1;k<=n-1;++k)
23             {
24                 int tmp=(k+j)%n ? (k+j)%n : n;
25                 cout<<k<<' '<<tmp<<endl;
26             }
27         }
28     }
29     return 0;
30 }

 

K-codes

(Uncommitted, you should feel it?):

#include <bits/stdc++.h>
#define debug(x) cout << #x << ": " << x << endl
using namespace std;
typedef long long ll;
const int MAXN=3e2+7;
const int INF=0x3f3f3f3f;
const int MOD=1e9+7;

struct edge
{
    int x,y;
}e[MAXN];

int vis[21];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
     Int T; 
    CIN >> T;
     int kase = . 1 ;
     the while (T-- ) 
    { 
        int n-, m; 
        CIN >> >> n- m;
         for ( int I = 0 ; I <m; ++ I) 
        { 
            CIN >> E [I] .x >> E [I] .y; 
            E [I] .x -; // facilitate left station 1 i.e. the least significant bit representing a binary 0 <<. 1; 
            E [I] .y-- ; 
        } 
        int ANS = 0 ;
         for ( int I =0 ; I <( . 1 << n-); I ++) // binary enum 
        {
             // Debug (I); 
            int tmp = 0 ;
             for ( int J = 0 ; J <m; ++ J) 
            { 
                int = I & T1 ( . 1 << e [j] .x); // Take the first e [j] .x bit 
                int T2 & I = ( . 1 << E [J] .y);  
                 // Debug (T1);
                 / / Debug (T2); 
                IF ((T1 == 0 && T2) || (T2 == 0 && T1))   // a 0, a non-zero, indicating that belong to different sets, even the edges
                    tmp++;
            }
           // debug(tmp);
            ans=max(ans,tmp);
            //cout<<endl;
        }
        cout<<"Csse #"<<kase++<<": "<<ans<<endl;
    }
    return 0;
}

 

Guess you like

Origin www.cnblogs.com/Zzqf/p/11939266.html