Submission #1213091
Source Code Expand
#include <bits/stdc++.h> using namespace std ; const int MAXN = 1e6 + 100 ; pair<string , int> p[MAXN] ; string t[MAXN] ; int32_t main(){ ios_base::sync_with_stdio(0) ; cout . tie(0) ; cin . tie(0) ; int n ; cin >> n ; for(int i = 0 ; i < n ; i ++) cin >> t[i] ; string s ; cin >> s ; for(int i = 0 ; i < n ; i ++){ p[i] . first = t[i] ; p[i] . second = i ; for(int j = 0 ; j < t[i] . size() ; j ++) if(t[i][j] == '?') p[i] . first[j] = 'a' ; } p[n] . first = s ; p[n] . second = n ; sort(p , p + n + 1) ; int mn = 0 ; while(p[mn] . second != n)mn ++ ; for(int i = 0 ; i < n ; i ++){ p[i] . first = t[i] ; p[i] . second = i ; for(int j = 0 ; j < t[i] . size() ; j ++) if(t[i][j] == '?') p[i] . first[j] = 'z' ; } p[n] . first = s ; p[n] . second = -1 ; sort(p , p + n + 1) ; int mx = 0 ; while(p[mx] . second != -1)mx ++ ; for(int i = mx ; i <= mn ; i ++) cout << i + 1 << ' ' ; }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | Akbari |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 991 Byte |
Status | WA |
Exec Time | 21 ms |
Memory | 24704 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 | 9 ms | 23680 KB |
sub1_in2.txt | WA | 10 ms | 23808 KB |
sub1_in3.txt | WA | 10 ms | 23808 KB |
sub2_in1.txt | WA | 9 ms | 23680 KB |
sub2_in2.txt | WA | 15 ms | 24192 KB |
sub2_in3.txt | WA | 21 ms | 24704 KB |