C/C++
扫地di
熊嘛,随便扫扫就好~
展开
-
UVa1590 IP Networks(IP网络)
#include <cstdio>#include <iostream>#include <cstring>#include <cstdlib>#include <algorithm>using namespace std; int zwym_table[9] = {255, 254, 252, 248, 240,...原创 2019-10-24 15:15:13 · 257 阅读 · 0 评论 -
UVa201 Squares(正方形)
思路:关键是怎么判断存在正方形,创建两个矩阵,一个是计算点(i, j)右边最多连着几个点;另外一个是计算点(i, j)下边最多连着几个点。然后比较就可以了。#include <stdio.h>#include <string.h>#include <iostream>using namespace std;int n, m;in...原创 2019-10-10 20:02:49 · 224 阅读 · 0 评论 -
UVa133 The Dole Queue(救济金发放)
#include<bits/stdc++.h>using namespace std;const int maxn = 25;int n, k, m, a[maxn]; int go(int p, int d, int t){ while(t--){ do{ p = (p + d + n -1)%n + 1; ...原创 2019-07-05 21:02:10 · 186 阅读 · 0 评论 -
UVa489 Hangman Judge(侩子手游戏)
思路:首先统计给出单词中,有哪些字母出现以及总共的字母数量。然后再与给出的字符串进行比较即可。#include<bits/stdc++.h>using namespace std;int main() { int n, i, na[30], count, flag, sum; char a[50], b[50]; while(scanf("%d", &am...原创 2019-07-05 19:37:39 · 341 阅读 · 0 评论 -
UVa1339 Ancient Cipher(古老的密码)
思路:判断使是否映射后相同,因为要重新排序,所字符串用来的顺序就不重要了。只需要统计每个字母出现的次数,再将统计的好的次数,进行排序并比较两数组是否相同。若相同,即满足某种映射且变换后相同。#include<bits/stdc++.h>using namespace std;int cmp(const void *a, const void *b){ return ...原创 2019-07-05 16:48:38 · 210 阅读 · 0 评论 -
UVa1588 Kickdown(换抵挡装置)
题目描述: 给出两个长度分别为n1,n2且每列高度只为1或2的长条,需要将它们放入一个高度为3的容器,求出能够容纳他们的最短容器长度。本题思路: 模拟插入,从第一个接口开始插,如果不满足条件就跳到下一个接口,满足条件时跳出函数输出答案即可。#include<bits/stdc++.h>using namespace std;int slo(char a...原创 2019-07-05 11:40:07 · 316 阅读 · 0 评论 -
UVa1587 Box(盒子)
思路:首先对输入的每个矩形的长和宽按长>宽,在按先长后宽对输入的矩形再矩形排序即可。#include <bits/stdc++.h>#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>using namespace...原创 2019-07-05 09:42:16 · 228 阅读 · 0 评论 -
UVa10340_All in All(子序列)
All in AllInput:standard inputOutput:standard outputTime Limit:2 secondsMemory Limit:32 MBYou have devised a new encryption technique which encodes a message by inserting between its cha...原创 2019-03-17 22:39:16 · 199 阅读 · 0 评论 -
UVa232_CrossWord Answers
CrossWord AnswersA crossword puzzle consists of a rectangular grid of black and white squares and two lists of definitions (or descriptions).One list of definitions is for ``words" to be written l...原创 2019-03-12 19:31:28 · 255 阅读 · 0 评论 -
UVa202V_Repeating Decimals(循环节)
#include <iostream>using namespace std; //当出现余数相等时,可认为找到循环节了 int r[3003],u[3003],s[3003]; //r-存商;u-判断余数是否出现重复;s-存余数 int main(){ int n,m,t; while(cin >> n >> m) { t = n;...原创 2019-03-16 12:43:02 · 157 阅读 · 0 评论 -
UVa455_Periodic Strings
Periodic StringsTime limit: 3.000 secondsPeriodic StringsA character string is said to have period k if it can be formed by concatenating one or more repetitions of another string of length k. F...原创 2019-03-10 22:40:14 · 137 阅读 · 0 评论 -
UVa1225_Digit Counting(数数字)
Digit CountingTime limit: 3.000 secondsTrung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 toN (1 < ...原创 2019-03-10 21:57:20 · 217 阅读 · 0 评论 -
UVa1368_DNA Consensus String(DNA序列)
题意:输入一个由ATCG组成的表格,表格中每一列出现次数最多的字母组成一行新的字符串,距离为将每一列出现次数不是最多的字母出现的次数总和,输出字符串和距离。思路:将数据存入二维数组,将每一列ATCG出现的次数计算出来,将出现次数最多的字母放入新的字符型数组中,将每一列除了出现次数最多的字母出现的次数加起来。#include<cstdio>#include<iostre...原创 2019-03-14 23:21:38 · 178 阅读 · 0 评论 -
错误票据
错误票据 Time Limit: 1 Sec Memory Limit: 512 MB Description某涉密单位下发了某种票据,并要在年终全部收回。...原创 2018-10-09 19:37:21 · 151 阅读 · 0 评论 -
回文数字
回文数字 Time Limit: 1 Sec Memory Limit: 128 MBDescription观察数字:12321,123321 都有一个...原创 2018-10-09 17:03:02 · 249 阅读 · 0 评论