feat: add luogu questions
This commit is contained in:
parent
c9fbb1e74a
commit
261c0e95b9
38
luogu/P1035.c
Normal file
38
luogu/P1035.c
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* P1035.c
|
||||||
|
*
|
||||||
|
* Copyright 2022 Áº¿¡Ó <2251250136@qq.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include<stdio.h>
|
||||||
|
int main(){
|
||||||
|
int k,n;
|
||||||
|
double sn=0.0;
|
||||||
|
scanf("%d",&k);
|
||||||
|
for(n=1;;n++){
|
||||||
|
sn+=1.0/n;
|
||||||
|
if(sn>k*1.0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("%d",n);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
38
luogu/P1059.cxx
Normal file
38
luogu/P1059.cxx
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* P1059.cxx
|
||||||
|
*
|
||||||
|
* Copyright 2022 Áº¿¡Ó <2251250136@qq.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int a[110];
|
||||||
|
int n = 0, m = 0;
|
||||||
|
scanf()
|
||||||
|
sort(a,a);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
45
luogu/P1085.c
Normal file
45
luogu/P1085.c
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* P1085.c
|
||||||
|
*
|
||||||
|
* Copyright 2022 Áº¿¡Ó <2251250136@qq.com>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int a[7][2];
|
||||||
|
int max = 0;
|
||||||
|
for (int i = 0; i < 7; i++){
|
||||||
|
scanf("%d%d",&a[i][0],&a[i][1]);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < 7; i++){
|
||||||
|
if((a[max][0]+a[max][1]) < (a[i][0]+a[i][1]) && (a[i][0]+a[i][1]>8)){
|
||||||
|
max = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(a[0][0]+a[0][1]<8&&a[1][0]+a[1][1]<8&&a[2][0]+a[2][1]<8&&a[3][0]+a[3][1]<8&&a[4][0]+a[4][1]<8&&a[5][0]+a[5][1]<8&&a[6][0]+a[6][1]<8){
|
||||||
|
max=-1;
|
||||||
|
}
|
||||||
|
printf("%d",max+1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
35
luogu/P5703.c
Normal file
35
luogu/P5703.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* P5703.c
|
||||||
|
*
|
||||||
|
* Copyright 2022 sangge <sangge@kali>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
int a,b,c;
|
||||||
|
scanf("%d%d",&a,&b);
|
||||||
|
c = a * b;
|
||||||
|
printf("%d",c);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
34
luogu/P5704.c
Normal file
34
luogu/P5704.c
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* P5704.c
|
||||||
|
*
|
||||||
|
* Copyright 2022 sangge <sangge@kali>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
* MA 02110-1301, USA.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
char a;
|
||||||
|
scanf("%c",&a);
|
||||||
|
printf("%c",a-32);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
2
luogu/P5705.py
Normal file
2
luogu/P5705.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
a = input()
|
||||||
|
print(a[::-1])
|
20
luogu/p1000.cxx
Normal file
20
luogu/p1000.cxx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include<iostream>
|
||||||
|
//#include<bits/stdc++.h>
|
||||||
|
#include<algorithm>
|
||||||
|
using namespace std;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a;
|
||||||
|
cin>>a;
|
||||||
|
int b[a];
|
||||||
|
for(int i=0;i<a;i++)
|
||||||
|
{
|
||||||
|
cin>>b[i];
|
||||||
|
}
|
||||||
|
sort(b,b+a);
|
||||||
|
for(int i=0;i<a;i++)
|
||||||
|
{
|
||||||
|
cout<<b[i]<<endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
11
luogu/p1001.cxx
Normal file
11
luogu/p1001.cxx
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a,b;
|
||||||
|
while(cin>>a>>b)
|
||||||
|
{
|
||||||
|
cout<<a+b<<endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
7
luogu/p1046.py
Normal file
7
luogu/p1046.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
a0,a1,a2,a3,a4,a5,a6,a7,a8,a9=map(int,input().split())
|
||||||
|
h=input()
|
||||||
|
num=0
|
||||||
|
for i in [a0,a1,a2,a3,a4,a5,a6,a7,a8,a9]:
|
||||||
|
if ((int(i)) <= (int(h)+30)):
|
||||||
|
num+=1
|
||||||
|
print(num)
|
Loading…
x
Reference in New Issue
Block a user