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 1025. Democracy in Danger

Why WA5?
Posted by Michael Hranik(VNTU) 4 Oct 2009 18:29
#include <iostream>

using namespace std;

int main()
{
    int a[101];
    int k;
    cin>>k;
    for (int i=0; i<k; i++)
    {
        cin>>a[i];
    }
    for (int i=0; i<k; i++)
    {
        int q=i;
        int min=a[i];
        for (int j=i+1; j<k; j++ )
            if (a[j]<a[i])
            {
                q=j;
                min=a[j];
            }
        if (q!=i)
        {
            int tmp=a[i];
            a[i]=a[q];
            a[q]=tmp;
        }
    }
    long long s=0;
    for (int i=0; i<=(k/2); i++)
        s=s+((a[i]/2)+1);
    cout<<s<<endl;
    return 0;
}
Re: Why WA5?
Posted by Michael Hranik(VNTU) 4 Oct 2009 18:36
Excuse me please, but I've already got AC. So I don't need your answers.
Re: Why WA5?
Posted by gekannt 19 Aug 2012 23:19
good for you