Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

why runtime eror
Author: Ali
ID: 055365
Problem: 126
Contest: 0
Date: 2013-08-21 10:39:48

why does judge give me runtime eror??
this is my code:
#include <iostream>
//#include <vector>
//#include <queue>
//#include <algorithm>
//#include <cmath>
using namespace std;

int main()
{
long long int a, b, d, c;
cin >> a >> b;
if(a < b)
{
swap(a, b);
}
if(a % b != 0)
{
cout << "-1" << endl;
return 0;
}
d = a / b;
d ++;
int ans = 0;
while(d > 1)
{
if(d % 2 == 1)
{
cout << "-1" << endl;
return 0;
}
d /= 2;
ans ++;
}
cout << ans << endl;
return 0;
}

see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-22 21:12:22Online Contester Team © 2002 - 2016. All rights reserved.