QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#266992#7738. Equivalent RewritingCruel_moonlightCompile Error//C++98859b2023-11-26 20:50:412023-11-26 20:50:41

Judging History

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

  • [2023-11-26 20:50:41]
  • 评测
  • [2023-11-26 20:50:41]
  • 提交

answer

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

typedef long long LL;
typedef pair<int, int> PII;

void solve() {
	int n, m;
	cin >> n >> m;
	vector<int> a(m + 1);
	vector<int> res(n);
	iota(res.begin(), res.end(), 1);
	int ans = -1;
	for(int i = 0; i < n; i ++ ) {
		int x;
		cin >> x;
		vector<int> b(m + 1);
		bool flag = true;
		for(int j = 0; j < x; j ++ ) {
			int p;
			cin >> p;
			b[p] = 1;
			if(a[p] == 1) {
				flag = false;
			}
		}
		if(flag) {
			ans = i - 1;
		}
		a = b;
	}
	if(ans != -1) {
		cout << "Yes\n";
		swap(res[ans], res[ans + 1]);
		for(int i = 0; i < res.size(); i ++ ) {
			cout << res[i] << " \n"[i == res.size() - 1];
		}
	} else {
		cout << "No\n";
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int _;
	cin >> _;
	while(_ --) {
		solve();
	}
	return 0;
}

詳細信息

answer.code: In function ‘void solve()’:
answer.code:12:9: error: ‘iota’ was not declared in this scope
   12 |         iota(res.begin(), res.end(), 1);
      |         ^~~~
answer.code: In function ‘int main()’:
answer.code:45:17: error: ‘nullptr’ was not declared in this scope
   45 |         cin.tie(nullptr);
      |                 ^~~~~~~