3 August

Posted greyqz

tags:

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

P1013 进制位

结论:加法必为 \(n-1\) 进制;\((n-1)^1\) 位必为数字 1;\(0+0=0\)

模拟、字符串。

#include <cstdio>
#include <map>
#include <cstring>
using namespace std;

int n, num[11], id[11], tab[11][11];
map<char, int> p;
map<int, char> q;
char s[3];

bool check() 
    for (int i=1; i<n; ++i) for (int j=1; j<n; ++j) 
        if (tab[i][j]!=id[(num[i]+num[j])%(n-1)]) return false;
    return true;


int main() 
    memset(num, -1, sizeof num);
    scanf("%d", &n); scanf("%s", s);
    for (int i=1; i<n; ++i) 
        scanf("%s", s); p[s[0]]=i, q[i]=s[0];
    
    for (int i=1; i<n; ++i) 
        scanf("%s", s); int k=p[s[0]];
        for (int j=1; j<n; ++j) 
            scanf("%s", s);
            if (s[1]) num[id[1]=p[s[0]]]=1, tab[k][j]=p[s[1]];
            else tab[k][j]=p[s[0]];
        
    
    for (int i=1; i<n; ++i) if (tab[i][i]==i) num[id[0]=i]=0;
    int k=1;
    while (tab[id[1]][id[k]]!=id[0]) 
        num[id[k+1]=tab[id[1]][id[k]]]=k+1; ++k;
        if (k>n-1) break;
    
    if (check()) 
        for (int i=1; i<n; ++i) printf("%c=%d ", q[i], num[i]);
        printf("\n%d\n", n-1);
     else printf("ERROR!\n");
    return 0;

以上是关于3 August的主要内容,如果未能解决你的问题,请参考以下文章

Monthly Income Report – August 2016

html Java的工作,august.html

30 August

135 - ZOJ Monthly, August 2014

August 04th 2017 Week 31st Friday

August 30th 2016 Week 36th Tuesday