Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- namespace SockMerchant {
- class Program {
- #if LOCAL_JUDGE
- private static readonly StreamWriter writer = new StreamWriter(@"..\..\output");
- private static readonly StreamReader reader = new StreamReader(@"..\..\input");
- #else
- private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
- private static readonly StreamWriter writer = new StreamWriter(@System.Environment.GetEnvironmentVariable("OUTPUT_PATH"), true);
- #endif
- static void Main(string[] args) {
- int n = Next();
- int[] a = new int[101];
- for(int i = 0; i < n; i++) {
- a[Next()]++;
- }
- int result = 0;
- for(int i = 0; i < 101; i++) {
- result += a[i] / 2;
- }
- writer.WriteLine(result);
- writer.Flush();
- writer.Close();
- }
- private static int Next() {
- int c;
- int res = 0;
- do {
- c = reader.Read();
- if(c == -1)
- return res;
- } while(c != '-' && (c < '0' || c > '9'));
- int sign = 1;
- if(c == '-') {
- sign = -1;
- c = reader.Read();
- }
- res = c - '0';
- while(true) {
- c = reader.Read();
- if(c < '0' || c > '9')
- return res * sign;
- res *= 10;
- res += c - '0';
- }
- }
- private static int[] ReadArray(int length) {
- int[] result = new int[length];
- for(int i = 0; i < length; i++) {
- result[i] = Next();
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement