|
| 1 | +//#include "pch.h" |
| 2 | +#include <iostream> |
| 3 | +#include <vector> |
| 4 | +#include <algorithm> |
| 5 | +#include <string> |
| 6 | +#include <chrono> |
| 7 | +//#include <list> |
| 8 | +//#include <iomanip> |
| 9 | +//#include <ratio> |
| 10 | +//#include <ctime> |
| 11 | +//#include <cstdio> |
| 12 | +//#include <set> |
| 13 | +//#include <bitset> |
| 14 | +//#include <map> |
| 15 | +//#include <bits/stdc++.h> |
| 16 | +//#include <typeinfo> |
| 17 | +//#include <deque> |
| 18 | +//#include <stack> |
| 19 | +//#include <queue> |
| 20 | +//#include <sstream> |
| 21 | +//#include <fstream> |
| 22 | +//#include <cmath> |
| 23 | +//#include <unordered_map> |
| 24 | +//#include <unordered_set> |
| 25 | +//#include <cstdlib> |
| 26 | +//#include <numeric> |
| 27 | +/*---------------------------------------*/ |
| 28 | +using namespace std; |
| 29 | +template <typename T> |
| 30 | +void show(vector<T> answer); |
| 31 | +template <typename T> |
| 32 | +void show(vector<vector<T>> answer); |
| 33 | +void show(vector<vector<bool>> answer); |
| 34 | +/*---------------------------------------*/ |
| 35 | + |
| 36 | +/*---------------------------------------*/ |
| 37 | +int main() |
| 38 | +{ |
| 39 | + using namespace std::chrono; |
| 40 | + steady_clock::time_point t_begin = steady_clock::now(); |
| 41 | + /*---------------------------------------*/ |
| 42 | + |
| 43 | + /*---------------------------------------*/ |
| 44 | + steady_clock::time_point t_end = steady_clock::now(); |
| 45 | + duration<double> time_span = duration_cast<duration<double>>(t_end - t_begin); |
| 46 | + cout << endl << "---------------------------------------" << endl; |
| 47 | + cout << "It takes " << time_span.count()*1000 << " ms."; |
| 48 | + return 0; |
| 49 | +} |
| 50 | +/*---------------------------------------*/ |
| 51 | + |
| 52 | +/*---------------------------------------*/ |
| 53 | +void show(vector<vector<bool>> answer) |
| 54 | +{ |
| 55 | + cout << boolalpha; |
| 56 | + for (vector<bool> &i:answer) |
| 57 | + { |
| 58 | + for (bool j:i) |
| 59 | + cout << j << " "; |
| 60 | + cout << endl; |
| 61 | + } |
| 62 | + cout << "---------------------------" << endl; |
| 63 | + cout << noboolalpha; |
| 64 | +} |
| 65 | +template <typename T> |
| 66 | +void show(vector<vector<T>> answer) |
| 67 | +{ |
| 68 | + int answer_size = answer.size(); |
| 69 | + int single_answer_size; |
| 70 | + cout << "-------" << endl; |
| 71 | + for (int i = 0; i < answer_size; ++i) |
| 72 | + { |
| 73 | + single_answer_size = answer.at(i).size(); |
| 74 | + for (int j = 0; j < single_answer_size; ++j) |
| 75 | + cout << answer.at(i).at(j) << " "; |
| 76 | + cout << endl; |
| 77 | + } |
| 78 | + cout << "-------" << endl; |
| 79 | +} |
| 80 | +template <typename T> |
| 81 | +void show(vector<T> answer) |
| 82 | +{ |
| 83 | + cout << "----" << endl; |
| 84 | + int answer_size = answer.size(); |
| 85 | + cout << "size=" << answer.size() << endl |
| 86 | + << "~~~~" << endl; |
| 87 | + for (int i = 0; i < answer_size; ++i) |
| 88 | + cout << answer.at(i) << endl; |
| 89 | + cout << "----" << endl; |
| 90 | +} |
0 commit comments