跳到正文

个人记录

200粉粉福

Vodyanitsaa约 5 分钟
原文
文章信息与版本

文章信息

收录
2025年12月12日
更新
2026年2月25日
篇幅
约 5 分钟

版本

  1. v1当前

不要嫌少,少是因为你没有投题

P1100 高低位交换 from lee_liang

C++
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define For(i,a,b) for(int i = a;i<=b;i++)
#define Rof(i,a,b) for(int i = a;i>=b;i--)
using namespace std;
inline __int128 read(){__int128 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 f*x;}
inline void write(__int128 x){if(x<0){putchar('-');x=-x;}if(x>9)write(x/10);putchar(x%10+'0');}
int main(){
	unsigned int n = read();
	write((n>>16)+(n<<16));
	return 0;
}

B3715 分解质因子 2 from lee_liang

C++
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define For(i,a,b) for(int i = a;i<=b;i++)
#define Rof(i,a,b) for(int i = a;i>=b;i--)
using namespace std;
inline __int128 read(){__int128 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 f*x;}
inline void write(__int128 x){if(x<0){putchar('-');x=-x;}if(x>9)write(x/10);putchar(x%10+'0');}
int main(){
	int T = read();
	while(T--){
		ll n = read();
		ll c = 2;
		while(c*c<=n){
			if(n%c==0){
				while(n%c==0){
					write(c);
					putchar(' ');
					n/=c;
				}
			}
			c++;
		}
		if(n!=1) write(n);
		putchar('\n');
	}
	return 0;
}

P12892 [蓝桥杯 2025 国 Java B] 弹跳鞋 from dg114514

C++
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define For(i,a,b) for(int i = a;i<=b;i++)
#define Rof(i,a,b) for(int i = a;i>=b;i--)
using namespace std;
inline __int128 read(){__int128 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 f*x;}
inline void write(__int128 x){if(x<0){putchar('-');x=-x;}if(x>9)write(x/10);putchar(x%10+'0');}
ll solve(ll x){
	return x*(x+1)/2;
}
int main(){
	ll L = read();
	ll l = 1,r = 2e9,ans;
	while(l<=r){
		ll mid = (l+r)/2;
		if(solve(mid)>=L){
			r = mid-1;
			ans = mid;
		}
		else l = mid+1;
	}
	while(L%2!=solve(ans)%2) ans++;
	write(ans);
	return 0;
}

P1001 A+B Problem from Cute_Furina

C++
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define For(i,a,b) for(int i = a;i<=b;i++)
#define Rof(i,a,b) for(int i = a;i>=b;i--)
using namespace std;
inline __int128 read(){__int128 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 f*x;}
inline void write(__int128 x){if(x<0){putchar('-');x=-x;}if(x>9)write(x/10);putchar(x%10+'0');}
int main(){
	int a = read(),b = read();
	write(a+b);
	return 0;
}
原文