delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#include<iostream>
using namespace std;
int zd(int a,int b)
{
return (b==0)?a:zd(b,a%b);
}
int zx(int a,int b)
{
return a*b/zd(a,b);
}
int main()
{
int n,m;
while(true)
{
cin>>n>>m;
cout<<zx(n,m)<<endl;
}
}

View File

@ -0,0 +1,41 @@
#include<cstdio>
using namespace std;
unsigned long long gcd(unsigned long long m,unsigned long long n)
{
int x=1;
unsigned long long t;
begin:if(m==n) return x*m;
if(m<n)
{
t=m,m=n,n=t;
goto begin;
}
if(m&1)
{
if(n&1)
{
t=n;
n=m-n;
m=t;
goto begin;
}
n=n>>1;
goto begin;
}
if(n&1)
{
m=m>>1;
goto begin;
}
x=x*2;
m=m>>1;
n=n>>1;
goto begin;
}
int main()
{
unsigned long long n,m;
scanf("%lld%lld",&n,&m);
printf("%lld\n",gcd(n,m));
return 0;
}

View File

@ -0,0 +1,41 @@
#include<cstdio>
using namespace std;
unsigned long long gcd(unsigned long long m,unsigned long long n)
{
int x=1;
unsigned long long t;
begin:if(m==n) return x*m;
if(m<n)
{
t=m,m=n,n=t;
goto begin;
}
if(m&1)
{
if(n&1)
{
t=n;
n=m-n;
m=t;
goto begin;
}
n=n>>1;
goto begin;
}
if(n&1)
{
m=m>>1;
goto begin;
}
x=x*2;
m=m>>1;
n=n>>1;
goto begin;
}
int main()
{
unsigned long long n,m;
scanf("%lld%lld",&n,&m);
printf("%lld\n",gcd(n,m));
return 0;
}

View File

@ -0,0 +1,33 @@
#include<cstdio>
using namespace std;
int main()
{
bool x;
int t;
int m;
scanf("%d",&t);
int sr[t];
for(int i=0;i<t;i++) scanf("%d",sr+i);
for(int i=0;i<t;i++)
{
x=0;
for(int j=2;j<=sr[i];j++)
{
if(sr[i]%j==0)
{
if(x) printf("*");
m=0;
while(sr[i]%j==0)
{
m++;
sr[i]/=j;
}
printf("%d",j);
if(m>1) printf("^%d",m);
x=1;
}
}
printf("\n");
}
return 0;
}