Submission #2510123
Source Code Expand
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <fstream>
#include <queue>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <sstream>
#define For(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) For(i,0,n)
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define SORT(c) sort((c).begin(),(c).end())
#define vi(m,a) vector<int> m(a)
#define vti(m,a,i) vector<vector<int>> m(a,vector<int>(i))
#define ALL(it,a) for(auto it = a.begin(); it!=a.end(); it++)
#define Fe(it,a) for(auto &it : a)
#define all(a) begin(a),end(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007;
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
ll kyori(int a, int b, int c) {
int k = max(a, b);
int l = min(a, b);
return(min(abs(k - l), abs(k - l - c)));
}
int main() {
set<string> ss;
string str;
cin >> str;
int count;
cin >> count;
rep(i, str.length()) {
rep(k, str.length()) {
if (k > count)
break;
ss.insert(str.substr(i,k + 1));
}
}
int current = 0;
ALL(it, ss) {
current++;
if (count == current) {
cout << *it << endl;
break;
}
}
}
Submission Info
| Submission Time |
|
| Task |
C - K-th Substring |
| User |
admjgptw1357 |
| Language |
C++14 (GCC 5.4.1) |
| Score |
300 |
| Code Size |
1346 Byte |
| Status |
AC |
| Exec Time |
13 ms |
| Memory |
2176 KiB |
Judge Result
| Set Name |
Sample |
Subtask |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
100 / 100 |
| Status |
|
|
|
| Set Name |
Test Cases |
| Sample |
0_000.txt, 0_001.txt, 0_002.txt |
| Subtask |
0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt |
| All |
0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 2_011.txt, 2_012.txt, 2_013.txt, 2_014.txt, 2_015.txt, 2_016.txt, 2_017.txt, 2_018.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 0_000.txt |
AC |
1 ms |
256 KiB |
| 0_001.txt |
AC |
1 ms |
256 KiB |
| 0_002.txt |
AC |
1 ms |
256 KiB |
| 1_003.txt |
AC |
1 ms |
256 KiB |
| 1_004.txt |
AC |
1 ms |
256 KiB |
| 1_005.txt |
AC |
1 ms |
256 KiB |
| 1_006.txt |
AC |
1 ms |
256 KiB |
| 1_007.txt |
AC |
1 ms |
256 KiB |
| 1_008.txt |
AC |
1 ms |
256 KiB |
| 1_009.txt |
AC |
1 ms |
256 KiB |
| 1_010.txt |
AC |
1 ms |
256 KiB |
| 2_011.txt |
AC |
7 ms |
256 KiB |
| 2_012.txt |
AC |
6 ms |
256 KiB |
| 2_013.txt |
AC |
13 ms |
1920 KiB |
| 2_014.txt |
AC |
13 ms |
2176 KiB |
| 2_015.txt |
AC |
10 ms |
1664 KiB |
| 2_016.txt |
AC |
13 ms |
2176 KiB |
| 2_017.txt |
AC |
13 ms |
2176 KiB |
| 2_018.txt |
AC |
13 ms |
2176 KiB |