QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#511475#4825. Even and Odd Combinationsursus0 0ms0kbC++14687b2024-08-09 22:30:512024-08-09 22:30:53

Judging History

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

  • [2024-08-09 22:30:53]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-08-09 22:30:51]
  • 提交

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(s.count(1)) s.erase(1);
	  else s.insert(1);

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

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer on the first run

input:

6
3 0
2 1
1
3 3
1 2 3
3 1
1
3 1
2
3 1
3

output:

1 

2 3 

1 2 
1 3 

input:


output:


result:

wrong answer Integer parameter [name=n] equals to 1, violates the range [3, 3] (test case 1)