if(isalpha(s[j])){//判断该字符是否是字母,排除空格符及?号等情况 a[tolower(s[j]) - 'a'].num++;//tolower(s[j])将所有字符都穿换成小写 } } } sort(a,a+26,cmp); for(i = 0 ; i < 26 ; ++i){ if(a[i].num !=0){ printf("%c %d\n",(a[i].id +'A'),a[i].num...
(water ver.) 10008 - What's Cryptanalysis? Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=949 Cryptanalysis is the process of breaking someone else's cryptographic writing. This sometimes involves some kind o...
UVA 10008 - What's Cryptanalysis 解析:相比于HDU的排序题来说,很简单了。秒过。 启示:按照某一元素排序可以用结构体,甚至可以把每一个单元看成一个对象。 1#include <stdio.h>2#include <string.h>3structzifu{4charch;5intnum;6}a[26];7intmain()8{9intn, i, j, t;10charc, temp;11scanf("...
10008 What's Cryptanalysis? 统计题目 直接统计 10009 All Roads Lead Where? 最短路径 典型的最短路径模型 10010 Where's Waldorf? 模拟题目 直接找了 注意要输出左上的 10011 Where Can You Hide? 计算几何 公式要仔细推一推 还要注意树和源位置的特殊情况 10012 How Big Is It? 搜索题目 典型搜索...
10008 - What's Cryptanalysis.cpp │ ├── 10010 - Where's Waldorf.cpp │ ├── 10012 - How Big Is It.cpp │ ├── 10013 - Super long sums.cpp │ ├── 10014 - Simple calculations.cpp │ ├── 10015 - Joseph's Cousin.cpp │ ├── 10017 - The Never Ending Towers of ...
UVa10008_WhatsCryptanalysis.java UVa10009_AllRoadsLeadWhere.java UVa10010_WheresWaldorf.java UVa10013_Superlongsums.java UVa10015_JosephsCousin.java UVa10018_ReverseandAdd.java UVa10019_FunnyEncryptionMethod.java UVa10020_Minimalcoverage.java UVa10033_Interpreter.java UVa10034_Freckles.java UVa10035_Primary...
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <cctype> using namespace std; const int maxn=10008; struct Goods{ int p,d; }s[maxn]; struct Small_Heap{ int n,heap[maxn]; inline void up(int fa){ while(fa>1){ if(heap[fa]<heap[fa>>1]...
1. #include <iostream> #include <cstdio> #include <algorithm> using namespace std; struct _Node{ int left; int right; }; bool cmp(_Node rhs1, _Node rhs2) { return rhs1.left < rhs2.left; } const int MAXN = 100000 + 1; ...
注意strcpy()和strcat()的组合使用技巧。 完整代码: /*0.015s*/ #include<cstdio> #include<cstring> char find[50][100], rep[50][100], str[300], tmp[1000]; int main(void) { int t, i; char *beg, *end; while (scanf("%d\n", &t), t) ...
10008 - What's Cryptanalysis.cpp │ ├── 10010 - Where's Waldorf.cpp │ ├── 10012 - How Big Is It.cpp │ ├── 10013 - Super long sums.cpp │ ├── 10014 - Simple calculations.cpp │ ├── 10015 - Joseph's Cousin.cpp │ ├── 10017 - The Never Ending Towers of ...