zoukankan      html  css  js  c++  java
  • ACM-ICPC 2018徐州赛区网络预选赛

    A题:Hard to prepare

    待更新


    B题:BE, GE or NE

    待更新


    C题:Cacti Lottery

    待更新


    D题:Easy Math

    待更新


    E题: End Fantasy VIX

    待更新


    F题: Features Track

    T组样例。每组样例输入n,代表有n个frames,编号0~n-1,接下来n行,每行第一个输入k,代表有k个features。每个feature由两个数组成。对于每一个feature只能走连续的frames。问对于所有的feature能走的最长的feature的长度

    用map按照题意模拟,但要注意对于一个frame可能会有多个相同的feature。

     1 #include <bits/stdc++.h>
     2 
     3 using namespace std;
     4 
     5 struct node
     6 {
     7     int x,y;
     8     bool operator < (const node &b) const
     9     {
    10         if(x==b.x)
    11             return y<b.y;
    12         else
    13             return x<b.x;
    14     }
    15 };
    16 int main()
    17 {
    18     map<node,int> m;
    19     int T;
    20     scanf("%d",&T);
    21     vector<int> v[100005];
    22     while(T--)
    23     {
    24         for(int i=0;i<100005;i++)
    25             v[i].clear();
    26         m.clear();
    27         int n;
    28         scanf("%d",&n);
    29         int k;
    30         int cnt = 0;
    31         for(int i=0;i<n;i++)
    32         {
    33             scanf("%d",&k);
    34             for(int j=0;j<k;j++)
    35             {
    36                 node t;
    37                 scanf("%d %d",&t.x,&t.y);
    38                 if(m.find(t)!=m.end())
    39                 {
    40                     int p = m[t];
    41                     v[p].push_back(i);
    42                 }
    43                 else
    44                 {
    45                     m[t] = cnt;
    46                     v[cnt].push_back(i);
    47                     cnt++;
    48                 }
    49             }
    50         }
    51         int ans = 0;
    52         for(int i=0;i<cnt;i++)
    53         {
    54             if(v[i].size()<=ans)
    55                 continue;
    56             int tmp = 1;
    57             for(int j=1;j<v[i].size();j++)
    58             {
    59                 if(v[i][j]==v[i][j-1]+1)
    60                     tmp++;
    61                 else if(v[i][j]==v[i][j-1])
    62                     continue;
    63                 else
    64                 {
    65                     ans = max(ans,tmp);
    66                     tmp = 1;
    67                 }
    68             }
    69             ans = max(ans,tmp);
    70         }
    71         printf("%d
    ",ans);
    72     }
    73 }
    View Code

    G题:Trace

    待更新


    H题:Ryuji doesn't want to study

    如有错误,请指正,感谢!
  • 相关阅读:
    补充下前期的信息收集
    上传到github
    burp添加插件
    github加速
    bestphp's revenge[详解]
    [网鼎杯 2018]Comment
    UNCTF2020
    CTFshow web入门 (php特性)
    CTFshow web入门 (文件包含)
    CTFshow web入门 (爆破)
  • 原文地址:https://www.cnblogs.com/scott527407973/p/9614734.html
Copyright © 2011-2022 走看看