From f3c31d48a062ce0fe6cd638a309a853ebbcf8a0b Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Sat, 19 Aug 2017 17:28:50 +0800 Subject: [PATCH] Add MUTC 2017 Team 6 --- .../2017/Team 6/1003_Richard_Kiritow.cpp | 48 +++++++++++++++++++ .../2017/Team 6/1011.cpp | 39 +++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 HDOJ/Multi-University Training Contest/2017/Team 6/1003_Richard_Kiritow.cpp create mode 100644 HDOJ/Multi-University Training Contest/2017/Team 6/1011.cpp diff --git a/HDOJ/Multi-University Training Contest/2017/Team 6/1003_Richard_Kiritow.cpp b/HDOJ/Multi-University Training Contest/2017/Team 6/1003_Richard_Kiritow.cpp new file mode 100644 index 0000000..0fc3431 --- /dev/null +++ b/HDOJ/Multi-University Training Contest/2017/Team 6/1003_Richard_Kiritow.cpp @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +bool cmp(const pair A, const pair B) { + if (A.first == B.first) { + return A.second < B.second; + } + else + return A.first > B.first; +} +vector> a; +int main() { + int testcases; + cin >> testcases; + while (testcases--) { + a.clear(); + int n; + cin >> n; + int temp; + for (int i = 1; i <= n; i++) { + cin >> temp; + a.push_back(make_pair(temp,i)); + } + sort(a.begin(),a.end(),cmp); + for (int i = 2; i <= n; i++) { + for (int j = 0; j < n; j++) { + if (a[j].second%i == 0) + continue; + else { + cout << a[j].first; + break; + } + } + if (i != n) + cout << ' '; + } + cout << endl; + } +} \ No newline at end of file diff --git a/HDOJ/Multi-University Training Contest/2017/Team 6/1011.cpp b/HDOJ/Multi-University Training Contest/2017/Team 6/1011.cpp new file mode 100644 index 0000000..22dec69 --- /dev/null +++ b/HDOJ/Multi-University Training Contest/2017/Team 6/1011.cpp @@ -0,0 +1,39 @@ +#include +#include +#include + +#include +using namespace std; + +int main() +{ + int t; + scanf("%d",&t); + while(t--) + { + int n; + scanf("%d",&n); + int maxtotal=-1; + for(int i=0;i