Submission #1213013
Source Code Expand
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; string s[10000], b[10001]; int main() { int n; scanf("%d", &n); rep(i, n) { cin >> s[i]; } string t; cin >> t; //t->'a',s->'z' string a = t; for (char&c : a) { if (c == '?')c = 'a'; } rep(i, n) { b[i] = s[i]; for (char&c : b[i]) { if (c == '?')c = 'z'; } } b[n] = a; sort(b, b + n + 1); int Min; rep(i, n + 1) { if (b[i] == a) { Min = i; break; } } a = t; for (char&c : a) { if (c == '?')c = 'z'; } rep(i, n) { b[i] = s[i]; for (char&c : b[i]) { if (c == '?')c = 'a'; } } b[n] = a; sort(b, b + n + 1); int Max; for (int i = n; i >= 0; i--) { if (b[i] == a) { Max = i; break; } } for (int i = Min + 1; i <= Max + 1; i++) { if (i != Min + 1)printf(" "); printf("%d", i); } printf("\n"); }
Submission Info
Submission Time | |
---|---|
Task | A - Atcoder Handles |
User | autumn_eel |
Language | C++14 (GCC 5.4.1) |
Score | 250 |
Code Size | 890 Byte |
Status | AC |
Exec Time | 18 ms |
Memory | 1536 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:7:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] int n; scanf("%d", &n); ^
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 | 384 KB |
sub1_in2.txt | AC | 2 ms | 512 KB |
sub1_in3.txt | AC | 2 ms | 512 KB |
sub2_in1.txt | AC | 1 ms | 384 KB |
sub2_in2.txt | AC | 9 ms | 896 KB |
sub2_in3.txt | AC | 18 ms | 1536 KB |