QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#511473#4825. Even and Odd CombinationsursusCompile Error//C++14687b2024-08-09 22:30:192024-08-09 22:30:20

Judging History

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

  • [2024-08-09 22:30:20]
  • 评测
  • [2024-08-09 22:30:19]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define int long long

using vec = vector<int>;
using vvec = vector<vec>;
using bvec = vector<bool>;
using pii = pair<int,int>;

#define VECT(T) vector<T>
#define PRINT(vector) for(auto ele : vector) cout << ele << " "; cout << "\n";

constexpr int E9 = 1e9 + 7;

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int t;
  cin >> t;
  while(t--) {
	  int n, k;
	  cin >> n >> k;

	  set<int> s;
	  for(int i = 0 ; i < k ; ++i) {
		  int a; cin >> a;
		  s.insert(a);
	  }
	  if(a.count(1)) a.erase(1);
	  else a.insert(1);

	  for(auto a : s) cout << a << " ";
	  cout << endl;
  }

}

详细

answer.code: In function ‘int main()’:
answer.code:32:14: error: ‘a’ was not declared in this scope
   32 |           if(a.count(1)) a.erase(1);
      |              ^