F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_38930299_8243.cpp:6:31: error: expected ')' before ';' token
    6 | void exgcd(LL a, LL b, LL &d, LL &x,  LL & y, LL MOD) { if (b==0) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, d, y, x, MOD); y -= x * (a / b); } }
      |           ~                   ^
      |                               )
0_0_38930299_8243.cpp:6:32: error: 'd' does not name a type
    6 | void exgcd(LL a, LL b, LL &d, LL &x,  LL & y, LL MOD) { if (b==0) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, d, y, x, MOD); y -= x * (a / b); } }
      |                                ^
0_0_38930299_8243.cpp:6:43: error: 'x' does not name a type
    6 | void exgcd(LL a, LL b, LL &d, LL &x,  LL & y, LL MOD) { if (b==0) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, d, y, x, MOD); y -= x * (a / b); } }
      |                                           ^
0_0_38930299_8243.cpp:6:56: error: 'y' does not name a type
    6 | void exgcd(LL a, LL b, LL &d, LL &x,  LL & y, LL MOD) { if (b==0) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, d, y, x, MOD); y -= x * (a / b); } }
      |                                                        ^
0_0_38930299_8243.cpp: In function 'LL inv(LL, LL)':
0_0_38930299_8243.cpp:7:47: error: too many arguments to function 'void exgcd(LL, LL, LL&)'
    7 | LL inv(LL a, LL MOD) { LL d=0, x=0, y=0; exgcd(a, MOD,  d,  x, y, MOD); return d == 1 ? (x + MOD) % MOD : -1;
      |                                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
0_0_38930299_8243.cpp:6:6: note: declared here
    6 | void exgcd(LL a, LL b, LL &d, LL &x,  LL & y, LL MOD) { if (b==0) { d = a; x = 1; y = 0; } else { exgcd(b, a % b, d, y, x, MOD); y -= x * (a / b); } }
      |      ^~~~~
0_0_38930299_8243.cpp:9:11: error: a function-definition is not allowed here before '{' token
    9 | int main(){
      |           ^
0_0_38930299_8243.cpp:16:2: error: expected '}' at end of input
   16 | }
      |  ^
0_0_38930299_8243.cpp:7:22: note: to match this '{'
    7 | LL inv(LL a, LL MOD) { LL d=0, x=0, y=0; exgcd(a, MOD,  d,  x, y, MOD); return d == 1 ? (x + MOD) % MOD : -1;
      |                      ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-27 05:58:34, Gzip enabled