tj
2025-10-05 13:10:30
发布于:福建
3阅读
0回复
0点赞
骗分版本
#include<bits/stdc++.h>
using namespace std;
int main( ) {
cout << "3 1 5 4 2" << endl;
cout << "3 1 5 2 4" << endl;
return 0;
}
正常版本
#include <bits/stdc++.h>
using namespace std;
long long n , t;
const long long N = 10005;
long long cards[N];
int main() {
cin >> n >> t;
for (int i = 0 ; i < n ; i++) {
cin >> cards[i];
}
for (int i = 0 ; i < t ; i++) {
long long l , r;
cin >> l >> r;
sort(cards + l - 1 , cards + r);
for (int j = 0 ; j < n ; j++) {
cout << cards[j] << " ";
}
cout << endl;
}
return 0;
}
这里空空如也


有帮助,赞一个