Embarcadero / Dev-Cpp

A fast, portable, simple, and free C/C++ IDE
https://www.embarcadero.com/free-tools/dev-cpp
GNU General Public License v2.0
2.43k stars 265 forks source link

Return value 4294967295. #290

Open chcrt0x opened 3 months ago

chcrt0x commented 3 months ago

When I compile a program using this code, I return value 4294967295 when I run it, but it can run normally in other OJ compilers.

System: Windows 7 Version: Dev C++ 6.3

C++ Code

#import "bits/stdc++.h"
#define ll long long
#define endl '\n'

using namespace std;

map<string, set<string>> tagToMovies;
map<string, set<string>> movieToTags;
int n, k;
string movieName, tag;

int main() {
    freopen("tag.in", "r", stdin);
    freopen("tag.out", "w", stdout);

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;

    for (int i = 0; i < n; ++i) {
        cin >> movieName >> k;
        for (int j = 0; j < k; ++j) {
            cin >> tag;
            tagToMovies[tag].insert(movieName);
            movieToTags[movieName].insert(tag);
        }
    }

    cout << tagToMovies.size() << endl;

    for (const auto& tag : tagToMovies) {
        cout << tag.first << " " << tag.second.size();
        for (const auto& movie : tag.second) {
            cout << " " << movie;
        }
        cout << endl;
    }

    fclose(stdin);
    fclose(stdout);

    return 0;
}