/ Randle /

记录详情

Memory Exceeded


  
# 状态 耗时 内存占用
#1 Wrong Answer 3ms 3.324 MiB
#2 Wrong Answer 3ms 3.316 MiB
#3 Wrong Answer 3ms 3.25 MiB
#4 Wrong Answer 3ms 3.316 MiB
#5 Time Exceeded ≥1001ms ≥21.348 MiB
#6 Time Exceeded ≥1001ms ≥21.648 MiB
#7 Time Exceeded ≥1001ms ≥3.379 MiB
#8 Memory Exceeded ≥683ms ≥256.0 MiB
#9 Memory Exceeded ≥574ms ≥256.0 MiB
#10 Memory Exceeded ≥601ms ≥256.0 MiB

代码

#include<bits/stdc++.h>
using namespace std;
string sss,s[100000];
int main()
{
	int n,m;
	cin>>n>>m;
	cin>>sss;
	int k=0;
	for (int i=0;i<=n-1;i++)
	{
		k++;
		for (int j=i;j<=i+m-1;j++)
		{
			s[k]+=sss[j];
		}
	}
	for (int i=1;i<=k;i++)
	cout<<s[i]<<endl;
	int ans=0;
	for (int i=1;i<=k-1;i++)
	for (int j=i+1;j<=k;j++)
	if (s[i]>s[j]) swap(s[i],s[j]),ans++;
	cout<<ans;
}

信息

递交者
类型
递交
题目
后缀数组
题目数据
下载
语言
C++
递交时间
2019-12-13 15:50:48
评测时间
2019-12-13 15:50:48
评测机
分数
0
总耗时
≥4879ms
峰值内存
≥256.0 MiB