Submission #987490

# Submission time Handle Problem Language Result Execution time Memory
987490 2024-05-22T20:45:42 Z activedeltorre Semafor (COI20_semafor) C++14
0 / 100
1 ms 348 KB
#include <iostream>

using namespace std;
long long nr1[2300];
long long nr2[2300];
long long nrbiti=10;
long long cif(long long val)
{
    if(val==1)
    {
        return 1;
    }
    else if(val==2)
    {
        return 6;
    }
    else if(val==3)
    {
        return 21;
    }
    else if(val==4)
    {
        return 9;
    }
    else if(val==5)
    {
        return 28;
    }
    else if(val==6)
    {
        return 18;
    }
    else if(val==7)
    {
        return 5;
    }
    else if(val==8)
    {
        return 30;
    }
    else if(val==9)
    {
        return 29;
    }
    else
        return 3;
}
long long getid(long long val)
{
    return cif(val/10)*32+cif(val%10);
}
long long mod=1e9+7;
long long nmax=1023;
struct kuk
{
    long long mat[105][105];
}m1,m2,m3;
long long invs(long long a,long long exp)
{
    long long prod=1;
    while(exp)
    {
        if(exp%2==1)
        {
            prod=(prod*a)%mod;
        }
        exp=exp/2;
        a=(a*a)%mod;
    }
    return prod;
}
long long stbs (long long oper,long long biti)
{
    ///oper+biti-1 luate cate biti
    ///(oper+9)!/9!*(oper-1)!
    long long rasp=1;
    for(long long i=oper+1;i<=oper+9;i++)
    {
        rasp=(rasp*(i%mod))%mod;
    }
    rasp=(rasp*invs(362880,mod-2))%mod;
    return rasp;
}
long long getvalk(long long x,long long oper)
{
    oper=oper-__builtin_popcount(x);
    if(oper<0 || oper%2==1)
    {
        return 0;
    }
    stbs(oper/2,nrbiti);
}
kuk calularemat(long long k)
{
    kuk rasp;
    long long i,j,xouus;
    for(i=0;i<=99;i++)
    {
        for(j=0;j<=99;j++)
        {
            xouus=getid(i)^getid(j);
            rasp.mat[i][j]=getvalk(xouus,k);
        }
    }
    return rasp;
}
signed main()
{
    long long n,i,j,k,l,m,st,val,z;
    cin>>m>>n>>k>>st;
    val=getid(st);
    nr1[val]=1;
    m1=calularemat(k);
 //   m2=calularemat(n%k);
    for(i=0;i<=99;i++)
    {
        cout<<m1.mat[st][i]<<'\n';
    }
    return 0;
}

Compilation message

semafor.cpp: In function 'int main()':
semafor.cpp:109:19: warning: unused variable 'j' [-Wunused-variable]
  109 |     long long n,i,j,k,l,m,st,val,z;
      |                   ^
semafor.cpp:109:23: warning: unused variable 'l' [-Wunused-variable]
  109 |     long long n,i,j,k,l,m,st,val,z;
      |                       ^
semafor.cpp:109:34: warning: unused variable 'z' [-Wunused-variable]
  109 |     long long n,i,j,k,l,m,st,val,z;
      |                                  ^
semafor.cpp: In function 'long long int getvalk(long long int, long long int)':
semafor.cpp:91:9: warning: control reaches end of non-void function [-Wreturn-type]
   91 |     stbs(oper/2,nrbiti);
      |     ~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -