Submission #2543960
Source Code Expand
// // main.cpp // ProCon // // Created by hashimotoryoma on 2017/08/20. // Copyright © 2017年 hashimotoryoma. All rights reserved. // #include <iostream> #include <fstream> #include <algorithm> #include <string> #include <map> #include <queue> #include <vector> #define repeat(i,n) for (int i = 0; (i) < (n); ++ (i)) using namespace std; typedef long long ll; int main() { // insert code here... return 0; ////// // input from txt /* std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf()); std::ofstream out("output.txt"); std::cout.rdbuf(out.rdbuf()); //// */ ll N; cin >> N; string S[10010]; string aS[10010],zS[10010]; repeat(i, N){ cin >> S[i]; aS[i]=S[i]; zS[i]=S[i]; repeat(s, S[i].length()){ if(S[i][s]=='?'){ aS[i][s] = 'a'; zS[i][s] = 'z'; } } } string T; cin >> T; int onlyfront = 0; int both=0; repeat(i, N){ if(aS[i]<=T){ if(zS[i]>=T){ both++; } else{ onlyfront++; } } } for(int i=onlyfront+1;i<=onlyfront+both+1;i++){ cout << i; if(i==onlyfront+both+1) cout << endl; else cout << " "; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | hashiryo |
Language | C++14 (GCC 5.4.1) |
Score | 250 |
Code Size | 1446 Byte |
Status | AC |
Exec Time | 12 ms |
Memory | 1920 KB |
Judge Result
Set Name | Subtask1 | Subtask2 | ||||
---|---|---|---|---|---|---|
Score / Max Score | 130 / 130 | 120 / 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 | AC | 1 ms | 512 KB |
sub1_in2.txt | AC | 2 ms | 512 KB |
sub1_in3.txt | AC | 2 ms | 512 KB |
sub2_in1.txt | AC | 1 ms | 512 KB |
sub2_in2.txt | AC | 7 ms | 1280 KB |
sub2_in3.txt | AC | 12 ms | 1920 KB |