跳到正文

景腾岳

431174

WA自动机

在洛谷打开
资料、奖项与版本

资料

编号
431174
抓取

(^ ^)
= =
| |
vv
——me


大事记

2021.8.25 绿名祭
2025.7.18 难绷难绷四年来就一个,所以随便凑一个
2025.8.2还好又绿名了,诶不是怎么还是8月
2025.9.9耶耶橙名了
2026.3.21哭唧唧怎么又绿名了


当洛谷评测机制变成这样:
AC :Answer Coarse,粗犷的答案;
CE :Compile Easily,轻松通过编译;
PC :Perfect Compile 完美的编译;
WA :Wonderful Answer,好答案;
RE :Right Enough,正确过多;
TLE:Time Limit Enough,时间充裕;
MLE:Memory Limit Enough,内存充裕;
OLE:Option Limit Enough,选择数量充裕;
UKE:Unbelievably Keep Enough Score,难以置信地保持足够的分数。

还有没有人不会用Markdown的?

cpy1.0.4源代码

Python
import binary ## 这个库是手写的
flag = 0
line = 1
repeat = 0
repeatTimes = 0
repeatCodes = []
code_list = []
errorLines = []
errorFunctionNames = []
Vars = {}
Running = True

def comp(code):
    global code_list
    global Vars
    global repeat
    global repeatTimes
    global errorLines
    global errorFunctionNames
    global flag
    global Running
    flag1 = 0
    if repeat == 0:
        if code[:8] == 'outputln':
            if "\"" not in code:
                code_list.append('1' + Vars[str(code[9:code.index(")")])])
            else:
                code_list.append('1' + code[10:len(code) - 2])
            flag1 += 1
        elif code[:6] == 'output':
            if "\"" not in code:
                code_list.append('2' + Vars[str(code[7:code.index(")")])])
            else:
                code_list.append('2' + code[8:len(code) - 2])
            flag1 += 1
        elif code[:4] == 'read':
            code_list.append('3' + code[code.index("\""):len(code) - 2])
            flag1 += 1
        elif "+=" in code:
            Vars[code[:code.index("+")]] = str(int(Vars[code[:code.index("+")]]) + int(code[code.index("=") + 1:]))
            flag1 += 1
        elif "-=" in code:
            Vars[code[:code.index("-")]] = str(int(Vars[code[:code.index("-")]]) - int(code[code.index("=") + 1:]))
            flag1 += 1
        elif "*=" in code:
            Vars[code[:code.index("*")]] = str(int(Vars[code[:code.index("*")]]) * int(code[code.index("=") + 1:]))
            flag1 += 1
        elif "/=" in code:
            Vars[code[:code.index("/")]] = str(int(Vars[code[:code.index("/")]]) // int(code[code.index("=") + 1:]))
            flag1 += 1
        elif "%=" in code:
            Vars[code[:code.index("%")]] = str(int(Vars[code[:code.index("%")]]) % int(code[code.index("=") + 1:]))
            flag1 += 1
        elif ">>=" in code:
            Vars[code[:code.index(">")]] = str(binary.Shr(int(Vars[code[:code.index(">")]]), int(code[code.index("=",code.index(">") + 2) + 1:])))
            flag1 += 1
        elif "<<=" in code:
            Vars[code[:code.index("<")]] = str(binary.Shl(int(Vars[code[:code.index("<")]]), int(code[code.index("=",code.index("<") + 2) + 1:])))
            flag1 += 1
        elif "&=" in code:
            Vars[code[:code.index(">")]] = str(binary.And(int(Vars[code[:code.index("&")]]), int(code[code.index("=",code.index("&")):])))
            flag1 += 1
        elif "|=" in code:
            Vars[code[:code.index("|")]] = str(int(Vars[code[:code.index("|")]]) | int(code[code.index("=",code.index("|") + 1) + 1:]))
            flag1 += 1
        elif "^=" in code:
            Vars[code[:code.index("^")]] = str(int(Vars[code[:code.index("^")]]) ^ int(code[code.index("=",code.index("^") + 1) + 1:]))
            flag1 += 1
        elif "~=" in code:
            Vars[code[code.index("=") + 1:]] = str(~int(Vars[code[code.index("=") + 1:]]))
            flag1 += 1
        elif "=" in code:
            if not '\"' in code:
                Vars[code[:code.index("=")]] = code[code.index("=") + 1:len(code) + 1]
            elif '\"' in code:
                Vars[code[:code.index("=")]] = code[code.index('\"') + 1:len(code) - 1]
            flag1 += 1
        elif "repeat" in code:
            repeat = 1
            repeatTimes = int(code[7:len(code)])
        elif code == 'end':
            flag += 1
            Running = 0
        elif code[len(code) - 2:len(code)] == "++":
            Vars[code[:code.index("+")]] = str(int(Vars[code[:len(code) - 2]]) + 1)
            flag1 += 1
        elif code[len(code) - 2:len(code)] == "--":
            Vars[code[:code.index("-")]] = str(int(Vars[code[:len(code) - 2]]) - 1)
            flag1 += 1
        elif code[len(code) - 2:len(code)] == "**":
            Vars[code[:code.index("*")]] = str(int(Vars[code[:len(code) - 2]]) * int(Vars[code[:len(code) - 2]]))
            flag1 += 1
        elif flag1 != 1:
            errorFunctionNames.append(code[0:code.index('(')])
            errorLines.append(line)
            flag = -1
    elif code == "repeat end":
        repeat = 0
        repeatFunction()
        flag1 += 1
    else:
        repeatCodes.append(code)

def repeatFunction():
    for i in range(repeatTimes):
        for j in range(len(repeatCodes)):
            comp(repeatCodes[j])
            
while Running:
    line += 1
    code = input()
    comp(code)
        
if flag == 1:
    for i in code_list:
        if i[0] == '1':
            print(i[1:len(i) + 1])
        elif i[0] == '2':
            print(i[1:len(i) + 1],end='')
        elif i[0] == '3':
            input(i[1:len(i) + 1])
else:
    print("Error!")
    for i in range(len(errorLines)):
        print("Line " + str(errorLines[i] - 1) + ': ' + '\'' + str(errorFunctionNames[i]) + '\' is not defined.' )

C++
#include <bits/stdc++.h>
using namespace std;
int prime[10000];
bool p[1000000];
int main(){
    memset(p, 1, sizeof(p));
    int l, r;
    cin >> l >> r;
    p[1] = 0;
    for(int i = 2;i <= 1000000;i ++){
        for(int j = 2 * i;j <= 1000000;j += i){
            p[j] = 0;
        }
    }
    for(int i = 1;i <= 200000)
    //P1835
}

还没有收录这位用户的文章。