ACM学习历程—UESTC 1226 Huatuo's Medicine(数学)(2015CCPC L)
生活随笔
收集整理的這篇文章主要介紹了
ACM学习历程—UESTC 1226 Huatuo's Medicine(数学)(2015CCPC L)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
題目鏈接:http://acm.uestc.edu.cn/#/problem/show/1226
題目就是構造一個對稱的串,除了中間的那個只有1個,其余的兩邊都是對稱的兩個,自然答案就是2*n-1。
代碼:
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <algorithm> #include <set> #include <map> #include <queue> #include <string> #define LL long longusing namespace std;int main() {//freopen("test.in", "r", stdin);int n, T;scanf("%d", &T);for (int times = 1; times <= T; ++times){scanf("%d", &n);printf("Case #%d: %d\n", times, 2*n-1);}return 0; } View Code?
轉載于:https://www.cnblogs.com/andyqsmart/p/4997323.html
總結
以上是生活随笔為你收集整理的ACM学习历程—UESTC 1226 Huatuo's Medicine(数学)(2015CCPC L)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用 UIWebView 来播放视频
- 下一篇: Android 进阶 Fragment