/ Vijos /

记录详情

Compile Error

foo.cc:1:1: error: 'def' does not name a type
    1 | def gcd (x,y):
      | ^~~
foo.cc:3:1: error: expected unqualified-id before 'else'
    3 | else:return x;
      | ^~~~
foo.cc:5:1: error: 'n' does not name a type
    5 | n=0;k=0;i=0;
      | ^
foo.cc:5:5: error: 'k' does not name a type
    5 | n=0;k=0;i=0;
      |     ^
foo.cc:5:9: error: 'i' does not name a type
    5 | n=0;k=0;i=0;
      |         ^
foo.cc:6:1: error: 'ans' does not name a type
    6 | ans=0;
      | ^~~
foo.cc:7:1: error: 'n' does not name a type
    7 | n,k=raw_input().split(' ');
      | ^
foo.cc:8:1: error: 'n' does not name a type
    8 | n=int(n);
      | ^
foo.cc:9:1: error: 'k' does not name a type
    9 | k=int(k);
      | ^
foo.cc:10:1: error: expected unqualified-id before 'if'
   10 | if n%2==1:ans = k**(n/2+1)*n;
      | ^~
foo.cc:11:1: error: expected unqualified-id before 'else'
   11 | else:ans=k**(n/2+1)*(n/2)+k**(n/2)*(n/2);
      | ^~~~
foo.cc:12:1: error: expected unqualified-id before 'for'
   12 | for i in range(1,n+1):ans+=k**(gcd(n,i));
      | ^~~
foo.cc:13:1: error: 'print' does not name a type; did you mean 'int'?
   13 | print ans/(2*n);
      | ^~~~~
      | int
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1566 祖玛游戏
语言
C++
递交时间
2021-12-25 15:55:10
评测时间
2021-12-25 15:55:10
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes