Monday, 18 June 2012

UVa 12468 - Zapping Solution

#include<iostream>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>

using namespace std;
int main()
{
    long long a,b,c,d,ans;
    while(cin>>a>>b)
    {
        if(a==-1 && b==-1)  break;

        c=abs(a-b);
        if(c>=50)
        c=100-c;
        cout<<c<<endl;

    }
return 0;
}

No comments:

Post a Comment