I got PE(Presentation Error). I can't understand,why?

General topic about Valladolid Online Judge

Moderator: Board moderators

Post Reply
rajib2k10
New poster
Posts: 4
Joined: Fri Feb 10, 2012 12:02 am

I got PE(Presentation Error). I can't understand,why?

Post by rajib2k10 » Thu May 15, 2014 4:27 pm

Here is my code.

Code: Select all

#include <algorithm>
#include <bitset>
#include <cstring>
#include <cctype>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <string>
#include <set>
#include <stack>
#include <stdio.h>
#include <sstream>
#include <utility>
#include <vector>
#define INT_MAX 2147483647
#define INT_MIN -2147483648
#define pi acos(-1.0)
#define N 1000000
#define LL long long

using namespace std;

int main()
{
    int roads,numbers;
    int i = 1;
    while(1)
    {
        cin>>roads>>numbers;
        if(roads==0 && numbers == 0)
        {
            break;
        }

        if(roads<numbers)
        {
            cout<<"Case "<<i<<": 0\n";
            i++;
            continue;
        }
        double temp = roads - numbers;
        if(temp<numbers && roads>numbers)
        {
            cout<<"Case "<<i<<": 1\n";
            i++;
            continue;
        }
        double answer = temp / numbers;
        if(answer>26)
        {
            cout<<"Case "<<i<<": impossible\n";
        }
        else
            cout<<"Case "<<i<<":"<<ceil(answer)<<"\n";
    i++;
    }
return 0;
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: I got PE(Presentation Error). I can't understand,why?

Post by brianfry713 » Thu May 15, 2014 7:47 pm

What's the problem number?
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “General”