QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#860025#9678. 网友小 Z 的树lfxxxCompile Error//C++17528b2025-01-18 09:33:522025-01-18 09:33:53

Judging History

你现在查看的是最新测评结果

  • [2025-01-18 09:33:53]
  • 评测
  • [2025-01-18 09:33:52]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
mt19937 rd(chrono::system_clock::now().time_since_epoch().count());
constexpr int N = 1e6 + 5;
int p[N], fa[N];
int main(){
	freopen("in.txt", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int T = 100, n = 100;
	cout << "0 " << T << '\n';
	while (T--) {
		cout << n << '\n';
		iota(p, p + 1 + n, 0);
		shuffle(p + 1, p + 1 + n, rd);
		for (int i = 2; i <= n; ++i) {
			cout << p[i] << ' ' << p[rd() % (i - 1) + 1] << '\n';
		}
	}
	return 0;
} 

Details

answer.code: In function ‘int main()’:
answer.code:7:16: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         freopen("in.txt", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccycJFC5.o: in function `main':
answer.code:(.text.startup+0x0): multiple definition of `main'; /tmp/ccpPAign.o:implementer.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccpPAign.o: in function `main':
implementer.cpp:(.text.startup+0x3e7): undefined reference to `find_diameter(int, int)'
collect2: error: ld returned 1 exit status