Showing posts with label Code Forces. Show all posts
Showing posts with label Code Forces. Show all posts

Monday, February 1, 2016

Educational Codeforces Round 6

প্রবলেমটি পড়ুন এবং বুঝুন

#include<iostream>
#include<cmath>

using namespace std;

int main()
{
    long int x1,y1,x2,y2;
    while(cin>>x1>>y1>>x2>>y2)
    {
        x2=abs(x2-x1);
        y2=abs(y2-y1);
        if(x2>y2)
            cout<<x2<<endl;
        else
            cout<<y2<<endl;
    }
    return 0;
}

Codeforces Round #341 (Div. 2


প্রবলেমটি পড়ুন এবং বুঝুন


#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
    long int n;
    while(cin>>n)
    {
        long int a[n],b,k=0;
        unsigned long long int sum=0;
        for(int i=0;i<n;i++)
        {
            cin>>b;
            sum+=b;
            if(b%2!=0)
            {
                a[k]=b;
                k++;
            }
        }
        sort(a,a+k);
        if(sum%2!=0)
            sum-=a[0];
        cout<<sum<<endl;
    }
    return 0;
}


Friday, January 29, 2016

Codeforces Round #340 (Div. 2)

প্রবলেমটি পড়ুন এবং বুঝুন 

#include<stdio.h>

int main()
{
    long long int a;
    while((scanf("%lld",&a))==1)
    {
        int remain;
        remain=a%5;
        a=a/5;
        if(remain==0)
            printf("%lld\n",a);
        else
            printf("%lld\n",a+1);
    }
    return 0;
}