跳到正文

KTKL447

1352498

神威难藏泪,入目皆是琳||天锁爆葬||不能守护该守护的人,这份力量又有什么意义?

在洛谷打开
资料、奖项与版本

资料

编号
1352498
抓取

奖项

2025 CSP-J
一等奖

好耶!!!

2025.12.8 首青 方法:打表(打表出省一!!!QWQ) 题目:P1463 推荐者:@thy_123

代码如下

C++
/*#include<bits/stdc++.h>
using namespace std;
long long h[10005],cnt[10005],t=1;
long long prime(long long x)
{ 
	double y=sqrt(x);	
	long long ans=0;
	int i,z=sqrt(x);
	for (i=1;i<sqrt(x);i++)
		if (x%i==0) ans+=2;  
	if (y==z) ans++;
	return ans;
}
int main()
{
	h[1]=1;
	cnt[1]=1;
	long long i=2;
	for(i=2;i<=60000;i++)
	{
		long long kkk=prime(i);
		if(kkk>cnt[t])
		{
			cnt[++t]=kkk;
			h[t]=i;
		}
	}
	for(i=60000;i<=800000;i+=60)
	{
		long long kkk=prime(i);
		if(kkk>cnt[t])
		{
			cnt[++t]=kkk;
			h[t]=i;
		}
	}
	for(i=720720;i<=3000000000;i+=720720)
	{
		long long kkk=prime(i);
		if(kkk>cnt[t])
		{
			cnt[++t]=kkk;
			h[t]=i;
		}
	}
	for(long long i=1;i<=t;i++)
		cout<<h[i]<<",";
	return 0;
}
*/
//1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260,1680,2520,5040,7560,10080,15120,20160,25200,27720,45360,50400,55440,83160,110880,166320,221760,277200,332640,498960,554400,665280,720720,1441440,2162160,2882880,3603600,4324320,6486480,7207200,8648640,10810800,14414400,17297280,21621600,32432400,36756720,43243200,61261200,73513440,110270160,122522400,147026880,183783600,245044800,294053760,367567200,551350800,698377680,735134400,1102701600,1396755360,2001000000
#include<bits/stdc++.h>
using namespace std;
long long cnt,n,a[]={0,1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260,1680,2520,5040,7560,10080,15120,20160,25200,27720,45360,50400,55440,83160,110880,166320,221760,277200,332640,498960,554400,665280,720720,1441440,2162160,2882880,3603600,4324320,6486480,7207200,8648640,10810800,14414400,17297280,21621600,32432400,36756720,43243200,61261200,73513440,110270160,122522400,147026880,183783600,245044800,294053760,367567200,551350800,698377680,735134400,1102701600,1396755360,2001000000};
int main()
{
	cin>>n;
	while(1)
	{
		cnt++;
		if(a[cnt]>n)
		{
			cout<<a[cnt-1];
			return 0;
		}
	}
	return 0;
}

2025.12.10 首紫 方法:string,模拟(STL真是跟飞雷神一样快!!!QWQ) 题目:P4036 推荐者:@tws0726

代码如下

C++
#include<bits/stdc++.h>
using namespace std;
string s,x,y;
int a,b,cnt,t,len;
int main()
{
	cin>>s;
	scanf("%d",&t);
	while(t--)
	{
		cin>>x;
		if(x=="Q")
		{
			len=s.size();
			cin>>a>>b;
			cnt=0;
			for(int i=a-1,j=b-1;i<len&&j<len;i++,j++)
			{
				if(s[i]==s[j])
					cnt++;
				else
					break;
			}
			printf("%d\n",cnt);
		}
		else if(x=="R")
		{
			scanf("%d",&a);
			cin>>y;
			s[a-1]=y[0];
		}
		else
		{
			scanf("%d",&a);
			cin>>y;
			s.insert(a,y);
		}
	}
	return 0;
}

2026.8.13 首蓝

C++
#include<bits/stdc++.h>
using namespace std;
struct Node {
	long long x,y;
	bool operator < (const Node &A) const{
		return x<A.x;
	}
}a[400001],c[400001];
long long n;
long long solve(long long l,long long r)
{
	if(l==r)
		return 1e20;
	long long m=(l+r)/2;
	long long d=min(solve(l,m),solve(m+1,r));
	long long cnt=0;
	for(int i=l;i<=r;i++)
		if(abs(a[i].x-a[m].x)*abs(a[i].x-a[m].x)<d)
			c[++cnt].x=a[i].y,c[cnt].y=a[i].x;
	sort(c+1,c+cnt+1);
	for(int i=1;i<=cnt;i++)
		for(int j=i+1;j<=cnt&&(c[j].x-c[i].x)*(c[j].x-c[i].x)<d;j++)
			d=min(d,(c[j].x-c[i].x)*(c[j].x-c[i].x)+(c[j].y-c[i].y)*(c[j].y-c[i].y));
	return d;
}
int main()
{
	scanf("%lld",&n);
	for(int i=1;i<=n;i++)
		scanf("%lld%lld",&a[i].x,&a[i].y);
	sort(a+1,a+n+1);
	printf("%lld",solve(1,n));
	return 0;
}

2026.10.26 第二道紫 P14614

C++
#include <bits/stdc++.h>
using namespace std;
int n = 51, m = 47;
string s[100] = {
	"....###########################################",
	".##P.##...#.............#...#.............#....",
	".#.BB.....#.................#.................#",
	".#.BB.....#.................#.................#",
	".#....#....#..#.........#....#..#.........#...#",
	".#####...#.#...####.####...#.#...####.###.#..##",
	".#...##..##...#....#...##..##...#....#...##..##",
	".#........#........#........#........#........#",
	".#........#........#........#........#.........",
	".#...#....#...##..#....#....#...##..#....#....#",
	"..#..#.###.###.#..#.#...####.###.#..#.#..#.####",
	"..#..##...#....#...##..##...#....#...##..##...#",
	".#........#........#........#........#.........",
	".#........#........#........#........#........#",
	".#....#....#..##...#....#....#..##...#....#...#",
	"..####...#.#..#.###.#####..#.#..#####.#####..##",
	".#...##..##...#....#...##..##...#....#...##..##",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#...#....#...##..##...#....#...##..#....#....#",
	".##..#####.#####..#.#..#####.#####..###..######",
	".##..##...#....#...##..##...#....#....#..##...#",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#....#...##..##...#....#...##..##...#....#...#",
	"..####...#.#..#####.#####..#.#..#####.#####..##",
	".#...##..##...#....#...##..##...#....#...##..##",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#...#....#...##..##...#....#...##..#....#....#",
	"..#..#####.#####..#.#..#####.#####..###..######",
	".##..##...#....#...##..##...#....#....#..##...#",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#....#...##..##...#....#...##..##...#....#...#",
	"..#####..#.#..#####.#####..#.#..#####.#####..##",
	".#...##..##...#....#...##..##...#....#...##..##",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#...#....#...##..##...#....#...##..#....#....#",
	"..#..#####.#####..#.#..#####.#####..###..######",
	"..#..##...#....#...##..##...#....#....#..##...#",
	".#........#........#........#........#........#",
	".#........#........#........#........#........#",
	".#....#...##..##...#....#....#..##...#....#...#",
	"..###.#..#.#....###.#####..###...##########..##",
	".#...#.........#...#...#.........#...#...#....#",
	".#...#.........#...#...#.........#...#...#SS..#",
	".#...#....##...#...#...#....##...#...#...#SS..#",
	"..###.#####.###.###.###.####.####.###.#######.#",
	"..............................................#"};


int main() {
	printf("%d %d\n", n, m);
	for (int i = 0; i < n; i++) {
		cout << s[i] << endl;
	}
}
共 1 篇
  1. 个人记录

    一次“短短”的美文分享

    有一件事,虽已过去两天,但由于非常非常 宇宙无敌霹雳炸裂 ∴不得不记录亿下下 我们语文老师很好,喜欢开展一些活动,提升我们语文的阅读能力呀,作文写作呀,什么什么的,就是可能会拖亿点点的堂罢了 (也只拖三十分钟吧) ,咳咳,言归正传,ta开展了一个美文赏析活动,让我们美文分享,还开…