标签:can nal scan http 题意 for The cpp ==
题意:给n根火柴,拼出最大的数字。
题解:肯定是数字越多越大,所以尽可能多拿最便宜的2根火柴一个“1”,多余的肯定是拿一个“7”,由于n>=2,没有特例。
void test_case() {
int n;
scanf("%d", &n);
if(n % 2 == 1) {
printf("%d", 7);
n -= 3;
}
while(n) {
printf("%d", 1);
n -= 2;
}
printf("\n");
}
Educational Codeforces Round 81 (Rated for Div. 2)
标签:can nal scan http 题意 for The cpp ==
原文地址:https://www.cnblogs.com/KisekiPurin2019/p/12241986.html