提交记录 8573


用户 题目 状态 得分 用时 内存 语言 代码长度
da32s1da noip17b. 【NOIP2017】时间复杂度 Accepted 100 108.85 us 36 KB C++ 1.19 KB
提交时间 评测时间
2019-02-26 14:13:28 2020-08-01 01:21:29
#include<bits/stdc++.h>
using namespace std;
string a,b; 
int c,d,e,f[27],g[27],h,k,l[100],m,n,o;
int main()
{
    cin>>o; 
    while(o>0)
    {
    	c=0;d=0;m=0;n=0;e=0;h=0;k=0;o--;
        memset(f,0,sizeof(f));memset(l,0,sizeof(l));   
        do{a=b;cin>>b;}while(b[0]!='O');    
        for(int i=0;i<a.length();i++) c=c*10+a[i]-'0';  
        for(int i=4;i<b.length()-1;i++) d=d*10+b[i]-'0'; 
        while(c>0)
        {
            c--;cin>>a;  
            if(a[0]=='F') 
            {
                e++;cin>>a;   
                if(f[a[0]-96]) e=-1;  
                else f[a[0]-96]=1,g[e]=a[0]-96;   
                cin>>a>>b;      
                if(a[0]!='n'&&b[0]=='n'&&k==0) h++,l[e]=1;
                else if(((a.length()==b.length()&&a>b)||(a.length()>b.length())||(a[0]=='n'&&b[0]!='n'))&&k==0) k=1,n=e;
            }else
            {      
                m=max(m,h);f[g[e]]=0;   
                if(l[e]==1) h--,l[e]=0;   
                e--;   
                if(n>0&&e<n) k=0,n=0; 
            }
            if(e==-1) printf("ERR\n"),c=-1;   
        }
        if(e>0) printf("ERR\n");  
        if(e==0&&m==d) printf("Yes\n"); 
        if(e==0&&m!=d) printf("No\n");
    }
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #140.71 us36 KBAcceptedScore: 10

Testcase #244.68 us36 KBAcceptedScore: 10

Testcase #346.77 us36 KBAcceptedScore: 10

Testcase #464.99 us36 KBAcceptedScore: 10

Testcase #564.8 us36 KBAcceptedScore: 10

Testcase #654.16 us36 KBAcceptedScore: 10

Testcase #768.43 us36 KBAcceptedScore: 10

Testcase #884.28 us36 KBAcceptedScore: 10

Testcase #985.95 us36 KBAcceptedScore: 10

Testcase #10108.85 us36 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:30:13 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠