From 261c0e95b9c96db623f8b6e536c511cf375decaf Mon Sep 17 00:00:00 2001 From: Smart-SangGe <2251250136@qq.com> Date: Tue, 3 Oct 2023 17:51:53 +0800 Subject: [PATCH] feat: add luogu questions --- luogu/P1035.c | 38 ++++++++++++++++++++++++++++++++++++++ luogu/P1059.cxx | 38 ++++++++++++++++++++++++++++++++++++++ luogu/P1085.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ luogu/P5703.c | 35 +++++++++++++++++++++++++++++++++++ luogu/P5704.c | 34 ++++++++++++++++++++++++++++++++++ luogu/P5705.py | 2 ++ luogu/p1000.cxx | 20 ++++++++++++++++++++ luogu/p1001.cxx | 11 +++++++++++ luogu/p1046.py | 7 +++++++ 9 files changed, 230 insertions(+) create mode 100644 luogu/P1035.c create mode 100644 luogu/P1059.cxx create mode 100644 luogu/P1085.c create mode 100644 luogu/P5703.c create mode 100644 luogu/P5704.c create mode 100644 luogu/P5705.py create mode 100644 luogu/p1000.cxx create mode 100644 luogu/p1001.cxx create mode 100644 luogu/p1046.py diff --git a/luogu/P1035.c b/luogu/P1035.c new file mode 100644 index 0000000..be1966c --- /dev/null +++ b/luogu/P1035.c @@ -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 +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; +} + diff --git a/luogu/P1059.cxx b/luogu/P1059.cxx new file mode 100644 index 0000000..597e31a --- /dev/null +++ b/luogu/P1059.cxx @@ -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 +#include + +using namespace std; + +int main(int argc, char **argv) +{ + int a[110]; + int n = 0, m = 0; + scanf() + sort(a,a); + return 0; +} + diff --git a/luogu/P1085.c b/luogu/P1085.c new file mode 100644 index 0000000..4e94bb9 --- /dev/null +++ b/luogu/P1085.c @@ -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 + +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; +} + diff --git a/luogu/P5703.c b/luogu/P5703.c new file mode 100644 index 0000000..81dfb05 --- /dev/null +++ b/luogu/P5703.c @@ -0,0 +1,35 @@ +/* + * P5703.c + * + * Copyright 2022 sangge + * + * 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 + +int main(int argc, char **argv) +{ + int a,b,c; + scanf("%d%d",&a,&b); + c = a * b; + printf("%d",c); + return 0; +} + diff --git a/luogu/P5704.c b/luogu/P5704.c new file mode 100644 index 0000000..070c235 --- /dev/null +++ b/luogu/P5704.c @@ -0,0 +1,34 @@ +/* + * P5704.c + * + * Copyright 2022 sangge + * + * 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 + +int main(int argc, char **argv) +{ + char a; + scanf("%c",&a); + printf("%c",a-32); + return 0; +} + diff --git a/luogu/P5705.py b/luogu/P5705.py new file mode 100644 index 0000000..cd7ab64 --- /dev/null +++ b/luogu/P5705.py @@ -0,0 +1,2 @@ +a = input() +print(a[::-1]) \ No newline at end of file diff --git a/luogu/p1000.cxx b/luogu/p1000.cxx new file mode 100644 index 0000000..f4cd838 --- /dev/null +++ b/luogu/p1000.cxx @@ -0,0 +1,20 @@ +#include +//#include +#include +using namespace std; +int main() +{ + int a; + cin>>a; + int b[a]; + for(int i=0;i>b[i]; + } + sort(b,b+a); + for(int i=0;i +using namespace std; +int main() +{ + int a,b; + while(cin>>a>>b) + { + cout<