Submission #1519686
Source Code Expand
#pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <iterator> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <tuple> #include <bitset> #include <queue> #include <complex> #include <set> #include <map> #include <stack> #include <list> #include <fstream> #include <random> //#include <time.h> #include <ctime> #pragma endregion //#include ///////// #define REP(i, x, n) for(int i = x; i < n; ++i) #define rep(i,n) REP(i,0,n) #define ALL(X) X.begin(), X.end() ///////// #pragma region typedef typedef long long LL; typedef long double LD; typedef unsigned long long ULL; typedef std::pair<LL,LL> PLL;// typedef std::pair<int,int> PII;// #pragma endregion //typedef ////定数 const int INF = (int)1e9; const LL MOD = (LL)1e9+7; const LL LINF = (LL)1e18+20; const double PI = acos(-1.0); const double EPS = 1e-9; ///////// using namespace::std; void solve(){ int N; cin >> N; vector<string> vstr(N); for(int i=0;i<N;++i){ cin >> vstr[i]; } string T; cin >> T; int Lnum = 0; int Cnum = 0; int Rnum = 0; for(int i=0;i<N;++i){ int L = 0; int C = 0; int R = 0; string temp = vstr[i]; int size = temp.size(); for(int j=0;j<size;++j){ if( temp[j] == '?' ){ temp[j] = 'a'; } } if( temp <= T ){ ++L; } temp = vstr[i]; for(int j=0;j<size;++j){ if( temp[j] == '?' ){ temp[j] = 'z'; } } if( T <= temp ){ ++R; } if( L && R ){ ++Cnum; }else if( L ){ ++Lnum; }else{ ++Rnum; } } for(int i=Lnum+1;i<=N+1-Rnum; ++i){ if( i != Lnum+1 ) cout << ' '; cout << i; } cout << endl; } #pragma region main signed main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;//小数を10進数表示 cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別 solve(); } #pragma endregion //main()
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | akarin55 |
Language | C++14 (GCC 5.4.1) |
Score | 250 |
Code Size | 2064 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 896 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 | 256 KB |
sub1_in2.txt | AC | 1 ms | 256 KB |
sub1_in3.txt | AC | 2 ms | 256 KB |
sub2_in1.txt | AC | 1 ms | 256 KB |
sub2_in2.txt | AC | 4 ms | 512 KB |
sub2_in3.txt | AC | 6 ms | 896 KB |