提交记录 49367
| 提交时间 |
评测时间 |
| 2026-09-19 15:55:33 |
2026-09-19 15:56:21 |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
int t; if(scanf("%d",&t)!=1) return 0;
char tok[64];
while(t--){
int L; char cx[32];
scanf("%d %s",&L,cx);
int claim=0;
if(strcmp(cx,"O(1)")!=0){ claim=atoi(cx+3); }
int varstk[256], deadstk[256], contribstk[256], top=0;
int cur=0, maxe=0, err=0;
for(int i=0;i<L;i++){
scanf("%s",tok);
if(tok[0]=='F'){
char v[16],xs[16],ys[16];
scanf("%s %s %s",v,xs,ys);
int dupe=0;
for(int k=0;k<top;k++) if(varstk[k]==(unsigned char)v[0]) dupe=1;
if(dupe) err=1;
int dead = top? deadstk[top-1] : 0;
int contrib=0;
int xn = (xs[0]=='n'), yn = (ys[0]=='n');
if(!dead){
if(xn && !yn) dead=1;
else if(xn && yn) contrib=0;
else if(!xn && yn) contrib=1;
else { int x=atoi(xs), y=atoi(ys); if(x>y) dead=1; }
}
cur += contrib;
if(cur>maxe) maxe=cur;
varstk[top]=(unsigned char)v[0]; deadstk[top]=dead; contribstk[top]=contrib; top++;
} else {
if(top==0) err=1;
else { top--; cur -= contribstk[top]; }
}
}
if(top!=0) err=1;
if(err) printf("ERR\n");
else printf("%s\n", maxe==claim?"Yes":"No");
}
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 15.71 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 10.04 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 15.56 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 24.04 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #5 | 31.34 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #6 | 20.5 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #7 | 31.96 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #8 | 64.09 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #9 | 57.24 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 81.17 us | 20 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 12:05:41 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠