当前位置:网站首页>1094 - Google recruitment
1094 - Google recruitment
2022-07-25 09:44:00 【Freak I life】
#include
#include
#include
using namespace std;
int main()
{
int l,k,a,i,j;
cin >> l >> k;
string s;
cin >> s;
for(i = 0; i < (l-k+1); i++)
{
a = stoi(s.substr(i,k),0,10);
for(j = 2 ; j <= int(sqrt(a)); j++)
{
if(a%j==0)
{
break;
}
}
if(j == int(sqrt(a))+1){
cout << s.substr(i,k) <<endl;
break;
}
}
if(i>=(l-k+1)){
cout << “404” <<endl;
}
return 0;
}
边栏推荐
猜你喜欢
随机推荐
学生管理系统(总结)
Flutter Rive 多状态例子
OC--Foundation--字符串+日期和时间
MinkowskiEngine 安装
【数据挖掘】第三章 数据分析基础
pdf2Image Pdf文件存为jpg NodeJs实现
chmod和chown对挂载的分区的文件失效
【cf】Round 128 C. Binary String
How to convert object data into arrays
[code source] daily question - queue
服务器cuda toolkit多版本切换
自定义 view 实现兑奖券背景[初级]
Kotlin协程:协程的基础与使用
Redis installation (Ubuntu)
Swift简单实现待办事项
初识Opencv4.X----在图像上绘制形状
[code source] a prime number of fun every day (BFS)
什么是脑裂问题?
OC -- Foundation -- array
初识Opencv4.X----图像直方图均衡









