Submission #4071485
Source Code Expand
#include <iostream> #include <queue> #include <algorithm> #include <vector> using namespace std; int main(void){ string s; cin>>s; int k; cin>>k; priority_queue<string,vector<string>,greater<string>> que; for(int i=0;i<s.length();++i){ string now = ""; for(int j=i;j<s.length();++j){ now += s[j]; que.push(now); } } int count = 0; string prev = ""; while(1){ if(que.top() == prev){ que.pop(); continue; }count++; if(count == k){ cout<<que.top()<<endl; break; } prev = que.top(); que.pop(); } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Colorful Transceivers |
User | untan |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 720 Byte |
Status | RE |
Exec Time | 327 ms |
Memory | 764 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | RE | 327 ms | 764 KB |
0_001.txt | RE | 98 ms | 256 KB |
0_002.txt | RE | 98 ms | 256 KB |
0_003.txt | RE | 97 ms | 256 KB |
1_003.txt | WA | 1 ms | 256 KB |
1_004.txt | WA | 1 ms | 256 KB |
1_005.txt | RE | 97 ms | 256 KB |
1_006.txt | RE | 97 ms | 256 KB |
1_007.txt | RE | 96 ms | 256 KB |
1_008.txt | RE | 98 ms | 256 KB |