- 博客(9)
- 收藏
- 关注
原创 有关高精阶乘的一点思考
起因 //从大佬那抄的 #include<cstdio> #include<algorithm> #include<vector> using std::vector; using std::swap; typedef long long ll; const int N=1e6+10; const ll P=998244353; const ll G=3; ll read(){ ll a=0;int op=1;char ch=getchar(); whil
2021-08-23 21:45:00 64
原创 有关压位高精
压位高精在高精度运算中加入了压位思想。详情请看代码(以高精加法为例) #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #define p 8 //要压的数 #define carry 100000000 //用于进位 using namespace std; const int N=100010; char s1[N],s2[N]; int a[
2021-08-23 21:41:42 145
原创 最小生成树
#include<bits/stdc++.h> using namespace std; #define re register #define il inline il int read() { re int x=0,f=1;char c=getchar(); while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();} while(c>='0'&&c<='9') x=(x<<3)
2021-08-09 18:09:11 39
原创 有关幻方.
一道水题 #include<cstdio> using namespace std; int n,a[40][40],x,y; int main(){ scanf("%d",&n); x=1,y=(n+1)/2; for(int i=1;i<=n*n;i++){ a[x][y]=i; if(!a[(x-2+n)%n+1][y%n+1]) x=(x-2+n)%n+1,y=y%n+1; else x=x%n+1;//数学运算 } for(int i=1;i<
2021-08-09 15:54:49 41
原创 lgP1320
#include <cstdio> int d[40020],i=1; // d 记录压缩码(显然恒小于等于 40002 ) , i 用来记录存储的位置 char c; // 临时存储字符 int main() { for(;scanf("%c",&c)&&c>0x2F;) // 先读入第一行,不断读入,直到 c 不是 ‘0’(0x30) 和 ‘1’ (0x31) 为止。 i+=!(i&1^(c-0x30)),d[i]++,
2021-08-08 14:10:23 37
原创 关于读入不定数量的数据&&其他STL(主要是读入读出技巧)
1.while (scanf("%d",&input)!=EOF){ 2.while((cin>>m)!=0)
2021-08-08 14:02:24 121
原创 一些字符串输出题
luoguP5461赦免战俘 #include<bits/stdc++.h> using namespace std; int n; int main(){ scanf("%d",&n); for(int i=0;i<(1<<n);i++){ for(int j=0;j<(1<<n);j++){ printf("%d ",(i|j)!=((1<<n)-1)?0:1);} printf("\n");} return 0;}
2021-08-03 15:43:07 92
原创 一道红题.
洛谷P5731 #include<cstdio> using namespace std; int read(){//没啥用的快读 int x=0,f=1; char c=getchar(); while(c<'0'||c>'9'){ if(c=='-') f=-1; c=getchar(); } while(c>='0'&&c<='9'){ x=x*10+c-'0'; c=getchar(); } return x*f; }
2021-08-02 16:20:19 40
原创 noip常用技巧之快读
void write(int x){ if (x<0){ putchar('-'); x=-x; } if (x>9) write(x/10); putchar(x%10+'0'); } int read(){ int x=0,f=1; char c=getchar(); while (c<'0'||c>'9'){ if (c=='-') f=-1; c=getchar(); } while (c>='0'&&c<='.
2021-08-02 16:01:41 231
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人