- 博客(26)
- 收藏
- 关注
原创 Ananagrams UVA - 156
map解决,把每个单词排序然后把原来的单词跟排序后的单词做映射,在对排序后的单词与数量做映射 #include <iostream> #include <map> #include <algorithm> #include <vector> using namespace std; map<string,string> mp; ...
2018-11-29 14:32:31 118
原创 The Blocks Problem UVA - 101
简单模拟一个字符”noto“写错找了半小时 哎 #include <iostream> #include <vector> #include <string> #include <cstdio> using namespace std; vector<int> vt[30]; int main() { int n; ...
2018-11-27 01:10:20 155
原创 Flooded! UVA - 815 二分
怎么说呢,果然题目做多了思路也就多了,看到这一题,马上想到2分水的体积,写了一下wa了 错在少考虑了负数的情况所以改了一下二分搜素的上下界就a掉了 #include <iostream> #include <cmath> #include <algorithm> using namespace std; const double eps=1e-8; i...
2018-11-26 19:36:36 138
原创 Extraordinarily Tired Students UVA - 12108
简单模拟特别困的学生,此刻我也挺困的昨晚写到1点多没过早上起来看了一下代码发现一个地方写错了,果然太晚的话自己的脑子思考的很差啊, 我是这样的做的弄一个结构体,里面存睡觉时间,清醒时间,状态(0是清醒,1是睡觉)时间(t1表示还能清醒几分钟,t2表示还能睡几分钟)只要对时间做减然后特判时间为0的时候就可以 #include <iostream> using namespace ...
2018-11-26 12:56:28 126
原创 Morse Mismatches UVA - 508
字符串匹配 #include <iostream> #include <map> #include <string> using namespace std; map<char,string>mp1; map<string,string>mp2; int main() { char s; string str;...
2018-11-25 20:44:28 157
原创 Othello UVA - 220
过了udebug的所有数据以及各种数据但是就是wa不知道为什么 哎 只能先放着了 以后再来写写看把 #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <algorithm> using namespace std...
2018-11-23 20:52:54 205
原创 Xiangqi UVA - 1589
终于a掉了 很痛苦自己代码写得也很臭300多行大模拟 我的思路: 用两个二维数组分别为a,b,a用来表示地图上的落子,b表示能够被杀死的点,把所以的能杀死的点找出来后,对将军进行上下左右四个方向进行判断是不是都是被标记的点,如果存在没有被标记的点那么就没有将死 标记方法:红帅从该点x坐标开始递减对所有没有标记的点做杀死标记直到碰到一个点是有落子的点,如果是将军就停止说明将军与帅碰面将军赢,...
2018-11-21 19:25:07 179
原创 螺旋矩阵
暴力模拟填数字 #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> using namespace std; int main() { int n; int map[30][30]; int num[30][30]; ...
2018-11-19 20:33:36 140
原创 The Dole Queue UVA - 133
简单模拟主要这个输出有点蛋疼 自己代码太丑 #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> using namespace std; int main() { int n,k,m; int num[111]; in...
2018-11-19 14:36:26 78
原创 Ancient Cipher UVA - 1339
学习别人 !!! #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { string str1,str2; while(cin>>str1>>str2) { ...
2018-11-19 00:21:37 95
原创 Kickdown UVA - 1588
又愚蠢了 自己代码写的臭 那我就给个数据把 21 2222 2222 21 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int main() { char str1[11...
2018-11-16 15:43:02 128
原创 Box UVA - 1587
规律 #include <iostream> #include <cstdio> #include <algorithm> using namespace std; struct node { int a,b; }; node num[10]; bool cmp(node &x,node &y) { if(x.a==y...
2018-11-15 13:38:25 114
原创 Repeating Decimals UVA - 202
300题,,700加油 紫薯13 在慢慢改变自己的代码风格,自己总是会考虑很多但是队友说的对我不需要考虑那么多应该学会什么是需要特判什么是可以归类在一起的 #include <iostream> #include <map> #include<string.h> #include<cstdio> using namespace std; ...
2018-11-13 11:54:52 126
原创 Crossword Answers UVA - 232
紫薯11 看清楚题目意思简单模拟注意初始化以及格式 #include <iostream> #include <stdlib.h> #include <string.h> #include <cstdio> using namespace std; int main() { int n,m; char str[20][20];...
2018-11-12 14:40:49 76
原创 Periodic Strings UVA - 455
简单模拟 记得初始化 #include <iostream> #include <string> using namespace std; int main() { string str; int n; cin>>n; //getchar(); while(n--) { int fgg=0...
2018-11-09 18:24:54 135
原创 Molar mass UVA - 1586
9 简单模拟 #include <iostream> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; map<char,double> mp; char str[1111]; i...
2018-11-09 11:05:33 204
原创 Digit Counting UVA - 1225
8 主义mapclear细节 #include <iostream> #include <map> #include <cstdio> using namespace std; map<int,int> mp; int main() { int n; cin>>n; while(n--) { ...
2018-11-09 11:04:57 61
原创 Score UVA - 1585
7 注意初始化 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> using namespace std; char str[1111]; int main() { int n; cin>>n; getc...
2018-11-09 09:25:41 108
原创 Circular Sequence UVA - 1584
6 #include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n; cin>>n; string s,ss[111]; while(n--) { s.c...
2018-11-08 16:54:29 83
原创 Digit Generator UVA - 1583
5 #include <iostream> #include <cstdio> using namespace std; int main() { int m; cin>>m; while(m--) { int n; cin>>n; int fg=0; ...
2018-11-08 16:12:59 74
原创 Master-Mind Hints UVA - 340
#include <iostream> #include <cstdio> #include <map> using namespace std; map<int ,int > mp; int main() { int n; int num[1111]; int num2[1111]; int sum=1; ...
2018-11-08 15:13:46 113
原创 Palindromes UVA - 401
紫薯-3 读懂题意就可以 #include <iostream> #include <map> #include <cstdio> #include <cstring> using namespace std; map<char,char> mp; char str[11111]; int main() { mp['A...
2018-11-07 21:59:26 686
原创 WERTYU UVA - 10082
紫薯-2 #include <iostream> #include <map> #include <cstdio> using namespace std; char str[]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;\'ZXCVBNM,./"; map <char,char> mp; char s[...
2018-11-07 17:11:34 132
原创 TEX Quotes UVA - 272
紫薯训练-1 字符串转换 #include<iostream> #include <cstdio> using namespace std; int main() { char c; int cont=0; while(scanf("%c",&c)!=EOF) { if(c=='"') { ...
2018-11-07 16:33:14 131
原创 ZOJ Problem Set - 4067 Books
#include <iostream> #include <algorithm> #include <cstdio> using namespace std; long long num[111111]; int main() { int T; cin>>T; while(T--) { int...
2018-11-07 16:23:46 358
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人