首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
wwj0102
2025年3月15日 21:15
后缀子串排序 题解:
P1294
回复 0
|
赞 12
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ int ls = s.length(); string t[ls]; string s1 = ""; for(int i = ls - 1; i >= 0; i--){ s1 = s[i] + s1; t[i] = s1; } sort(t,t + ls); for(int i = 0; i < ls; i++...
zxjrheaven
2025年3月14日 13:01
后缀子串排序 题解:暴力,利用map自己喜欢排序的特性
P1294
回复 0
|
赞 2
|
浏览 1.1k
#include <bits/stdc++.h> using namespace std; int main() { string str; while(cin>>str) { map<string,int> mp; while(!str.empty()) ...
shiv15832
2025年3月10日 21:31
后缀子串排序 题解:
P1294
回复 0
|
赞 6
|
浏览 1.3k
显然解题分两步:1,获取子串。2,字典排序。 字典排序很简单,sort函数自然对字符串进行字典排序。而获取子串可以用c++自带的substr函数,具体用法不清楚的可以查一下CSDN或者Deepseek都可以,那么就基本解决了题目,只需要用一个vector存储截取下来的字符串就可以了。 代码: #include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; &nb...
可可爱爱草莓派
2024年8月27日 08:51
参考大家的三种方法
P1294
回复 0
|
赞 31
|
浏览 2.7k
#include<bits/stdc++.h> using namespace std; string str[1010]; //方法一 //int main(){ // string s; // cin >> s; // int len = s.size(); // for(int i = 0;i < len;i++){ // str[i] = s.substr(i,len - i)...
Candour
2024年5月26日 11:03
后缀子串排序(C++) 题解:
P1294
回复 0
|
赞 2
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; string str; int main() { while(cin >> str) { vector<string> a; int n = str.size(); for(int i = 0; i < n; i ++) a.push_back(str.substr(i, n - i)); so...
carrot_huan
2024年3月18日 15:27
后缀子串排序 题解:substr+sort
P1294
回复 0
|
赞 1
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { vector<string> substr; for (int i = 0; i < s...
huanghu
2024年3月16日 16:57
后缀子串排序 题解:C++ sort
P1294
回复 0
|
赞 3
|
浏览 1.5k
#include<stdio.h> #include<iostream> #include<algorithm> #include<string> using namespace std; int main(){ string str; string arr[100]; while(cin>>str){ int len = str.length(); for(int i = 0; i<len; i++){ string s = ""; for(int j = i; ...
sinkorswim
2024年3月14日 20:24
后缀子串排序 C++ map
P1294
回复 0
|
赞 2
|
浏览 1.1k
#include<bits/stdc++.h> using namespace std; int main(){ string s; int i,len; while(cin>>s){ map<string,int> m; len=s.size();...
promising
2024年3月8日 15:43
后缀子串排序 题解:
P1294
回复 0
|
赞 4
|
浏览 1.4k
#include<stdio.h> #include<string.h> int main() { char a[100]; char b[100][100]; int i,j; char t[100]; while(scanf("%s",&a)!=EOF){ &nbs...
williams
2024年3月8日 15:41
后缀子串排序 题解: c
P1294
回复 0
|
赞 8
|
浏览 1.3k
#include <stdio.h> #include <stdbool.h> #include <math.h> #include <string.h> #include <ctype.h> int main( ){ char s[100]; int j; while(fgets(s, sizeof(s), stdin)){ int len = strlen(s); if (s[len - 1] == '\n') s[len - 1] = '\...
1
2
3
题目
后缀子串排序
题解数量
30
发布题解
在线答疑
热门题解
1
参考大家的三种方法
2
后缀子串排序 题解:
3
后缀子串排序 题解: c
4
使用string类
5
后缀子串排序 题解:
6
后缀子串排序 题解:
7
后缀子串排序 题解:
8
后缀子串排序 题解:C++ sort
9
后缀子串排序 题解:
10
string类在后缀字符串的应用