【60天计划】
刷洛谷(题单广场) and Acwing算法基础课
P1001
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ll a,b;
cin>>a>>b;
cout<<a+b<<endl;
}
P1000
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
cout<< " ********\n"
" ************\n"
" ####....#.\n"
" #..###.....##....\n"
" ###.......###### ### ###\n"
" ........... #...# #...#\n"
" ##*####### #.#.# #.#.#\n"
" ####*******###### #.#.# #.#.#\n"
" ...#***.****.*###.... #...# #...#\n"
" ....**********##..... ### ###\n"
" ....**** *****....\n"
" #### ####\n"
" ###### ######\n"
"##############################################################\n"
"#...#......#.##...#......#.##...#......#.##------------------#\n"
"###########################################------------------#\n"
"#..#....#....##..#....#....##..#....#....#####################\n"
"########################################## #----------#\n"
"#.....#......##.....#......##.....#......# #----------#\n"
"########################################## #----------#\n"
"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"
"########################################## ############\n";
}
P5703
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
ll a,b;
cin>>a>>b;
cout<<a*b<<"\n";
}
P5704
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
char ch;
cin>>ch;
if(ch>='a')
cout<<char(ch-32);
else
cout<<char(ch+32);
cout<<"\n";
}
P5705
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
char s[100];
int main()
{
ios;
cin>>s;
reverse(s,s+strlen(s));
cout<<s;
cout<<'\n';
}
P5706
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
double t;
int n;
cin>>t>>n;
printf("%.3lf\n%d\n",t/n,n<<1);
}
P1425
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
int a,b,c,d;
cin>>a>>b>>c>>d;
int begin = a*60+b;
int end = c*60+d;
int min = end-begin;
cout<<min/60<<" "<<min%60<<"\n";
}
P2433(有点坑哦)
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
int n;
cin>>n;
switch(n)
{
case 1:
{
cout<<"I love Luogu!\n";
break;
}
case 2:
{
cout<<6<<' '<<4<<"\n";
break;
}
case 3:
{
cout<<"3\n12\n2\n";
break;
}
case 4:
{
cout<<fixed<<setprecision(3)<<1.0*500/3<<"\n";
break;
}
case 5:
{
cout<<(260+220)/(12+20)<<"\n";
break;
}
case 6:
{
cout<<sqrt(6*6+9*9)<<"\n";
break;
}
case 7:
{
cout<<110<<"\n";
cout<<90<<"\n";
cout<<0<<"\n";
break;
}
case 8:
{
const double pi = 3.141593;
cout<<pi*10<<"\n"<<pi*25<<"\n"<<4/3.0*pi*125<<"\n";
break;
}
case 9:
{
cout<<22<<"\n";
break;
}
case 10:
{
// 8 -->30
//10 -->6
cout<<9<<"\n";
break;
}
case 11:
{
cout<<100.0/3<<"\n";
break;
}
case 12:
{
cout<<'M'-'A'+1<<"\n";
cout<<char('A'+17)<<"\n";
break;
}
case 13:
{
const double pi = 3.141593;
double v = 4.0/3*pi*(4*4*4+10*10*10);
cout<<(int)pow(v,1.0/3)<<"\n";
break;
}
case 14:
{
for(int i = 1;;i++)
{
if(i*(10+110-i)>3500)
{
cout<<i-1<<"\n";
break;
}
}
}
};
}
P5708
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
double a,b,c;
cin>>a>>b>>c;
double p = (a+b+c)/2;
printf("%.1lf\n",sqrt(p*(p-a)*(p-b)*(p-c)));
}
P1421
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
int a,b;
cin>>a>>b;
double m = a+b/10.0;
cout<<int(m/1.9)<<"\n";
}
P5709
【深基2.习6】Apples Prologue / 苹果和虫子 (有坑哦)
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
int m,t,s;
cin>>m>>t>>s;
if(t==0)
{
cout<<0<<"\n";
return 0;
}
int q = m - (s+t-1)/t;
cout<<(q>=0?q:0)<<endl;
}
P2181
对角线 (有坑哦)
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
unsigned long long n;
cin>>n;
cout<<n*(n-1)/2*(n-2)/3*(n-3)/4<<"\n";
}
P5707
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
int s,v;
cin>>s>>v;
int t = (24+8)*60;
int min = (s+v-1)/v+10;
t-=min;
if(t>=24*60)
t-=24*60;
int a = t/60;
int b = t%60;
if(a>9)
cout<<a;
else
cout<<0<<a;
cout<<':';
if(b>9)
cout<<b;
else
cout<<0<<b;
cout<<"\n";
}
P3954
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<vector>
#include <iomanip>
using namespace std;
typedef long long ll;
#define ios ios::sync_with_stdio(false);cin.tie(0), cout.tie(0)
const int N = 1e6;
int main()
{
ios;
double a,b,c;
cin>>a>>b>>c;
cout<<int(a*0.2+b*0.3+c*0.5)<<"\n";
}
2022/2/15本人发起60天洛谷挑战
想要加入挑战或代码交流,请私信作者(看到必回复!!!)
作者本人是一名大一小白(:
滑稽保命(: