The 2016 ACM-ICPC Asia Qingdao Regional Contest

Posted ruthank

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The 2016 ACM-ICPC Asia Qingdao Regional Contest相关的知识,希望对你有一定的参考价值。

A - Relic Discovery

签到

#include <cstdio>
using namespace std;
int T,n;
long long ans=0;
int main()
{
    scanf("%d",&T);
    for(int t=1; t<=T; t++)
    {
        scanf("%d",&n);
        ans=0;
        for(int i=1; i<=n; i++)
        {
            int a,b;
            scanf("%d%d",&a,&b);
            ans+=a*b;
        }
        printf("%lld
",ans);
    }
    return 0;
}

  

 

B - Pocket Cube

直接模拟六种转法。

#include <cstdio>

using namespace std;
int T,n;
long long ans=0;
int st[200];
int t[200];

int check()
{
    for (int j = 1; j <= 24; j += 4)
    {
        int i = j+‘a‘-1;
        if (t[i] != t[i+1] || t[i+1] != t[i+2] || t[i+2] != t[i+3]) return 0;
    }
    return 1;
}

int mov(char a, char b, char c, char d, char e, char f, char g, char h)
{
    int k;
    for (int i = 1; i <= 24; i++) t[i+‘a‘-1] = st[i+‘a‘-1];

    for (int i = 1; i <= 2; i++)
        k = t[a], t[a] = t[b], t[b] = t[c], t[c] = t[d], t[d] = t[e], t[e] = t[f], t[f] = t[g], t[g] = t[h], t[h] = k;
    if (check()) return 1;

    for (int i = 1; i <= 24; i++) t[i+‘a‘-1] = st[i+‘a‘-1];
    for (int i = 1; i <= 2; i++)
        k = t[h], t[h] = t[g], t[g] = t[f], t[f] = t[e], t[e] = t[d], t[d] = t[c], t[c] = t[b], t[b] = t[a], t[a] = k;
    if (check()) return 1;
    return 0;
}


int main()
{
    int T;
    scanf("%d", &T);
    for (int ca = 1; ca <= T; ca++)
    {
        for (int i = 1; i <= 24; i++) scanf("%d", &st[i+‘a‘-1]);
        int flag = 0;

        for (int i = 1; i <= 24; i++)
            t[i+‘a‘-1] = st[i+‘a‘-1];
        if (check()) flag = 1;
        if (mov(‘a‘,‘c‘,‘e‘,‘g‘,‘i‘,‘k‘,‘m‘,‘o‘)) flag = 1;
        if (mov(‘q‘,‘s‘,‘g‘,‘h‘,‘x‘,‘v‘,‘n‘,‘m‘)) flag = 1;
        if (mov(‘q‘,‘r‘,‘a‘,‘b‘,‘u‘,‘v‘,‘l‘,‘k‘)) flag = 1;
        if (flag) printf("YES
");
            else printf("NO
");
    }
    return 0;
}

  

C - Pocky

记住ln(2)=0.693147。故ans = ln(L) / ln(d)。

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;


int main()
{
    int t;
    scanf("%d", &t);
    for (int ca = 1; ca <= t; ca++)
    {
        double l, d;
        scanf("%lf%lf", &l, &d);
        if (l <= d) printf("0.000000
");
            else printf("%.6f
", 1+log(l/d));
    }
}

  

D - Lucky Coins

 

 

E - Fibonacci

 

F - Lambda Calculus

 

G - Coding Contest

 

H - Pattern

 

I - Travel Brochure

 

J - Cliques

 

K - Finding Hotels

 

L - Tower Attack

 

M - Generator and Monitor

 

以上是关于The 2016 ACM-ICPC Asia Qingdao Regional Contest的主要内容,如果未能解决你的问题,请参考以下文章

The 2016 ACM-ICPC Asia Qingdao Regional Contest

The 2016 ACM-ICPC Asia Qingdao Regional Contest

World Cup(The 2016 ACM-ICPC Asia China-Final Contest dfs搜索)

Number Theory Problem(The 2016 ACM-ICPC Asia China-Final Contest 找规律)

The 2016 ACM-ICPC Asia Beijing Regional Contest E - What a Ridiculous Election

The 2016 ACM-ICPC Asia China-Final Contest Gym - 101194D Ice Cream Tower