Submission #1387041
Source Code Expand
#include<bits/stdc++.h>
using std::string;
const int maxN = 1e4 + 5;
string replace(string s,char a,char b) {
for(auto &c : s)
if(c == a) c = b;
return s;
}
int N;
string S[maxN], T;
int main() {
if(fopen("input.txt","r")) {
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
std::cin >> N;
for(int i = 1;i <= N; ++i)
std::cin >> S[i];
std::cin >> T;
int a = 0, b = 0;
for(int i = 1;i <= N; ++i) {
string s = S[i];
// if(s.size() == T.size()) {
// bool flag = true;
// for(int i = 0;i < (int) s.size(); ++i)
// if(s[i] != '?' && s[i] != T[i]) flag = false;
// if(flag) continue;
// }
string s0 = replace(s, '?', 'a');
string s1 = replace(s, '?', 'z');
//assert(s0 <= s1);
if(s1 < T) ++a;
if(s0 > T) ++b;
}
for(int i = a + 1;i < N+1-b; ++i)
printf("%d ", i);
printf("%d", N+1-b);
return 0;
}
Submission Info
Submission Time |
|
Task |
A - Atcoder Handles |
User |
dataisland |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
988 Byte |
Status |
WA |
Exec Time |
11 ms |
Memory |
896 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:17:35: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen("input.txt","r",stdin);
^
./Main.cpp:18:37: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen("output.txt","w",stdout);
^
Judge Result
Set Name |
Subtask1 |
Subtask2 |
Score / Max Score |
0 / 130 |
0 / 120 |
Status |
|
|
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 |
WA |
1 ms |
384 KB |
sub1_in2.txt |
WA |
2 ms |
384 KB |
sub1_in3.txt |
WA |
2 ms |
384 KB |
sub2_in1.txt |
WA |
1 ms |
384 KB |
sub2_in2.txt |
WA |
6 ms |
640 KB |
sub2_in3.txt |
WA |
11 ms |
896 KB |