Submission #2014109
Source Code Expand
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> # include <tuple> # include <unordered_map> # include <numeric> # include <complex> # include <bitset> using namespace std; using LL = long long; using ULL = unsigned long long; constexpr int INF = 2000000000; constexpr int HINF = INF / 2; constexpr double DINF = 100000000000000000.0; constexpr long long LINF = 9223372036854775807; constexpr long long HLINF = 4500000000000000000; constexpr long long MMOD = 500000004; const double PI = acos(-1); int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 }; # define ALL(x) (x).begin(),(x).end() # define UNIQ(c) (c).erase(unique(ALL((c))), end((c))) # define mp make_pair # define eb emplace_back # define FOR(i,a,b) for(int i=(a);i<(b);++i) # define REP(i,n) FOR(i,0,n) # define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); int n; string a[101010]; string t; int Judge(string s) { int S = s.size(); string as, bs; for (int i = 0; i < S; i++) { if (s[i] == '?') { as += 'a'; bs += 'z'; } else { as += s[i]; bs += s[i]; } } if (t < as) return 1; if (t > bs) return -1; return 0; } int main() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; cin >> t; int x = 0, y = 0; for (int i = 0; i < n; i++) { int f = Judge(a[i]); if (f == -1) x++; if (f == 1) y++; } for (int i = x + 1; i <= n - y + 1; i++) { if (i != x + 1) cout << ' '; cout << i; } cout << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | M3_cp |
Language | C++14 (GCC 5.4.1) |
Score | 250 |
Code Size | 1711 Byte |
Status | AC |
Exec Time | 15 ms |
Memory | 1664 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 | 2 ms | 1024 KB |
sub1_in2.txt | AC | 2 ms | 1024 KB |
sub1_in3.txt | AC | 3 ms | 1024 KB |
sub2_in1.txt | AC | 2 ms | 1024 KB |
sub2_in2.txt | AC | 9 ms | 1280 KB |
sub2_in3.txt | AC | 15 ms | 1664 KB |