Submission #2553921
Source Code Expand
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ int N; cin >> N; vector<string> S(N+1),sub,sub2; for(int i = 0;i < N+1;i++){ cin >> S[i]; if(S[i].find("?") == -1)sub.push_back(S[i]); else sub2.push_back(S[i]); } //cout << sub.size() << endl;// int l = 0,r = 1; if(sub.size() != 1){ sort(sub.begin(),sub.end()); auto itl = lower_bound(sub.begin(),sub.end(),S.back()); auto itr = upper_bound(sub.begin(),sub.end(),S.back()); //cout << *itl << endl << *itr << endl;// l = distance(sub.begin(), itl); r = distance(sub.begin(), itr); } //cout << l << " " << r << endl; if(sub2.size()){ for(auto ss:sub2){ //cout << ss << endl; bool lf,rf;//左にある 右にある string str = ss; for(char &c :str)if(c == '?')c = 'a'; //cout << str << endl;// lf = (S.back() < str); str = ss; for(char &c :str)if(c == '?')c = 'z'; //cout << str << endl;// rf = (S.back() > str); if(!lf && rf){ l++,r++; }else if(!lf && !rf){ r++; } } } for(int i = l;i < r;i++){ cout << i+1 << " "; }cout << endl; // cout << l << " " << r << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | Bantako |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1487 Byte |
Status | WA |
Exec Time | 12 ms |
Memory | 1024 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 | 256 KB |
sub1_in2.txt | WA | 2 ms | 256 KB |
sub1_in3.txt | WA | 2 ms | 256 KB |
sub2_in1.txt | WA | 1 ms | 256 KB |
sub2_in2.txt | WA | 6 ms | 640 KB |
sub2_in3.txt | WA | 12 ms | 1024 KB |