摘要:
既然要按PATest的顺序输出,那么就开一个数组cnt[6], 用来记录六个字符分别出现的个数(同时用一个变量tot记录总个数)。这样在读入字符串之后,就可以直接统计出这个数组。 遍历cnt数组,如果cnt[j]不为0,那么输出dict[i],并让cnt[i]减1、sum减1。如果sum变为0,那么 阅读全文
posted @ 2021-02-17 19:43
Dazzling!
阅读(29)
评论(0)
推荐(0)
摘要:
水~。 map<char,int> mp; int main() { string s; getline(cin,s); for(auto t:s) if(isalpha(t)) mp[tolower(t)]++; char c='a'; for(auto t:mp) if(t.se > mp[c] 阅读全文
posted @ 2021-02-17 19:24
Dazzling!
阅读(26)
评论(0)
推荐(0)
摘要:
水题~。 注意:商店每串珠子都不拆开售卖,只能整串购买。 map<char,int> mpa,mpb; string a,b; int main() { cin>>a>>b; for(auto t:a) mpa[t]++; for(auto t:b) mpb[t]++; int buy=0,miss 阅读全文
posted @ 2021-02-17 18:58
Dazzling!
阅读(53)
评论(0)
推荐(0)
摘要:
水题。 int cnt[105]; int n,m; int main() { cin>>n; for(int i=0;i<n;i++) { int x; cin>>x; cnt[x]++; } cin>>m; for(int i=0;i<m;i++) { int x; cin>>x; if(i) 阅读全文
posted @ 2021-02-17 18:26
Dazzling!
阅读(14)
评论(0)
推荐(0)
摘要:
兄弟题1084 Broken Keyboard (20 分),一样的水~。 ps:`当按键都没坏的时候,输入可能为空,要用getline而不能用cin。 bool vis[200]; string a,b; int main() { getline(cin,a); getline(cin,b); f 阅读全文
posted @ 2021-02-17 17:13
Dazzling!
阅读(24)
评论(0)
推荐(0)
摘要:
水题~。 set<char> S; set<char> res; string a,b; int main() { cin>>a>>b; for(auto t:b) { t=toupper(t); S.insert(t); } for(auto t:a) { t=toupper(t); if(S.c 阅读全文
posted @ 2021-02-17 16:59
Dazzling!
阅读(10)
评论(0)
推荐(0)
摘要:
屑题。 题意 给出两个数,将它们写成保留N位小数的科学计数法后是否相等。如果相等,则输出YES,并给出该转换结果;如果不相等,则输出NO,并分别给出两个数的转换结果。 题目的要求是将两个数改写为科学计数法的形式,然后判断它们是否相等。而科学计数法的写法一定是如下格式:$0.a_1a_2a_3 \cd 阅读全文
posted @ 2021-02-17 16:40
Dazzling!
阅读(37)
评论(0)
推荐(0)
摘要:
原代码,在$\color$上能取得$25pts$的满分好成绩,但在其他地方都超时了,gg。 set<int> S[55]; double res[55][55]; int n,m; void init() { for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++) 阅读全文
posted @ 2021-02-17 12:07
Dazzling!
阅读(20)
评论(0)
推荐(0)
摘要:
兄弟题1039 Course List for Student (25 分),一样很水。 vector<string> course[2510]; int n,m; int main() { cin>>n>>m; for(int i=0;i<n;i++) { string name; name.re 阅读全文
posted @ 2021-02-17 11:20
Dazzling!
阅读(23)
评论(0)
推荐(0)
摘要:
水题,用c++读入最后一个点会超时。 const int N=40010; map<string,vector<int>> mp; int n,m; int main() { cin>>n>>m; while(m--) { int course,k; scanf("%d%d",&course,&k) 阅读全文
posted @ 2021-02-17 11:12
Dazzling!
阅读(15)
评论(0)
推荐(0)

浙公网安备 33010602011771号