QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#517997#4804. Regular Expressioncpchenpi#WA 5ms4260kbC++201.1kb2024-08-13 15:06:342024-08-13 15:06:38

Judging History

你现在查看的是最新测评结果

  • [2024-08-13 15:06:38]
  • 评测
  • 测评结果:WA
  • 用时:5ms
  • 内存:4260kb
  • [2024-08-13 15:06:34]
  • 提交

answer

// https://www.youtube.com/watch?v=wthasN45KuY
// You said I’d fly away
// But my walls have kept me down
// Now I’m lost and I’m afraid
// And I’m close to hit the ground
// 
// You said I’d fly away
// You said I’d fly anywhere
// But I keep on Falling

#ifndef ONLINE_JUDGE
#include "templates/debug.hpp"
#else
#define debug(...)
#endif

#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
using u64 = uint64_t;

#define int i64
constexpr int INF = 1e9 + 7;
void solve() {
    string s; cin >> s;
    if (s.size() == 1) {
        cout << 1 << " " << 2 << "\n";
    } else if (s.size() == 2) {
        cout << 2 << " ";
        int ans = 6; // ab, .*, a., .b, .., 
        if (s[0] == s[1]) ans += 2; // a*, a+
        cout << ans << "\n";
    } else {
        cout << 2 << " ";
        int ans = 1; // .*
        if (s == string(s.size(), s[0])) ans += 2;
        cout << ans << "\n";
    }
}
#undef int

// Make bold hypotheses and verify carefully
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3876kb

input:

2
a
ab

output:

1 2
2 6

result:

ok 2 lines

Test #2:

score: -100
Wrong Answer
time: 5ms
memory: 4260kb

input:

35857
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
aa
ab
ac
ad
ae
af
ag
ah
ai
aj
ak
al
am
an
ao
ap
aq
ar
as
at
au
av
aw
ax
ay
az
ba
bb
bc
bd
be
bf
bg
bh
bi
bj
bk
bl
bm
bn
bo
bp
bq
br
bs
bt
bu
bv
bw
bx
by
bz
ca
cb
cc
cd
ce
cf
cg
ch
ci
cj
ck
cl
cm
cn
co
cp
cq
cr
cs
ct
cu
cv
cw
cx
cy
cz
da
db
dc...

output:

1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
2 8
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 8
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
2 6
...

result:

wrong answer 703rd lines differ - expected: '2 4', found: '2 3'