374 - Big Mod

All about problems in Volume III. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

374 - Big Mod

Postby @ce » Tue Jun 19, 2012 9:36 pm

Getting RE...plzz help

Code: Select all
Removed       
Last edited by @ce on Sat Dec 22, 2012 8:05 am, edited 1 time in total.
-@ce
User avatar
@ce
Learning poster
 
Posts: 61
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 374 - Big Mod

Postby brianfry713 » Tue Jun 19, 2012 11:14 pm

Always end your code with return 0;
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 374 - Big Mod

Postby @ce » Thu Jun 21, 2012 6:27 pm

Doesn't help...still RE :(
-@ce
User avatar
@ce
Learning poster
 
Posts: 61
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 374 - Big Mod

Postby brianfry713 » Thu Jun 21, 2012 8:46 pm

Try input:
2147483647
2147483647
46340

My AC code returns 13903 in less than 1/1000th of a second.
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 374 - Big Mod

Postby @ce » Sat Dec 22, 2012 8:04 am

Getting WA...test case plzz...anyone

Code: Select all
AC
Last edited by @ce on Sun Dec 30, 2012 7:41 pm, edited 1 time in total.
-@ce
User avatar
@ce
Learning poster
 
Posts: 61
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 374 - Big Mod

Postby brianfry713 » Sat Dec 29, 2012 11:01 pm

Input:
0
0
1

AC output:
0
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 374 - Big Mod

Postby @ce » Sun Dec 30, 2012 7:38 pm

Thanks brianfry713...i got AC.
-@ce
User avatar
@ce
Learning poster
 
Posts: 61
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 374 - Big Mod

Postby gr81 » Wed Jan 30, 2013 8:07 pm

Help.. getting RE, my code is here...http://ideone.com/o1Q6qf
gr81
New poster
 
Posts: 43
Joined: Wed Sep 26, 2012 7:52 pm

Re: 374 - Big Mod

Postby brianfry713 » Wed Jan 30, 2013 11:11 pm

Try input 1 0 1
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 374 - Big Mod

Postby devilreborn » Sun Mar 03, 2013 6:50 am

I am getting WA on this pascal code. Can anybody help?

Code: Select all
var
a,b,c:longint;

function pmod(a,b,c:longint):integer;
var
x:integer;
begin
     if b = 0 then
        pmod := 1 mod c;
     if b = 1 then
        pmod := a mod c;
     if b > 1 then
     begin
          if (b mod 2) = 0 then
          begin
               x := pmod(a,b div 2,c);
               pmod := (x*x) mod c;
          end
          else
              pmod := (pmod(a,b-1,c) * (a mod c)) mod c;
     end;
end;

begin
     readln(a,b,c);
     writeln(pmod(a,b,c));
end.
devilreborn
New poster
 
Posts: 1
Joined: Sun Mar 03, 2013 6:46 am

Re: 374 - Big Mod

Postby brianfry713 » Tue Mar 05, 2013 1:02 am

There are 3 lines in the sample output.
brianfry713
Guru
 
Posts: 1765
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA


Return to Volume III

Who is online

Users browsing this forum: No registered users and 1 guest