Help on how to debug this problem

Problem Info

Name of problem:
Cities and States

My Work

#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;

int main()
ifstream fin(“”);
ofstream fout(“citystate.out”);

unordered_map<string, set<int>> cityState;

int N;
fin >> N;

for (int i = 0; i < N; ++i)
	string a, b;
	fin >> a >> b;
	char a1 = a[0];
	char a2 = a[1];
	char b1 = b[0];
	char b2 = b[1];

	string s;


int twoAns = 0;

for (const auto& it : cityState)
	string s;


	for (int element : it.second)
		twoAns += cityState[s].size() - cityState[s].count(element);

int ans = twoAns / 2;

fout << ans;

Add commented code here

Add explanation of code here

## What I've Tried
I've ran it in tests, and it always outputted the right answer in Visual Studio, it's a completely different story when I try to submit this. WHY???????????????????????? Why does it output one thing in Visual Studio but something different in submission? I even decided to use the cout function and the fout function, yet it's always the same thing: 1. When I submit this, it's 0. This has never happened to me before.

## Question
Include a specific question if you have one.

## Checklist
See [How to ask for help on a problem]( for more information.
- Include a link to the problem
- Format your post (especially code blocks)
- Include what you've tried so far
- Add comments to your code
- Read the [debugging module](

How to ask for help on a problem - Announcements - USACO Forum

Link to question: USACO