编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#4955 #1030. 选择题 Wrong Answer 0 528 ms 3956 K Python 3 / 3.8 K s230026152 2024-02-25 14:10:18
import re,os
from io import BytesIO, IOBase
import random
import sys
from math import ceil,floor,fmod,gcd,sqrt,inf
from bisect import bisect_left
from collections import defaultdict,Counter,deque,OrderedDict
from functools import cache, reduce, cmp_to_key
from itertools import accumulate, combinations, permutations
from heapq import nsmallest, nlargest, heappushpop, heapify, heappop, heappush
from copy import deepcopy
from typing import *
from string import ascii_lowercase, ascii_uppercase
# 快读区块大小
BUFSIZE = 4096
# 判断是否本地
LOCAL="--open17" in sys.argv

# 可能会导致pypy产生TLE
# if "PyPy" in sys.version:
#     import pypyjit; pypyjit.set_param('max_unroll_recursion=-1')

# 调试递归极限
limits = [100000, 10000, 5000, 2000]
for limit in limits:
    try:
        sys.setrecursionlimit(limit)
        break
    except:
        continue 




class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 

def fstream(func):
    def wrapper(is_local):
        input_file = open('data.in', 'r', encoding='utf-8') if is_local else sys.stdin
        output_file = open('data.out', 'w', encoding='utf-8') if is_local else sys.stdout
        sys.stdin = IOWrapper(input_file)
        sys.stdout = output_file
        func()
        sys.stdin = sys.__stdin__
        sys.stdout = sys.__stdout__
        if is_local:
            input_file.close()
            output_file.close()
    return wrapper

input = lambda: sys.stdin.readline().rstrip("\r\n")

def I():
    return input()
 
def II():
    return int(input())
 
def MII():
    return map(int, input().split())
 
def LI():
    return list(input().split())
 
def LII():
    return list(map(int, input().split()))

def for_t(func):
    def wrapper():
        T=II()
        for _ in range(T):
            func()
    return wrapper


@fstream
# @for_t
def solve():
    n=II()
    ans=0
    for _ in range(n):
        a=input()
        b=input()
        if len(a)>len(b):
            continue
        if len(b)==1:
            if a==b:
                ans+=3
            continue
        c=0
        for i in a:
            if i not in b:
                break
            c+=1
        else:
            if c==len(b):
                ans+=5
            else:
                ans+=2
    print(ans)
    return 0


solve(LOCAL)
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:57 ms
内存:3688 KiB

输入文件(1.in

10000
B
C
D
A
D
A
C
C
D
B
C
B
C
A
C
D
C
D
D
C
C
B
B
A
C
C
D
D
B
D
D
C
D
B
A
B
D
D
C
D
D
D
C
B
B
C
A

<39906 bytes omitted>

答案文件(1.out

7362

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #2
Wrong Answer
得分:0
用时:46 ms
内存:3648 KiB

输入文件(2.in

10000
BC
ABCD
D
D
B
D
C
D
ACD
ABCD
BCD
ABCD
C
ABCD
BCD
ACD
A
D
B
B
AC
BD
A
AD
A
CD
AD
ABC
C
BCD
AB
B
<62709 bytes omitted>

答案文件(2.out

14406

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #3
Wrong Answer
得分:0
用时:61 ms
内存:3956 KiB

输入文件(3.in

10000
BD
ACD
AD
ABCD
A
BCD
A
AB
C
ABCD
A
ABCD
C
AB
BC
CD
D
C
C
A
C
BCD
CD
AC
C
B
ABCD
ABCD
B
D
C
C
D
<62316 bytes omitted>

答案文件(3.out

14342

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #4
Wrong Answer
得分:0
用时:58 ms
内存:3668 KiB

输入文件(4.in

10000
ABCD
ABCD
ABCD
ABCD
CD
ABCD
B
ACD
D
A
C
A
AC
BCD
B
ABCD
AD
CD
AC
AD
C
D
C
C
BD
ABCD
A
BCD
D
AB
<62423 bytes omitted>

答案文件(4.out

14043

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #5
Wrong Answer
得分:0
用时:56 ms
内存:3688 KiB

输入文件(5.in

10000
CAD
CDAB
DAC
ABDC
A
DC
A
CD
DB
DCB
DCAB
DCBA
ACD
DBC
A
CDB
C
CAB
A
C
D
BA
C
D
ABD
DBC
A
D
C
CA
<62189 bytes omitted>

答案文件(5.out

13883

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #6
Wrong Answer
得分:0
用时:43 ms
内存:3748 KiB

输入文件(6.in

10000
DAC
DAC
DAB
CBD
C
B
D
BAC
B
B
B
BC
C
A
AB
DCAB
C
CBD
D
C
CA
CAD
C
ADB
ADCB
ADCB
B
AC
BA
DCAB
C
<62435 bytes omitted>

答案文件(6.out

14128

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #7
Wrong Answer
得分:0
用时:57 ms
内存:3696 KiB

输入文件(7.in

10000
A
ADBC
C
D
BC
DA
A
BDCA
B
D
CD
CAD
ABD
ACDB
DC
DCB
D
CDB
D
DAC
CB
DB
AC
AB
AB
CDBA
A
A
ABDC
CD
<62456 bytes omitted>

答案文件(7.out

14064

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #8
Wrong Answer
得分:0
用时:55 ms
内存:3680 KiB

输入文件(8.in

10000
DAB
CBA
C
CD
B
DC
A
DBC
C
D
B
D
ABD
ADC
D
B
BDC
BCDA
A
ABC
DC
CB
CDA
ACD
A
A
D
C
ACDB
BACD
A
D
<62419 bytes omitted>

答案文件(8.out

14073

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #9
Wrong Answer
得分:0
用时:44 ms
内存:3704 KiB

输入文件(9.in

10000
C
A
A
C
BCDA
DACB
D
D
ADC
DAB
CA
AB
A
CBAD
C
B
DBAC
DCBA
B
C
A
CDA
B
AC
C
B
BD
ACBD
BDC
CDA
CD
<62314 bytes omitted>

答案文件(9.out

14181

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1
测试点 #10
Wrong Answer
得分:0
用时:51 ms
内存:3708 KiB

输入文件(10.in

10000
BC
DCAB
DABC
ADBC
A
CD
CDA
DABC
D
D
ACB
CDA
DA
AB
A
DBAC
BCD
CDB
C
A
C
C
B
CBAD
C
A
C
B
BDA
BA
<62303 bytes omitted>

答案文件(10.out

14212

标准错误流

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 8, in <module>
    from functools import cache, reduce, cmp_to_key
ImportError: cannot import name 'cache' from 'functools' (/usr/lib/python3.8/functools.py)

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 1