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 1617. Flat Spots

please tell me test № 5
Posted by Yan_Kurganov (Kovrov STA) 9 Nov 2010 02:44
why the wrong answer? please tell me test № 5. sorry for bad english.

Edited by author 09.11.2010 02:45
Re: please tell me test № 5
Posted by Yan_Kurganov (Kovrov STA) 9 Nov 2010 03:37
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int mass[160]={0};
    int n,i,kolvo=0,xz=1;
    cin>>n;
    for (i = 0; i < n; i++) {
        cin>>mass[i];
    }
    sort(&mass[0],&mass[n]);

    for (i = 1; i < n; i++) {
        if (mass[i]==mass[i-1]) {
            xz++;
        }
        if (mass[i]!=mass[i+1]) {
            if (xz/4>=1) {
                kolvo+=xz/4.0;
                xz=1;
            }
        }
    }
    cout<<kolvo;
return 0;
}
Re: please tell me test № 5
Posted by DominatoR 15 Nov 2010 11:04
You can use not only the wheels of the same size