Submission #1213011


Source Code Expand

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;

int n;
vector<string> v;

#define MAX 100002
char buf[MAX];
string t;

string conv(string f,char tt){
	for (int i = 0; i < f.size(); i++){
		if (f[i] == '?'){
			f[i] = tt;
		}
	}
	return f;
}
int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		scanf("%s", buf);
		v.push_back(buf);
	}
	cin >> t;
	int LES = 0;
	int B = 0;
	for (int i = 0; i < n; i++){
		bool can_less = (conv(v[i], 'a')  <= t);
		bool can_great = (conv(v[i], 'z') >= t);
		if (can_less == false || can_great == false){
			if (can_less == true){
				LES++;
			}
		}
		else{
			B++;
		}
	}
	for (int i = 0; i <= B; i++){
		if (i){
			printf(" ");
		}
		printf("%d", LES + i + 1);
	}
	puts("");
	return 0;
}

Submission Info

Submission Time
Task A - Atcoder Handles
User Kmcode
Language C++14 (GCC 5.4.1)
Score 250
Code Size 818 Byte
Status AC
Exec Time 6 ms
Memory 768 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:24:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", buf);
                   ^

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 256 KB
sub1_in2.txt AC 1 ms 256 KB
sub1_in3.txt AC 2 ms 256 KB
sub2_in1.txt AC 1 ms 256 KB
sub2_in2.txt AC 4 ms 512 KB
sub2_in3.txt AC 6 ms 768 KB