自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(81)
  • 收藏
  • 关注

原创 Django基础操作

1.启动系统python manage.py runserver2.创立后台管理员python manage.py createsuperuser运行成功后输入用户名、邮箱、密码3.django连接数据库创建迁移文件:python manage.py makemigrations同步到数据库:python manage.py migrate...

2022-04-16 20:08:37 778

原创 M - Sekiro

Sekiro: Shadows Die Twice is an action-adventure video game developed by FromSoftware and published by Activision. In the game, the players act as a Sengoku period shinobi known as Wolf as he attempts...

2020-05-07 12:30:25 242

原创 A - Calandar

On a planet far away from Earth, one year is composed of 12 months, and each month always consists of 30 days.Also on that planet, there are 5 days in a week, which are Monday, Tuesday, Wednesday, Th...

2020-05-07 12:17:48 252

原创 B - Primes

A prime number is a natural number greater than 1 and has exactly 2 divisors which are 1 and the number itself.You are given a prime number n, find any 2 prime numbers a and b such that a+b=n or stat...

2020-04-25 22:29:10 307

原创 01背包问题

有 N 件物品和一个容量是 V 的背包。每件物品只能使用一次。第 i 件物品的体积是 vi,价值是 wi。求解将哪些物品装入背包,可使这些物品的总体积不超过背包容量,且总价值最大。输出最大价值。输入格式第一行两个整数,N,V,用空格隔开,分别表示物品数量和背包容积。接下来有 N 行,每行两个整数 vi,wi,用空格隔开,分别表示第 i 件物品的体积和价值。输出格式输出一个整数,表示...

2020-04-20 22:38:29 581

原创 JAVA判断合法标识符

Problem Description输入若干行字符串,判断每行字符串是否可以作为JAVA语法的合法标识符。 判断合法标识符的规则:由字母、数字、下划线“_”、美元符号“$”组成,并且首字母不能是数字。Input输入有多行,每行一个字符串,字符串长度不超过10个字符,以EOF作为结束。Output若该行字符串可以作为JAVA标识符,则输出“true”;否则,输出“false”。Samp...

2020-04-16 23:10:39 679

原创 java——小鑫の日常系列故事(十)——排名次

Problem Description小鑫在来到SDUT之后,经过十分刻苦的学习和努力终于进入了ACM集训队。很快又一次ACM集训队的选拔就要开始了,集训队员们又忙碌了起来。他也十分幸运的被学长抓来当苦力。 o(∩_∩)o这次学长给他分配的任务是写一个自动排名的程序,我们知道当选拔赛结束的时候,每一个参与选拔的同学都会有一个自己的分数。而集训队需要根据大家的分数排名来决定谁能够进入集训队,这...

2020-04-11 20:50:26 274

原创 E - Substring Reverse

Two strings s and t of the same length are given. Determine whether it is possible to make t from s using exactly one reverse of some its substring.InputThe first line contains the string s, and the...

2020-04-07 21:23:04 236

原创 J - Parallelograms

There are n sticks, the i-th of which has length ai. Alex wants to assemble from them as many parallelograms as possible simultaneously, with each stick used at most in one parallelogram. What maximal...

2020-04-07 21:12:51 208

原创 图的基本存储的基本方式

Description解决图论问题,首先就要思考用什么样的方式存储图。但是小鑫却怎么也弄不明白如何存图才能有利于解决问题。你能帮他解决这个问题么?Input多组输入,到文件结尾。每一组第一行有两个数n、m表示n个点,m条有向边。接下来有m行,每行两个数u、v代表u到v有一条有向边。第m+2行有一个数q代表询问次数,接下来q行每行有一个询问,输入两个数为a,b。注意:点的编号为0~n-1,...

2020-03-23 22:14:06 114

原创 数据结构实验之图论一:基于邻接矩阵的广度优先搜索遍历

Problem Description给定一个无向连通图,顶点编号从0到n-1,用广度优先搜索(BFS)遍历,输出从某个顶点出发的遍历序列。(同一个结点的同层邻接点,节点编号小的优先遍历)Input输入第一行为整数n(0< n <100),表示数据的组数。对于每组数据,第一行是三个整数k,m,t(0<k<100,0<m<(k-1)*k/2,0< t<k),表示有m条边,k个顶点...

2020-03-12 20:55:48 126

原创 J - Convert QWERTY to Dvorak

思路:把两种键盘的符号都存到字符串中,再寻找就可以了,刚开始用c++一直wa,后来改了c就a了。#include<stdio.h>#include<cstring>using namespace std;char mapp;char s1[]= {"-=_+qwertyuiop[]QWERTYUIOP{}asdfghjkl;'ASDFGHJKL:\"zx...

2020-03-10 21:08:08 225

原创 H - May Day Holiday

As a university advocating self-learning and work-rest balance, Marjar University has so many days of rest, including holidays and weekends. Each weekend, which consists of Saturday and Sunday, is a r...

2020-03-10 20:58:31 154

原创 I - Array Negations

You are given an array a of n integers, and an integer k. You have to make k negation operations such that at each operation you need to choose an element ai from the array and replace it with −ai.Yo...

2020-03-08 21:52:38 507

原创 G - Rikka with Parenthesis II

As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Correct parentheses sequences can be defined recursively ...

2020-03-07 21:48:36 120

原创 汤圆の拯救计划

Problem Description又到了汤圆星球一年一度的汤圆节了,但是大魔王却过来把汤圆公主抓走了Σ( ° △ °|||)︴身为汤圆骑士的QAQ蒟蒻自然而然的肩负着拯救汤圆的使命QAQ蒟蒻经历了千辛万苦(并没有)之后,来到了大魔王的城堡,根据情报,汤圆公主就被大魔王放在城堡内,然后QAQ蒟蒻发现自己是一个路痴,所幸的是他拿到了大魔王的城堡的地图,而且在这上面标注了自己和汤圆公主的位置...

2020-02-27 20:04:14 96

原创 图结构练习——最短路径

Problem Description给定一个带权无向图,求节点1到节点n的最短路径。Input输入包含多组数据,格式如下。第一行包括两个整数n m,代表节点个数和边的个数。(n<=100)剩下m行每行3个正整数a b c,代表节点a和节点b之间有一条边,权值为c。Output每组输出占一行,仅输出从1到n的最短路径权值。(保证最短路径存在)Sample Input3 2...

2020-02-26 21:20:48 202

原创 不撞南墙不回头

假如有编号为1,2,3的3张扑克牌和编号为1,2,3的3个盒子,现在需要将这三张扑克牌分别放到3个盒子里面,并且每个盒子有且只能放一张扑克牌,那么一共有多少种不同的方法#include<bits/stdc++.h>using namespace std;int a[10],book[10],n;int count1 = 1;void dfs(int step){ ...

2020-02-26 16:57:11 204

原创 数据结构实验之栈与队列十:走迷宫

Problem Description一个由n * m 个格子组成的迷宫,起点是(1, 1), 终点是(n, m),每次可以向上下左右四个方向任意走一步,并且有些格子是不能走动,求从起点到终点经过每个格子至多一次的走法数。Input第一行一个整数T 表示有T 组测试数据。(T <= 110)对于每组测试数据:第一行两个整数n, m,表示迷宫有n * m 个格子。(1 <= n...

2020-02-26 16:43:39 135

原创 数据结构实验之排序六:希尔排序

Problem Description我们已经学习了各种排序方法,知道在不同的情况下要选择不同的排序算法,以期达到最好的排序效率;对于待排序数据来说,若数据基本有序且记录较少时, 直接插入排序的效率是非常好的,希尔排序就是针对一组基本有序的少量数据记录进行排序的高效算法。你的任务是对于给定的数据进行希尔排序,其中增量dk=n/(2^k)(k=1,2,3……)Input连续输入多组数据,每组输...

2020-02-24 20:25:48 107

原创 数据结构实验之排序五:归并求逆序数

Problem Description对于数列a1,a2,a3…中的任意两个数ai,aj (i < j),如果ai > aj,那么我们就说这两个数构成了一个逆序对;在一个数列中逆序对的总数称之为逆序数,如数列 1 6 3 7 2 4 9中,(6,4)是一个逆序对,同样还有(3,2),(7,4),(6,2),(6,3)等等,你的任务是对给定的数列求出数列的逆序数。Input输入数据...

2020-02-24 15:21:56 90

原创 迷之好奇

FF得到了一个有n个数字的集合。不要问我为什么,有钱,任性。FF很好奇的想知道,对于数字x,集合中有多少个数字可以在x前面添加任意数字得到。如,x = 123,则在x前面添加数字可以得到4123,5123等。Input多组输入。对于每组数据首先输入n(1<= n <= 100000)。接下来n行。每行一个数字y(1 <= y <= 100000)代表集合中的元...

2020-02-22 18:01:47 197 1

原创 F - Building Numbers

思路:可以进行的操作有两种:1.在自身上+12.自身*2如果x是偶数的话,x/=2,操作数加1,否则x-=1,操作数加1刚开始直接用sum计算,结果超时,然后用数组b,来存放到第i个数字时候的总操作数,用b[r]-b[l]即所求也不知道为什么,用cin和cout,加上std::ios::sync_with_stdio(false);也不会超时,最后改成了scanf和printf就...

2020-02-18 20:24:12 185

原创 H - Eyad and Math

Eyad was given a simple math problem, but since he is very bad at math he asked you to help him.Given 4 numbers, a, b, c, and d. Your task is to find whether ab is less than cd or not.It is guarante...

2020-02-18 18:18:15 167

原创 H - 水果

夏天来了好开心啊,呵呵,好多好多水果Joe经营着一个不大的水果店.他认为生存之道就是经营最受顾客欢迎的水果.现在他想要一份水果销售情况的明细表,这样Joe就可以很容易掌握所有水果的销售情况了.Input第一行正整数N(0<N<=10)表示有N组测试数据.每组测试数据的第一行是一个整数M(0<M<=100),表示工有M次成功的交易.其后有M行数据,每行表示一次交易,由...

2020-02-16 21:32:30 1020

原创 镜像字符

Let’s call a string “s-palindrome” if it is symmetric about the middle of the string. For example, the string “oHo” is “s-palindrome”, but the string “aa” is not. The string “aa” is not “s-palindrome”...

2020-02-12 22:47:30 1013

原创 正方形个数

One day Vasya was sitting on a not so interesting Maths lesson and making an origami from a rectangular a mm  ×  b mm sheet of paper (a > b). Usually the first step in making an origami is making a...

2020-02-12 18:51:33 248

原创 E - E

Programmer Rostislav got seriously interested in the Link/Cut Tree data structure, which is based on Splay trees. Specifically, he is now studying the expose procedure.Unfortunately, Rostislav is una...

2020-02-12 18:28:36 155

原创 第K个数

In late autumn evening n robots gathered in the cheerful company of friends. Each robot has a unique identifier — an integer from 1 to 109.At some moment, robots decided to play the game “Snowball”. ...

2020-02-10 20:12:54 150

原创 最小秒数

Luba is surfing the Internet. She currently has n opened tabs in her browser, indexed from 1 to n from left to right. The mouse cursor is currently located at the pos-th tab. Luba needs to use the tab...

2020-02-08 18:08:45 202

原创 基因组解码

The process of mammoth’s genome decoding in Berland comes to its end!One of the few remaining tasks is to restore unrecognized nucleotides in a found chain s. Each nucleotide is coded with a capital ...

2020-02-07 21:34:29 345

原创 the number of lines (rows) of pixels a and the number of columns of pixels b

A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels.Your task is to determine the size of the rectangular display — the numbe...

2020-02-07 20:28:30 499

原创 Shortest Prefixes(最短前缀)

A prefix of a string is a substring starting at the beginning of the given string. The prefixes of “carbon” are: “c”, “ca”, “car”, “carb”, “carbo”, and “carbon”. Note that the empty string is not cons...

2020-02-07 17:10:51 1189

原创 单词数

lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数。下面你的任务是帮助xiaoou333解决这个问题。Input有多组数据,每组一行,每组就是一篇小文章。每篇小文章都是由小写字母和空格组成,没有标点符号,遇到#时表示输入结束。Output每组只输出一个整数,其单独成行,该整数代表一篇文章里不同单词的总数。Sample Inputy...

2020-02-07 16:43:43 284

原创 统计难题

Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提问,每个提问都是一个字符串.注意:本题...

2020-02-07 15:05:31 120

原创 雀士分麻将

一年一度的日麻大赛结束啦,作为本场比赛的主裁判汪次郎要给大家发奖品了一姬、二阶堂美树、三上千织等雀士排成一排,等待发奖品。本届比赛的奖品为麻将,发奖规则如下:每个人都有一个自己的分数ai,代表本次比赛中获得的成绩。每个选手至少可以获得1张麻将作为奖励。如果两位选手站位相邻,积分高的选手一定比积分低的选手获得的麻将多。作为主裁判的汪次郎,当然想减少在奖品上的开销,现在他已经知道了每个人的分...

2020-02-04 17:57:08 247

原创 伙伴系统

思路:慢慢读完题,真的不难#include<bits/stdc++.h>using namespace std;int a[12];//保存内存块,第i个表示2的i次方int b[12];int main(){ std::ios::sync_with_stdio(false); memset(a,0,11); long long int k;...

2020-01-31 22:46:35 381

原创 浴缸

Input file: standard inputOutput file: standard outputTime limit: 1 secondMemory limit: 64 megabytes众所周知龙龙虽然很可爱但其实是俱乐部最强的人。这不他今年去打 EC-Final 辣。处于一些特殊原因,龙龙订了一间主题房,里面有一个大大的浴缸。虽然龙龙很想使用这个浴缸但是傲娇的龙龙打算掩盖自...

2020-01-31 20:16:42 221

原创 大圆小圆问题

NN is an experienced internet user and that means he spends a lot of time on the social media. Once he found the following image on the Net, which asked him to compare the sizes of inner circles:It ...

2020-01-29 22:48:59 492

原创 单峰的问题

Array of integers is unimodal, if:it is strictly increasing in the beginning;after that it is constant;after that it is strictly decreasing.The first block (increasing) and the last block (decreas...

2020-01-29 22:38:18 433

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除