Last active
August 30, 2017 10:38
-
-
Save jason790228/c5e92081928571be6259efa17c090655 to your computer and use it in GitHub Desktop.
488
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <iostream> | |
int main() | |
{ | |
std::string peak_table[10] = | |
{ | |
"", | |
"1\n\n", | |
"1\n22\n1\n\n", | |
"1\n22\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n55555\n4444\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n55555\n666666\n55555\n4444\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n666666\n55555\n4444\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n88888888\n7777777\n666666\n55555\n4444\n333\n22\n1\n\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n88888888\n999999999\n88888888\n7777777\n666666\n55555\n4444\n333\n22\n1\n\n" | |
}; | |
std::string peak_table2[10] = | |
{ | |
"", | |
"1\n", | |
"1\n22\n1\n", | |
"1\n22\n333\n22\n1\n", | |
"1\n22\n333\n4444\n333\n22\n1\n", | |
"1\n22\n333\n4444\n55555\n4444\n333\n22\n1\n", | |
"1\n22\n333\n4444\n55555\n666666\n55555\n4444\n333\n22\n1\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n666666\n55555\n4444\n333\n22\n1\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n88888888\n7777777\n666666\n55555\n4444\n333\n22\n1\n", | |
"1\n22\n333\n4444\n55555\n666666\n7777777\n88888888\n999999999\n88888888\n7777777\n666666\n55555\n4444\n333\n22\n1\n" | |
}; | |
int number(0); | |
std::cin >> number; | |
for (int i = 0; i < number; i++) | |
{ | |
int max_peak(0), number_peak(0); | |
std::cin >> max_peak >> number_peak; | |
for (int j = 0; j < number_peak-1; j++) | |
{ | |
std::cout << peak_table[max_peak]; | |
} | |
(i == (number - 1)) ? std::cout << peak_table2[max_peak] : std::cout << peak_table[max_peak]; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment