GalenV
GalenV
全部文章
分类
题解(6)
归档
标签
去牛客网
登录
/
注册
GalenV的博客
全部文章
(共6篇)
题解 | #铺地毯#
本题思路 看完题之后又首先就想暴力入手,看了一眼数据,最大数据有10000,如果创建循环来做的的话,时间超限,所以不得不去想怎么让循环更小一点。 代码思路: 先将每个点的位置和编号,还有长方形的长和宽存起来,遍历时也要注意遍历顺序,需要从右上角向左下角遍历,如果题目 所求点的横坐标或纵坐标 <...
C++
数组
2022-09-27
1
368
题解 | #约瑟夫环#
约瑟夫环问题 题目简述:让一群人围成一圈从1开始报数, 报到指定数字的人出圈,然后再重新从1开始报数,最后一个没出圈的人就是“大王”。 按照题目模拟即可,利用 i = i % n + 1 来造一个圈。 #include<iostream> #include<algo...
C++
数组
2022-09-24
2
683
题解 | #小乐乐与字符串#
加油 ">using namespace std; #include<algorithm> #include<vector> #include<string> #include<cstdio> typedef long long ll; int m...
C++
数组
2021-11-21
1
380
题解 | #小乐乐走台阶#
斐波那契数列哈哈哈机智的你发现了吗? ">using namespace std; int main() { int arr[100] = { 1, 1 }; int n; while(cin >> n) { int sum = 0; int i = 0; for ...
C++
C
2021-11-21
5
547
题解 | #学好C++#
#include<stdio.h> #include<string.h> int main() { int n, m; scanf("%d %d", &n, &m); int arr[10][10]; int arr2[10][10]; int count =...
C
C++
2021-11-12
0
352
题解 | #带空格直角三角形图案#
#include <stdio.h> int main() { int i=0, j=0,n,k=0; while(scanf("%d", &n)!=EOF) { for (i =0; i<n; i++) { for (j = 0; j < n ...
C
2021-10-25
4
836