Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- class Program
- {
- static int rounds = int.Parse(Console.ReadLine());
- static int[] roundContent = new int[rounds];
- static int mitkoScore = 0;
- static int vladkoScrore = 0;
- static int allDrinkenBeer = 0;
- // TODO: May tool long for an INT, may become Long;
- static void Main()
- {
- for (int i = 0; i < rounds; i++)
- {
- roundContent[i] = int.Parse(Console.ReadLine());
- }
- for (int i = 0; i < roundContent.Length; i++)
- {
- CountBeers(roundContent[i].ToString());
- }
- //Console.WriteLine(mitkoScore);
- //Console.WriteLine(vladkoScrore);
- if (mitkoScore > vladkoScrore)
- {
- int diff = mitkoScore - vladkoScrore;
- Console.WriteLine("M " + diff);
- }
- else if (vladkoScrore > mitkoScore)
- {
- int diff = vladkoScrore - mitkoScore;
- Console.WriteLine("V " + diff);
- }
- else
- {
- int eq = mitkoScore + vladkoScrore;
- Console.WriteLine("No " + eq);
- }
- }
- static void CountBeers(string drinkingRound)
- {
- int mitkoTemp = 0;
- int vladkoTemp = 0;
- if (drinkingRound.Length % 2 == 0)
- {
- // Mitko's beers
- for (int i = 0; i < drinkingRound.Length / 2; i++)
- {
- mitkoTemp += drinkingRound[i] - '0';
- }
- // Vladko
- for (int i = drinkingRound.Length / 2; i < drinkingRound.Length; i++)
- {
- vladkoTemp += drinkingRound[i] - '0';
- }
- mitkoScore += mitkoTemp;
- vladkoScrore += vladkoTemp;
- }
- else
- {
- // Mitko's beers
- for (int i = 0; i < drinkingRound.Length / 2 + 1; i++)
- {
- mitkoTemp += drinkingRound[i] - '0';
- }
- // Vladko
- for (int i = drinkingRound.Length / 2; i < drinkingRound.Length; i++)
- {
- vladkoTemp += drinkingRound[i] - '0';
- }
- mitkoScore += mitkoTemp;
- vladkoScrore += vladkoTemp;
- }
- // 2 000 000 000
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement