zoukankan      html  css  js  c++  java
  • Codeforces Round #360 B

    Lovely Palindromes

    题意:给一个n,求第n大的长度为偶数的回文数字

    思路:只考虑回文的前一半数字,因为前面是高位,肯定优先满足高位,第n大是数字就是n,后半部分由回文自动满足得到,所以其实就是正着输出一遍,倒着再输出一遍

    AC代码:

    #include "iostream"
    #include "string.h"
    #include "stack"
    #include "queue"
    #include "string"
    #include "vector"
    #include "set"
    #include "map"
    #include "algorithm"
    #include "stdio.h"
    #include "math.h"
    #pragma comment(linker, "/STACK:102400000,102400000")
    #define ll long long
    #define bug(x) cout<<x<<" "<<"UUUUU"<<endl;
    #define mem(a,x) memset(a,x,sizeof(a))
    #define mp(x,y) make_pair(x,y)
    #define pb(x) push_back(x)
    #define lrt (rt<<1)
    #define rrt (rt<<1|1)
    using namespace std;
    const long long INF = 1e18+1LL;
    const int inf = 1e9+1e8;
    const int N=1e5+100;
    const ll mod=1e9+7;
    
    ///BBBB
    char s[N];
    int main(){
        ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
        cin>>s+1;
        int l=strlen(s+1);
        for(int i=1; i<=l; ++i){
            cout<<s[i];
        }
        for(int i=l; i>=1; --i){
            cout<<s[i];
        }
        return 0;
    }
  • 相关阅读:
    两个不同于LR和jmeter的性能测试工具
    一个基于集成jenkins的测试平台
    sparkR原理
    Python 出现需要使用fPIC重新编译的问题
    eclipse中使用jython
    R中逻辑运算
    R语言的一些笔记
    Distributed R
    R语言和大数据
    Mysql command line
  • 原文地址:https://www.cnblogs.com/max88888888/p/7264975.html
Copyright © 2011-2022 走看看