AlteredTree

This commit is contained in:
e2hang
2025-08-12 12:09:53 +08:00
parent ba9ceaab14
commit a2e3b28ac0
8 changed files with 350 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
#include "winnerTree.h"
using namespace std;
int main() {
//输入的时候d反转一下好像没必要哈
deque<int> q;
q.push_back(1);
q.push_back(2);
q.push_back(3);
q.push_back(4);
q.push_back(5);
q.push_back(6);
q.push_back(7);
q.push_back(8);
q.push_back(9);
q.push_back(10);
winnerTree<int> t(q, 10);
t.init();
cout << t.winner() << endl;
t.display();
cout << endl;
t.replay(6, 11);
cout << t.winner() << endl;
t.display();
return 0;
}
/*
非常正确的竞赛树
10
10
10 8
4 10 8 6
4 2 10 9 8 7 6 5
4 3 2 1
11
11
10 11
4 10 8 11
4 2 10 9 8 7 11 5
4 3 2 1
*/