Submission #1213019


Source Code Expand

#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<string> name(n);
    for(int i=0; i<n; ++i)
        cin >> name[i];

    string x;
    cin >> x;

    int cnt1 = 0;
    int cnt2 = 0;
    for(int i=0; i<n; ++i){
        string s = name[i];
        string t = name[i];
        for(unsigned j=0; j<s.size(); ++j){
            if(s[j] == '?'){
                s[j] = 'a';
                t[j] = 'z';
            }
        }

        if(t < x)
            ++ cnt1;
        else if(s <= x)
            ++ cnt2;
    }

    vector<int> ans;
    for(int i=0; i<=cnt2; ++i)
        ans.push_back(cnt1 + 1 + i);

    cout << ans[0];
    for(unsigned i=1; i<ans.size(); ++i)
        cout << ' ' << ans[i];
    cout << endl;

    return 0;
}

Submission Info

Submission Time
Task A - Atcoder Handles
User mamekin
Language C++14 (GCC 5.4.1)
Score 250
Code Size 1244 Byte
Status AC
Exec Time 11 ms
Memory 896 KB

Judge Result

Set Name Subtask1 Subtask2
Score / Max Score 130 / 130 120 / 120
Status
AC × 3
AC × 6
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 2 ms 256 KB
sub1_in3.txt AC 2 ms 256 KB
sub2_in1.txt AC 1 ms 256 KB
sub2_in2.txt AC 6 ms 640 KB
sub2_in3.txt AC 11 ms 896 KB