2022牛客寒假算法基础集训营4

Posted by zhangmh on 2022-02-10
Estimated Reading Time 1 Minutes
Words 195 In Total
Viewed Times

这次比赛整体难度不是太高,but本蒟蒻依然不太行QAQ,补题顺序按照难度顺序(大概)

这场比赛好多奇奇怪怪的图片欸

E - 真假签到题

img

看上去题面很是简洁,但是直接抄函数代码是不行的,注意x范围。

思路: 1e18函数递归必炸,但是可以打表找规律得出,f(x)=x。

AC代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define INF 0x3f3f3f3f
//判断是否需要开ll!!!
//判断是否需要初始化!!!
const int mod=1e9+7;
ll x;

int main()
{
// freopen("test.in","r",stdin);
// freopen("output.in", "w", stdout);
cin>>x;
cout<<x<<'\n';
return 0;
}


If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !