zoukankan      html  css  js  c++  java
  • Codeforces Round #426 (Div. 2)A B C题+赛后小结

      最近比赛有点多,可是好像每场比赛都是被虐,单纯磨砺心态的作用。最近讲的内容也有点多,即便是点到为止很浅显的版块,刷了专题之后的状态还是~"咦,能做,可是并没有把握能A啊"。每场网络赛,我似乎都没用上新学的东西,能用上新学东西的题我A不了...5555555555555555

      这场CF,讲真,打的心态爆炸,首先A题无限WA,赛后看下WA的那组数据是输入有一个999999999的样例,死骗子,说好的数据是1e9呢,哪能有数据是1e10-1,于是用long long,一下子Accept接收不了了吧,这.....B题,水题,不说...C题,我能做,于是噼里啪啦一顿乱敲,还先打了个表感觉美滋滋肯定能A,然后开开心心T了,没想到二分,我好菜啊,然后今天补题时候瞄到一些AC外国友人的round()和cbrt()这种骚操作,学到了,学到了...后面题没看,但讲真,这3题都是那种按理说能A的题,可是,就是因为菜..........55555555555

      今晚还有场,接着打吧,唉~

    题目链接:

    http://codeforces.com/contest/834

                 A. The Useless Toy

    #include <stdio.h>
    #include <stdlib.h>
    #include <cmath>
    #include <string.h>
    #include <iostream>
    #include<algorithm>
    #include <queue>
    #include <vector>
    #include <cmath>
    #include<string>
    #define inf 0x3f3f3f3f
    using namespace std;
    const int maxn=1e5+10;
    #define lrt (rt*2)
    #define rrt  (rt*2+1)
    #define LL long long
    #define inf 0x3f3f3f3f
    #define pi acos(-1.0)
    #define exp 1e-8
    #define For(i,n)  for(int i=0;i<n;i++)
    //************************************************
    char a1[5],a2[5];
    long long n;
    int main()
    {
        scanf("%s%s",a1,a2);
        char s1=a1[0],s2=a2[0];
        scanf("%I64d",&n);
        /*printf("%d %d %d
    ",s1,s2,n);*/
        /*if((s1==118&&s2==94)||(s1==94&&s2==118)||(s1==60&&s2==62)||(s1==62&&s2==60)|| (s1==s2))    puts("undefined");*/
    
            if(s1==118)
            {
                if(s2==60)
                {
                    if(n%4==1)    puts("cw");
                    else if(n%4==3)    puts("ccw");
                    else    puts("undefined");
                }
                else if(s2==62)
                {
                    if(n%4==1)    puts("ccw");
                    else if(n%4==3)    puts("cw");
                    else    puts("undefined");
                }
                else    puts("undefined");
            }
    
            else if(s1==60)
            {
                if(s2==94)
                {
                    if(n%4==1)    puts("cw");
                    else if(n%4==3)    puts("ccw");
                    else    puts("undefined");
                }
                else if(s2==118)
                {
                    if(n%4==1)    puts("ccw");
                    else if(n%4==3)    puts("cw");
                    else    puts("undefined");
                }
                else    puts("undefined");
            }
    
            else if(s1==94)
            {
                if(s2==62)
                {
                    if(n%4==1)    puts("cw");
                    else if(n%4==3)    puts("ccw");
                    else    puts("undefined");
                }
                else if(s2==60)
                {
                    if(n%4==1)    puts("ccw");
                    else if(n%4==3)    puts("cw");
                    else    puts("undefined");
                }
                else    puts("undefined");
            }
    
            else if(s1==62)
            {
                if(s2==118)
                {
                    if(n%4==1)    puts("cw");
                    else if(n%4==3)    puts("ccw");
                    else    puts("undefined");
                }
                else if(s2==94)
                {
                    if(n%4==1)    puts("ccw");
                    else if(n%4==3)    puts("cw");
                    else    puts("undefined");
                }
                else    puts("undefined");
            }
        return 0;
    }

    B. The Festive Evening

    #include <stdio.h>
    #include <stdlib.h>
    #include <cmath>
    #include <string.h>
    #include <iostream>
    #include<algorithm>
    #include <queue>
    #include <vector>
    #include <cmath>
    #include<string>
    #define inf 0x3f3f3f3f
    using namespace std;
    const int maxn=1e6+10;
    #define lrt (rt*2)
    #define rrt  (rt*2+1)
    #define LL long long
    #define inf 0x3f3f3f3f
    #define pi acos(-1.0)
    #define exp 1e-8
    #define For(i,n)  for(int i=0;i<n;i++)
    //************************************************
    int main()
    {
        ios_base::sync_with_stdio(false);
    
        int n, k, len, num=0, a[26], b[26];
        char s[maxn];
        cin >> n >> k>>s;
        len=strlen(s);
        for(int i = 0; i < len; i++)    a[s[i] - 'A']++;
        for(int i = 0; i < len; i++)
        {
            b[s[i] - 'A']++;
            if(b[s[i] - 'A'] == 1)  num++;
            if(num > k)
            {
                puts("YES");
                return 0;
            }
    
            if(a[s[i] - 'A'] == b[s[i] - 'A'])  num--;
        }
        puts("NO");
    
        return 0;
    }

    C. The Meaningless Game

    #include <stdio.h>
    #include <stdlib.h>
    #include <cmath>
    #include <string.h>
    #include <iostream>
    #include<algorithm>
    #include <queue>
    #include <vector>
    #include <cmath>
    #include<string>
    #define inf 0x3f3f3f3f
    using namespace std;
    const long long maxn=1e6;
    #define lrt (rt*2)
    #define rrt  (rt*2+1)
    #define LL long long
    #define inf 0x3f3f3f3f
    #define pi acos(-1.0)
    #define exp 1e-8
    #define For(i,n)  for(int i=0;i<n;i++)
    //************************************************
    LL n,a,b;
    int main()
    {
        ios_base::sync_with_stdio(false);
        cin>>n;
        for(int i=1; i<=n; i++)
        {
            cin>>a>>b;
            bool flag=false;
            LL k=cbrt(a*b),x=a/k,y=b/k;
            if(x*x*y==a&&y*y*x==b)  flag=true;
            if(flag)    puts("YES");
            else    puts("NO");
        }
        return 0;
    }
  • 相关阅读:
    maven工程的目录结构
    集合的区别
    名词解析
    1.(字符串)-判断字符串是否是子集字符串
    1.(字符串)-判断两字符串是否相等
    python max函数技巧
    1.(字符串)-子字符串位置查找
    numpy线性代数np.linalg
    Python图像库PIL 使用
    pyhthon-chr
  • 原文地址:https://www.cnblogs.com/weimeiyuer/p/7264366.html
Copyright © 2011-2022 走看看