← Home
For problem statement at 0-999/200-299/200-209/207/problemD1.txt this is a correct solution, but verifier at 0-999/200-299/200-209/207/verifierD1.go ends with wrong answer on test 2
Input:
77
State Reform Plan
Parliament debates new government policy reforms and national elections.
Generals, ministers, and diplomats hold security briefings.
Expected: 2
Got: 1

exit status 1 can you fix the verifier? package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)
	
	counts := make([]int, 4)
	words := map[string]int{
		"sport": 1, "game": 1, "team": 1, "player": 1, "match": 1, "score": 1, "football": 1, "play": 1, "season": 1, "league": 1, "club": 1,
		"спорт": 1, "игр": 1, "команд": 1, "игрок": 1, "матч": 1, "счет": 1, "футбол": 1, "сезон": 1, "лиг": 1, "клуб": 1,
		"movie": 1, "film": 1, "actor": 1, "director": 1, "cinema": 1, "theatre": 1, "book": 1, "author": 1, "published": 1, "music": 1, "album": 1,
		"фильм": 1, "актер": 1, "режиссер": 1, "кино": 1, "театр": 1, "книг": 1, "автор": 1, "музык": 1, "альбом": 1,
		"art": 1, "history": 1, "war": 1, "army": 1, "battle": 1, "king": 1, "empire": 1, "city": 1, "population": 1, "government": 1, "president": 1,
		"искусств": 1, "истори": 1, "войн": 1, "арми": 1, "битв": 1, "корол": 1, "импери": 1, "город": 1, "населени": 1, "правительств": 1, "президент": 1,

		"space": 2, "planet": 2, "orbit": 2, "earth": 2, "moon": 2, "star": 2, "galaxy": 2, "universe": 2, "solar": 2, "nasa": 2, "mission": 2,
		"космос": 2, "планет": 2, "орбит": 2, "земл": 2, "лун": 2, "звезд": 2, "галактик": 2, "вселенн": 2, "солнц": 2, "наса": 2, "мисси": 2,
		"science": 2, "research": 2, "cell": 2, "dna": 2, "protein": 2, "species": 2, "animal": 2, "plant": 2, "nature": 2, "water": 2, "energy": 2,
		"наук": 2, "исследовани": 2, "клетк": 2, "днк": 2, "белок": 2, "животн": 2, "растени": 2, "природ": 2, "вод": 2, "энерги": 2,
		"computer": 2, "software": 2, "network": 2, "system": 2, "data": 2, "algorithm": 2, "file": 2, "program": 2, "web": 2, "internet": 2,
		"компьютер": 2, "программ": 2, "сет": 2, "систем": 2, "данн": 2, "алгоритм": 2, "файл": 2, "интернет": 2,

		"trade": 3, "price": 3, "market": 3, "company": 3, "stock": 3, "bank": 3, "financial": 3, "business": 3, "money": 3, "cost": 3, "sell": 3, "buy": 3, "percent": 3, "economy": 3, "economic": 3, "growth": 3, "industry": 3, "investment": 3, "investor": 3, "share": 3, "profit": 3, "sales": 3,
		"торговл": 3, "цен": 3, "рынок": 3, "рынк": 3, "компан": 3, "акци": 3, "банк": 3, "финанс": 3, "бизнес": 3, "деньг": 3, "стоимост": 3, "продат": 3, "купит": 3, "процент": 3, "экономик": 3, "рост": 3, "промышленност": 3, "инвестици": 3, "инвестор": 3, "дол": 3, "прибыл": 3, "продаж": 3,
	}

	for scanner.Scan() {
		word := strings.ToLower(scanner.Text())
		for k, v := range words {
			if strings.Contains(word, k) {
				counts[v]++
			}
		}
	}

	ans := 3
	if counts[1] >= counts[2] && counts[1] >= counts[3] {
		ans = 1
	} else if counts[2] >= counts[1] && counts[2] >= counts[3] {
		ans = 2
	}

	fmt.Println(ans)
}