QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#706933#8835. Goodmanjiujiu#WA 1ms3648kbC++20658b2024-11-03 14:01:532024-11-03 14:01:54

Judging History

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

  • [2024-11-03 14:01:54]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3648kb
  • [2024-11-03 14:01:53]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()

void sovle(){
	int n;
	std::cin >> n;
	std::vector<std::pair<int, int>> p(n + 1);
	for(int i = 1; i <= n; i++){
		std::cin >> p[i].first;
		p[i].second = i;
	}
	std::sort(all(p), [&](auto a, auto b){
		return std::min(a.first, a.second) < std::min(b.first, b.second);
	});
	for(int i = 1; i <= n; i++){
		std::cout << p[i].first << " \n"[i == n];
	}

}

signed main(){
    std::ios::sync_with_stdio(false),std::cin.tie(0),std::cout.tie(0);
    int _ = 1;
    std::cin >> _;
    while(_--){
        sovle();
    }
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3528kb

input:

2
4
1 2 3 4
6
6 5 4 3 2 1

output:

1 2 3 4
6 1 5 2 4 3

result:

ok Correct (2 test cases)

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3648kb

input:

873
6
1 5 2 4 6 3
6
5 1 6 4 3 2
4
1 4 3 2
6
2 1 6 5 4 3
6
4 5 1 3 6 2
6
6 2 1 5 4 3
5
1 5 4 3 2
6
1 2 6 3 5 4
4
2 1 3 4
6
1 6 4 2 3 5
6
6 1 3 5 2 4
6
2 1 4 5 3 6
6
3 4 1 5 2 6
6
4 1 5 2 6 3
6
5 2 1 4 6 3
6
4 1 6 2 3 5
6
5 1 3 4 6 2
6
6 2 5 4 1 3
6
6 2 5 1 4 3
6
5 2 3 6 4 1
6
6 1 2 5 4 3
6
2 3 4 6 1 ...

output:

1 5 2 3 4 6
5 1 2 6 3 4
1 4 2 3
2 1 6 3 5 4
4 1 5 2 3 6
6 1 2 3 5 4
1 5 2 4 3
1 2 6 3 4 5
2 1 3 4
1 6 2 4 3 5
6 1 2 3 5 4
2 1 4 3 5 6
3 1 4 2 5 6
4 1 2 5 3 6
5 1 2 3 4 6
4 1 2 6 3 5
5 1 2 3 4 6
6 1 2 5 3 4
6 1 2 5 3 4
5 1 2 3 6 4
6 1 2 3 5 4
2 1 3 4 6 5
5 1 6 2 3 4
4 1 2 6 3 5
4 1 3 2 5 6
3 1 2 6 4 ...

result:

wrong answer Jury found better answer than participant (test case 1)