首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
mlx
2026年3月8日 18:01
变位词 题解:
P1032
回复 0
|
赞 1
|
浏览 47
#include<iostream> #include<map> using namespace std; int n; bool check2(string a,string b) { int sum1=0,sum2=0; for(int i=0;i<a.size();i++) sum1+=a[i]-'a'; for(int i=0;i<b.size();i++) sum2+=b[i]-'a'; if(sum1!=sum2) return false; ...
yanmy
2024年3月23日 19:32
变位词 题解:统计各字母数量
P1032
回复 1
|
赞 36
|
浏览 1.7k
#include <stdio.h> #include <string.h> int main() { int n; scanf("%d", &n); while (n--) { char a[1000], b[1000]; int a1[26] = {0}, b1[26] = {0}; scanf("%s %s", a, b); int lena = strlen(a), lenb = strlen(b), flag = 1; ...
dxuxu
2026年2月14日 18:55
变位词 题解:
P1032
回复 0
|
赞 11
|
浏览 183
受到另一个题解的启发,将字符串排序后直接比较是否相等(无比简洁) #include<bits/stdc++.h> using namespace std; string str1; string str2; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>str1>>str2; stable_sort(str1.begin(),str1.end()); stable_sort(str2.begin(),str2.en...
曾不会
2026年2月7日 14:51
变位词 题解:
P1032
回复 0
|
赞 0
|
浏览 180
n=int(input()) for ii in range(n): s=list(map(str,input().split())) s1=s[0] s2=s[1] t1=[] t2=[] for i in s1: t1.append(i) tt1=sorted(t1) for i in s...
xsw
2026年2月6日 12:23
变位词 题解:
P1032
回复 0
|
赞 4
|
浏览 205
#include<iostream> #include<algorithm> using namespace std; int main() { int n; cin >> n; while (n -- ) { string s1, s2; cin >> s1 >> s2; sort(s1.begin(), s1.end()); sort(s2.begin(), s2.end()); if (s1 == s2) puts("Yes"); else pu...
yauqq
2026年1月28日 16:33
变位词 题解:
P1032
回复 0
|
赞 0
|
浏览 161
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; string str1,str2; for(int i = 0; i < n; i++){ cin >> str1 >> str2; sort(str1.begin(),str1.end()); sort(str2.begin(),str2.end()); if(st...
bro
2026年1月19日 23:46
变位词 题解:1.直接删除 2.排序
P1032
回复 0
|
赞 2
|
浏览 215
#include <bits/stdc++.h> using namespace std; int main() { int n ; cin >> n; while(n--) { string s1,s2; cin >> s1 >> s2; ...
zxjrheaven
2025年3月23日 16:41
变位词 题解:暴力
P1032
回复 0
|
赞 13
|
浏览 1.1k
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=0;i<n;i++) { char str1[1005]; char ...
xiaowaya
2025年3月23日 16:32
变位词 题解:简单sort 然后strcmp就行了
P1032
回复 0
|
赞 15
|
浏览 1.4k
#include<bits/stdc++.h> #include<string> #include<string.h> using namespace std; void sort(char s[100]){ int len=strlen(s); for(int i=0;i<len;i++){ for(int j=0;j<len-1;j++){ &n...
阿灿
2025年3月15日 06:26
变位词 题解:直接删除 很爽的
P1032
回复 0
|
赞 10
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int main(){ int n,flag; string a,b; cin>>n; while(n--){ cin>>a>>b; flag = 0; for(char c:a){ if(b.find(c)!= string::npos){ b.erase(b.find(c),1); }else{ cout<<"No"<<endl; ...
1
2
3
题目
变位词
题解数量
25
发布题解
在线答疑
热门题解
1
变位词 题解:统计各字母数量
2
变位词 题解:c-排序直接比较大小
3
变位词 题解:简单sort 然后strcmp就行了
4
变位词 题解:暴力
5
变位词 题解qsort排序
6
变位词 题解:
7
变位词 题解:直接删除 很爽的
8
变位词 题解:先sort()排序再比较
9
变位词 (哈希表)题解:
10
输入字符串s1与s2,比较字符串s2是否为字符串s1变换而来