This commit is contained in:
Zengtudor 2024-10-25 20:05:13 +08:00
parent 87df2b11c0
commit a6bf42523b
3 changed files with 15 additions and 43222 deletions

View File

@ -19,12 +19,12 @@ std::ostream &operator<<(std::ostream &os, const std::array<T,S> &s){
os<<"array [ ";
if(!s.empty()){
auto now_it = s.begin();
const auto rbegin = s.rbegin();
while(*now_it!=*rbegin){
const auto back_1_it = s.end()-1;
while(now_it!=back_1_it){
os<<*now_it<<", ";
++now_it;
}
os<<*rbegin<<" ]";
os<<*back_1_it<<" ]";
}else{
os<<"}";
}
@ -36,12 +36,13 @@ std::ostream &operator<<(std::ostream &os, const std::set<T> &s){
os<<"set { ";
if(!s.empty()){
auto now_it = s.begin();
const auto rbegin = s.rbegin();
while(*now_it!=*rbegin){
auto back_1_it = s.end();
--back_1_it;
while(now_it!=back_1_it){
os<<*now_it<<", ";
++now_it;
}
os<<*rbegin<<" }";
os<<*back_1_it<<" }";
}else{
os<<"}";
}

View File

@ -1,10 +1,11 @@
#include <functional>
#include <queue>
bool cmp(const int a,const int b){
return a>b;
}
#include <iostream>
#include <random>
int main(){
std::priority_queue<int,std::deque<int>,std::less<int>> q;
std::random_device rd;
std::mt19937 rng(rd());
std::uniform_int_distribution<int> ud(1,10);
for(int i{1};i<=10;i++){
std::cout<<ud(rng)<<'\n';
}
}

43209
test.cpp

File diff suppressed because it is too large Load Diff