ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1428. Jedi Riddle

WA#52
Posted by Babies 20 Apr 2013 22:56
Hi, i have problem with WA#52, I used long long and test 1 1 32 => accept.
This's my code :
#include <iostream>
using namespace System;
using namespace std;
long long func( long long x , int po );

void main() {

    long long a,b,c,y,k,x,n,m;
    cin>>a>>b>>c;

    k = (c-1)/a;
    m = (c-1)/b;
    x = func( k ,2 );
    y = func( m , 2 );

    printf("%lld\n%lld\n2",x,y);
   system("pause");
}

long long func( long long x , int po ) {
    long long temp=2;
    for( int i=1; i<x; i++ ) {
        temp *= po;
    }
    return temp;
}
Re: WA#52
Posted by Combatcook 16 Oct 2016 19:44
Hi, I had WA 52 too, these tests helped me:
1) 1 1 1
2) 5 10 1

Edited by author 16.10.2016 19:50