Submission #987462

# Submission time Handle Problem Language Result Execution time Memory
987462 2024-05-22T19:51:42 Z activedeltorre Semafor (COI20_semafor) C++14
0 / 100
74 ms 420 KB
#include <iostream>

using namespace std;
int nr1[1500];
int nr2[1500];
int cif(int 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;
}
int getid(int val)
{
    return cif(val/10)*32+cif(val%10);
}
int main()
{
    int n,i,j,k,l,m,st,val,z;
    cin>>m>>n>>k>>st;
    val=getid(st);
    nr1[val]=1;
    for(i=1;i<=n;i++)
    {
        for(j=0;j<=1023;j++)
        {
            for(z=0;z<=9;z++)
            {
                val=1<<z;
                nr2[j^val]+=nr1[j];
            }
        }
        for(j=0;j<=1023;j++)
        {
            nr1[j]=nr2[j];
        }
    }
    for(i=0;i<=99;i++)
    {
        cout<<i<<" "<<getid(i)<<" "<<nr1[getid(i)]<<'\n';
    }
    return 0;
}

Compilation message

semafor.cpp: In function 'int main()':
semafor.cpp:53:17: warning: unused variable 'l' [-Wunused-variable]
   53 |     int n,i,j,k,l,m,st,val,z;
      |                 ^
# 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 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 74 ms 420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 74 ms 420 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 -