- 博客(19)
- 资源 (1)
- 收藏
- 关注
原创 蝴蝶效应--Java
原题链接import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); long[] s=new long[10003]; int f,a,b,c,d; int i; int ...
2018-09-23 08:50:09 432 1
原创 LCM的个数
Problem Description对于我们来说求两个数的LCM(最小公倍数)是很容易的事,现在我遇到了一个问题需要大家帮助我来解决这问题,问题是:给你一个数n,然后统计有多少对(a<=b) LCM(a,b)=n;例如LCM(a,b)=12; 即(1,12),(2,12),(3,12),(4,12),(6,12),(12,12),(3,4),(4,6);Input 输入数组有多...
2018-09-22 10:11:44 122
原创 汉诺塔
原题链接汉诺塔问题大部分人都应该听说过这个问题,也比较好理解它的原理。但是对于萌新来说,递归有些难以理解,虽然它代码简洁应当仔细领悟。import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System....
2018-09-22 09:24:53 102
原创 Catch That Cow
原题链接HInt本题为求从农夫走到牛处,一共需要多少时间,农夫可以从x走到2x,也可以走到x+1,或者x-1,每次一分钟,可以直接按照上述所说做题,但是也可以逆向做题,比如从牛走到农夫。#include <iostream>#include <cstring>#include <queue>using namespace std;q...
2018-09-14 22:36:45 189
原创 Dungeon Master
原题链接Hint本题意为给定一个立体的迷宫,求从入口到出口的最短时间。本题为搜索题。#include <bits/stdc++.h>#include <iostream>using namespace std;int l,r,c;int step[31][31][31];///记录步数char maps[31][31][31];///地图que...
2018-09-14 17:26:22 253
原创 棋盘问题
原题链接#include <iostream>#include <cstring>using namespace std;char map[9][9];int vis[9];int n,k,count,sum;void serch(int x){ if(count==k) { sum++; return ...
2018-09-14 14:44:04 83
原创 C语言实验——保留整数--Java
原题链接 import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int i,flag; String str; str=reader.nextLine(); in...
2018-09-13 16:24:02 549
原创 C语言实验——打印金字塔--Java
原题链接import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int n,i,j,t; n = reader.nextInt(); for(i=1;i<=n;i++...
2018-09-13 14:52:28 313
原创 传说中的数据结构--Java
原题链接import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int t,i,num,x; String str; while(reader.hasNextInt())...
2018-09-13 14:42:11 286
原创 小鑫の日常系列故事(十)——排名次-2741
原题链接Java语言没有c/c++中的struct,没办法还是得用Java来写,只能从其他的地方借鉴了,其中,类是一个不错的选择,虽然还不会,但其实可以理解为一个函数,内部包含实现的功能。import java.util.Arrays;import java.util.Scanner;class S implements Comparable<S>{ int t;...
2018-09-12 11:33:54 587
原创 字符统计2-Java
原题链接import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int i,length,m,t; int[] a=new int[220]; String str;...
2018-09-12 11:05:47 292
原创 统计元音-1250
原题链接import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int n,i,a,b,c,d,e; String str; n = reader.nextInt();...
2018-09-12 10:49:49 287
原创 C语言实验——for循环打印图形(循环结构
import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int i,t,j; t=4; for(i=1;i<=t;i++) { for(j=1;j<=...
2018-09-09 22:44:37 2268
原创 B - Pond Cascade Gym - 101670B
本题为二分答案,题意为从高到低依次给n个深度不同的水池和水管的流速(每个水管都一样),如果某一个池塘满了,那么它只会向后面的的池塘溢水,问多长时间所有的池塘都能装满水和最后一个池塘什么时候装满水。提示:如果求所以池塘什么时候装满水,那么需要每一个都装满才行;而对于最后一个什么时候装满水,则不需要所有的都装满。#include <iostream>#includ...
2018-09-07 17:14:26 210
原创 Java 如何大小写转换
想知道java如何将大小写互换,请往下看:引发本博客的原题目如下:C语言实验——转换字母(顺序结构)Problem Description从键盘上输入一个小写字母,然后将小写字母装换成大写字母输出!Input从键盘上输入一个小写字母。Output小写字母装换成大写字母输出。Sample InputaSample OutputAHinti...
2018-09-05 22:57:43 5648
原创 Java如何输入输出单个字符
本人最近在学java,遇到了不少问题,特意把一些有意思的题目和知识点总结一波。先看题目:C语言实验——单个字符输入和输出(顺序结构)Problem Description用getchar()从键盘上输入一个字符,用putchar()打印出来!Input从键盘上输入一个字符!Output把刚刚输入的字符打印出来!Sample InputASample O...
2018-09-05 22:43:27 11534
原创 H - Genta Game Gym - 101778H
Kojima Genta is one of the best friends of Conan, and the fattest one!Everyone believes that Genta is just thinking about food. So, he wants to prove the opposite. So, his friends challenged him in ...
2018-09-05 22:22:01 203
原创 Reach Median
B. Reach MedianYou are given an array aa of nn integers and an integer ss. It is guaranteed that nn is odd.In one operation you can either increase or decrease any single element by one. Calculate...
2018-09-03 09:34:39 194
原创 C. Equalize
C. EqualizeYou are given two binary strings aa and bb of the same length. You can perform the following two operations on the string aa:Swap any two bits at indices ii and jj respectively (1≤i,j≤n...
2018-09-03 09:01:57 314
springSecurity.zip
2020-02-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人