제출 #931555

#제출 시각아이디문제언어결과실행 시간메모리
931555nguyentunglamSimurgh (IOI17_simurgh)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define all(v) v.begin(), v.end() #define endl "\n" #define int long long using namespace std; const int N = 510 + 01; int a[N][N]; //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); mt19937 rng(1417415151); long long rnd(long long l, long long r) { return l + rng() % (r - l + 1); } int u[510], v[510]; int32_t main() { for(int test = 1; test <= 100000; test ++) { cerr << "Test Case #" << test << ":.....\n"; ofstream cout ("task.inp"); int n = rnd(4, 5), m = rnd(1, 4); m = min(m, n * (n - 1) / 2 - n + 1); vector<pair<int, int> > e; map<pair<int, int>, int> dd; for(int i = 1; i < n; i++) { int u = rnd(0, i - 1), v = i; dd[{u, v}] = dd[{v, u}] = i; e.emplace_back(u, v); } while (m--) { int u = rnd(0, n - 1), v = rnd(0, n - 1); while (u == v || dd[{u, v}]) u = rnd(0, n - 1), v = rnd(0, n - 1); e.emplace_back(u, v); dd[{u, v}] = dd[{v, u}] = -1; } shuffle(e.begin(), e.end(), rng); cout << n << " " << e.size() << endl; for(auto &[x, y] : e) cout << x << " " << y << endl; for(int i = 0; i < e.size(); i++) { int u, v; tie(u, v) = e[i]; if (dd[{u, v}] > 0) cout << i << " "; } cout.close(); if (system("grader.exe") == 3) exit(0); // if (system("trau.exe") == 3) exit(0); // if (system ("fc task.out task.ans")) exit(0); } }

컴파일 시 표준 에러 (stderr) 메시지

simurgh.cpp: In function 'int32_t main()':
simurgh.cpp:53:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   53 |     for(int i = 0; i < e.size(); i++) {
      |                    ~~^~~~~~~~~~
/usr/bin/ld: /tmp/ccYOWqh0.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccGFHUV2.o:simurgh.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccYOWqh0.o: in function `main':
grader.cpp:(.text.startup+0x2ef): undefined reference to `find_roads(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status