Submission #1213102
Source Code Expand
#include <iostream> #include <fstream> #include <vector> #include <string> #include <algorithm> #include <set> #include <map> #include <cmath> #include <cstring> using namespace std; #define fi first #define se second typedef long long LL; typedef long double LD; int N; string s[10010],t; int comp(string a, string b){ int i; for (i=0; i<min(a.length(),b.length()); i++) if (a[i]<b[i]) return -1; else if (a[i]>b[i]) return 1; if (a.length()==b.length()) return 0; else if (a.length()<b.length()) return -1; return 1; } int main(){ cin >> N; int i,j,cnt_b=0,cnt_s=0; for (i=1; i<=N; i++) cin >> s[i]; cin >> t; for (i=1; i<=N; i++){ bool sml=0,big=0; string aux=s[i]; for (j=0; j<aux.length(); j++) if (aux[j]=='?') aux[j]='a'; if (comp(aux,t)<1) sml=1; aux=s[i]; for (j=0; j<aux.length(); j++) if (aux[j]=='?') aux[j]='z'; if (comp(aux,t)>-1) big=1; if (sml && !big) cnt_s++; else if (big && !sml) cnt_b++; } for (i=cnt_s+1; i<=N+1-cnt_b; i++) cout << i << " "; cout << "\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | yoseisan |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1250 Byte |
Status | WA |
Exec Time | 13 ms |
Memory | 896 KB |
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 | 7 ms | 640 KB |
sub2_in3.txt | WA | 13 ms | 896 KB |