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 1581. Teamwork

AC 0.031, 108kb
Posted by Luka Bulatovic 26 Aug 2011 00:10
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
    int N;

    scanf("%d", &N);

    int start;
    scanf("%d", &start);

    int sum = 1;

    for(int i = 1; i < N; i++)
    {
        int a;
        scanf("%d", &a);
        if(a == start) { sum++; }
        else
        {
            printf("%d %d ", sum, start);
            start = a;
            sum = 1;
        }
    }

    printf("%d %d ", sum, start);

    return 0;
}
// coding by Luka Bulatovic
Re: AC 0.031, 108kb
Posted by hatred 26 Aug 2011 01:23
and please delete your AC code
Posted by daftcoder [Yaroslavl SU] 26 Aug 2011 12:33
Agree with hatred