2020.3.14_Programming Contest 2019

problem_F https://nanti.jisuanke.com/t/43470

这题就是一个算二元一次方程

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
using namespace std;
const long long N = 1e6+10;
typedef long long ll;



int main()
{
    int n,x,k;
    cin >> n;
    for(x = 1; x <= sqrt(n);x++)
    {
        if(n % x == 0 && (n/x - x) % 2 == 0 )
        {
            k = (n/x - x)/2;
            break;
        }
    }
    if(x > sqrt(n))
        cout << "impossible" << endl;
    else
        cout << x+k << " " << k << endl;

    return 0;
}

G. Greetings! https://nanti.jisuanke.com/t/43471

这题就把e双倍输出

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main(){
    string ss;
    cin>>ss;
    for(int i=0;i<ss.length();i++){
        if(ss[i]=='e')
            cout<<'e';
        cout<<ss[i];
    } 
    cout<<endl;
    return 0;
}

猜你喜欢

转载自www.cnblogs.com/aixiaodezsh/p/12518641.html