【UR #5】How to Improve Your IQ

SOL:

   We found that the answer is always 3^(n-1)*4, which is more obvious.

   Because the person who asked the question refused to give us an example, it would be obvious that if the example was given, the conclusion should be very simple.

   All A's are fine.

   

#include<bits/stdc++.h>
#define LL long long
#define mo 998244353
using namespace std;
LL qsm(LL x,LL y){
    static LL anw;
    for (anw=1;y;y>>=1,x=x*x%mo) if (y&1) anw=anw*x%mo;
    return anw;
}
int n;
signed main () {
    scanf("%d",&n);
    printf("%lld\n",4ll*qsm(3,n-1)%mo);
    for (int i=1;i<=n;i++) {
        printf("A 0 0 0 0\n");
    }
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324737741&siteId=291194637