NYOJ1112求次数
来源:互联网 发布:java做界面的工具 编辑:程序博客网 时间:2024/05/29 10:09
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=1112
用set水了好几遍才过的。。。
#include <string>#include <iostream>#include <set>#include <cstdio>using namespace std;set<string> st;int main(){ int t; scanf("%d",&t); while(t--) { int ans = 0; string s; int n; scanf("%d",&n); cin >> s; int len = st.size(); for(int i = 0; i <= s.length() - n; ++i) { string te = s.substr(i,n); st.insert(te); if(len == st.size()) ans++; else len = st.size(); } printf("%d\n",ans); st.clear(); }}
0 0
- NYOJ1112【求次数】
- NYOJ1112求次数
- NYOJ1112 求次数
- nyoj1112求次数(map的用法)
- nyoj1112-求次数(map或set)
- nyoj1112 求次数 (对结构体字符串排序)
- 求次数
- 求次数
- 求次数
- 求次数
- 求次数
- 求次数
- 求次数
- 求次数
- NYOJ--1112--求次数
- NYOJ 求次数
- nyoj-1112-求次数
- nyoj 1112 求次数
- 神奇的递归
- 内容提供者 ContentProvide简单示例
- 阿里系技术博客原力觉醒,首批36支梦之队亮相云栖社区!
- QT读取access是数据库表名中文乱码
- Servlet写验证码
- NYOJ1112求次数
- Java中的数组
- Spring事务之如何保证同一个Connection对象
- css的定位:
- 【Android】Mainifest文件手动添加Activity
- c++上机实验3定期存款利息计算器
- UIWebView的加载本地数据的三种方式
- Windows Dev Intro - Register Dll
- 第七周项目3 角色类组合多文件