
找规律
幽殇默
他时若遂凌云志,敢笑黄巢不丈夫。
展开
-
C. K-th Not Divisible by n【1200 / 思维 找规律】
https://codeforces.com/problemset/problem/1352/C #include<bits/stdc++.h> using namespace std; typedef long long int LL; int main(void) { int t; cin>>t; while(t--) { LL n,k; cin>>n>>k; LL a=k%(n-1); if(!a) a=n-1; LL b=k/(.原创 2021-10-23 23:05:19 · 146 阅读 · 0 评论 -
A. Filling Shapes【1000 / 找规律】
https://codeforces.com/problemset/problem/1182/A #include<bits/stdc++.h> using namespace std; int main(void) { int n; cin>>n; if(n&1) puts("0"); else { int k=n/2; long long int ans=1; for(int i=1;i<=k;i++) ans*=2; cout<.原创 2021-09-28 09:28:46 · 122 阅读 · 0 评论 -
B. Present from Lena【1000 / 找规律】
https://codeforces.com/problemset/problem/118/B 数字后,如果没数字了就得break掉,不会有多余的空格。 #include<bits/stdc++.h> using namespace std; int a[105][105]; int main(void) { int n; cin>>n; int m=n*2+1; for(int i=0;i<m;i++) { for(int j=0;j<m;j++) .原创 2021-09-26 10:37:49 · 133 阅读 · 0 评论 -
【1041】 Computer Transformation 【递推 / 高精加法】
http://acm.hdu.edu.cn/showproblem.php?pid=1041 唠嗑,吐槽 不得不说杭电里面的题真的新颖,我在其它oj上刷了不少题,最近才开始刷HDUoj, 以前觉得这个oj是英文的不爽,因为我的英语垃圾到了极致。 为了准备ACM省赛,只能硬着头皮刷杭电里的题,一来提升思维,而来能看懂英文题。 这道题题意没看懂,于是用了翻译软件翻译,结果翻译软件太坑了,弄的我不知道题目啥意思。 后来还是看英文一个个翻译才知道题意。 题意: 就是递推的变化,最后看一下有多少个 “00" 。 .原创 2021-05-07 10:59:36 · 531 阅读 · 0 评论 -
【1005】Number Sequence 【找规律】
http://acm.hdu.edu.cn/showproblem.php?pid=1005 直接开一个大的数组会MLE,也没有直接可以得结果得公式 所以只能找规律,打一下表,你会发现每48个数是一个循环。 #include<cstdio> #include<iostream> using namespace std; const int N=1e2+10; int s[N]; int main(void) { int a,b,c; s[1]=1,s[2]=1; while(.原创 2021-05-05 23:02:16 · 151 阅读 · 0 评论 -
B. Buttons【1000 / 找规律】
https://codeforces.com/problemset/problem/268/B n=4 3 41 431 4321 2 42 1 #include<bits/stdc++.h> using namespace std; typedef long long int LL; int main(void) { int n; cin>>n; LL ans=0; for(int i=n-1,j=1;i>=1;i--,j++) { ans+=i*j.原创 2021-09-19 19:54:40 · 96 阅读 · 0 评论