2304. Japan Plotter Driver
摘要:模拟题View Code 1 #include <cstdio> 2 #include <cstring> 3 4 int m, n; 5 char map[76][76]; 6 7 void swap(int &x, int &y) 8 { 9 int tmp = x; 10 x = y, y = tmp; 11 } 12 13 void print() 14 { 15 for (int i=0; i<m; i++) 16 { 17 if(!i) printf("+"); 18 printf...
阅读全文
2911. Deli Deli
摘要:水题一枚。题目大意:按照题目要求将所给单词转化为复数形式。View Code 1 #include <iostream> 2 #include <map> 3 #include <cstring> 4 5 using namespace std; 6 7 int main() 8 { 9 map<string, string>M;10 map<char, int>S;11 int l,n;12 S['a'] = 1, S['e'] = 1;13 S['i'] = 1, S['o&
阅读全文
2807. Number Sort
摘要:题目大意:给若干个数字,将他们按照个位、十位、百位、、、上的数字排序,如果该数字没有此位的话,加按照0处理。这个题目如果单纯枚举排序的话会超时,可以用字符串的方式进行解题。View Code 1 #include <cstdio> 2 #include <algorithm> 3 #include <iostream> 4 #include <cstring> 5 6 using namespace std; 7 8 struct N 9 {10 string num;11 int d;12 }number[1003];13 14 int cal
阅读全文
3206. Dairy Queen
摘要:题目大意:给你几种价值的钱币,问能有几种组合方式可以组成所给的钱数(每种钱币假设有无限多个)View Code 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 5 using namespace std; 6 7 int dp[302], ans[302];//dp[i]表示钱数到达i的方法个数; 8 int n, c[10], cnt; 9 //利用动态规划的思想来解题;10 int main()11 {12 int j, i, k, tem;13 ...
阅读全文