Submission #791498

# Submission time Handle Problem Language Result Execution time Memory
791498 2023-07-24T07:04:22 Z Amylopectin Star Trek (CEOI20_startrek) C++14
7 / 100
14 ms 23928 KB
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <stdlib.h>
using namespace std;
const long long mxn = 1e6 + 10,mo = 1e9 + 7;
struct we
{
    long long to,val[2][2],cur[2],num,ft;
};
vector<struct we> pat[mxn] = {};
long long pid[mxn][2] = {},rwol,stt[mxn][2];
int main()
{
    // freopen("input1.txt","r",stdin);
    long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
    scanf("%lld %lld",&n,&m);
    for(i=1; i<n; i++)
    {
        scanf("%lld %lld",&cn,&cm);
        pid[i][0] = pat[cn].size();
        pid[i][1] = pat[cm].size();
        pat[cn].push_back({cm,{-1,-1},{-1,-1},i,0});
        pat[cm].push_back({cn,{-1,-1},{-1,-1},i,1});
    }
    cva = 4;
    for(i=0; i<63; i++)
    {
        if(i > 0)
            cva *= cva;
        cva %= mo;
        cm = 1;
        cn = cm<<i;
        if((cn & m) > 0)
        {
            su *= cva;
            su %= mo;
        }
    }
    printf("%lld\n",su);
    return 0;
}

Compilation message

startrek.cpp: In function 'int main()':
startrek.cpp:18:17: warning: unused variable 'j' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                 ^
startrek.cpp:18:29: warning: unused variable 'fn' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                             ^~
startrek.cpp:18:32: warning: unused variable 'fm' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                                ^~
startrek.cpp:18:35: warning: unused variable 'cl' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                                   ^~
startrek.cpp:18:38: warning: unused variable 'cr' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                                      ^~
startrek.cpp:18:48: warning: unused variable 'cen' [-Wunused-variable]
   18 |     long long i,j,n,m,cn,cm,fn,fm,cl,cr,su = 1,cen,cva = 0;
      |                                                ^~~
startrek.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     scanf("%lld %lld",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
startrek.cpp:22:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |         scanf("%lld %lld",&cn,&cm);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Incorrect 12 ms 23928 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23704 KB Output is correct
2 Correct 11 ms 23764 KB Output is correct
3 Correct 12 ms 23716 KB Output is correct
4 Correct 14 ms 23704 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23892 KB Output is correct
2 Incorrect 13 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23892 KB Output is correct
2 Incorrect 13 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23892 KB Output is correct
2 Incorrect 13 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23892 KB Output is correct
2 Incorrect 13 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 23892 KB Output is correct
2 Incorrect 13 ms 23796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Incorrect 12 ms 23928 KB Output isn't correct
3 Halted 0 ms 0 KB -