Submission #1213026


Source Code Expand

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<functional>
#include<list>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<string.h>
#include<limits.h>
using namespace std;

string x[10001];
string y[10001];
signed main() {
	int b;
	cin >> b;
	for (int c = 0; c < b; c++) {
		string d; cin >> d;
		string e, f;
		for (char g : d) {
			if (g == '?') {
				e += 'a';
				f += 'z';
			}
			else {
				e += g;
				f += g;
			}
		}
		x[c] = e;
		y[c] = f;
	}
	string S; cin >> S;
	x[b] = y[b] = S;
	sort(x, x + b + 1);
	sort(y, y + b + 1);
	bool K = false;
	vector<int>V;
	for (int i = 0; i <= b; i++) {
		if (y[i] == S) {
			K = true;
		}
		if (K)V.push_back(i + 1);
		if (x[i] == S) {
			K = false;
		}
	}
	for (int i = 0; i< V.size(); i++) {
		if (i)cout << " ";
		cout << V[i];
	}
	puts("");
}

Submission Info

Submission Time
Task A - Atcoder Handles
User naoki2016
Language C++14 (GCC 5.4.1)
Score 250
Code Size 970 Byte
Status AC
Exec Time 21 ms
Memory 1536 KB

Judge Result

Set Name Subtask1 Subtask2
Score / Max Score 130 / 130 120 / 120
Status
AC × 3
AC × 6
Set Name Test Cases
Subtask1 sub1_in1.txt, sub1_in2.txt, sub1_in3.txt
Subtask2 sub1_in1.txt, sub1_in2.txt, sub1_in3.txt, sub2_in1.txt, sub2_in2.txt, sub2_in3.txt
Case Name Status Exec Time Memory
sub1_in1.txt AC 1 ms 384 KB
sub1_in2.txt AC 2 ms 512 KB
sub1_in3.txt AC 2 ms 512 KB
sub2_in1.txt AC 2 ms 384 KB
sub2_in2.txt AC 11 ms 1024 KB
sub2_in3.txt AC 21 ms 1536 KB