Monday, May 1, 2017

URI Solution 1318 Fake Tickets - Solution in C++ | Ad Hoc

URI Solution 1318 Fake Tickets - Solution in C++ | Ad Hoc


URI Online Judge Solution  Fake Tickets | Ad Hoc
URI Main Problem Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1318

Problem Name: URI Problem 1318 Fake Tickets
Problem Number : URI Problem 1318 Solution
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus

URI Solution 1318 Code in CPP:


#include <cstdio>
#include <cstring>

int array[10001];

int main()
{
    int n, m, t, counter;

    while (scanf("%d %d", &n, &m) && n != 0 && m != 0)
    {
        memset(array, 0, sizeof(array));
        counter = 0;

        for (int i = 0; i < m; ++i)
        {
            scanf("%d", &t);
            array[t]++;
            if (array[t] == 2)
                counter++;
        }

        printf("%d\n", counter);
    }

    return 0;
}

No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.