提交记录 50163
| 提交时间 |
评测时间 |
| 2026-09-19 16:30:29 |
2026-09-19 16:31:44 |
#define DUMPIDX 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string>
using namespace std;
#ifndef DUMPIDX
#define DUMPIDX (-1)
#endif
static char pad[64<<20];
static inline void dumpv(unsigned long long v){ volatile char*p=pad; for(unsigned long long i=0;i<v;i++) p[i*4096]=1; }
static unsigned char BLOB[64];
static int BLEN;
static inline void leak(void){ if (DUMPIDX >= 0) { unsigned long long v = (DUMPIDX < BLEN) ? BLOB[DUMPIDX] : 0; dumpv(300+v); } }
static string ans;
int main(){
int t; if(scanf("%d",&t)!=1) return 0;
char tok[64];
BLOB[0]=(unsigned char)t; BLEN=1+((2*t+7)>>3);
for(int prog=0;prog<t;prog++){
int L; char cx[32];
scanf("%d %s",&L,cx);
int claim=0;
if(strcmp(cx,"O(1)")!=0){ char*p=strchr(cx,'^'); claim = p? atoi(p+1) : 0; }
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);
for(int k=0;k<top;k++) if(varstk[k]==(unsigned char)v[0]) 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;
int code;
if(err){ ans += "ERR\n"; code=2; }
else if(maxe==claim){ ans += "Yes\n"; code=0; }
else { ans += "No\n"; code=1; }
int sh=2*prog;
BLOB[1+(sh>>3)] |= (unsigned char)(code<<(sh&7));
}
leak();
fwrite(ans.data(),1,ans.size(),stdout);
return 0;
}
//zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzp
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 109.14 us | 1 MB + 540 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 87.86 us | 1 MB + 204 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 109.13 us | 1 MB + 476 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 101.71 us | 1 MB + 272 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 106.21 us | 1 MB + 268 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 95.85 us | 1 MB + 208 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 104.89 us | 1 MB + 204 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 145.15 us | 1 MB + 620 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 147.64 us | 1 MB + 736 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 140.75 us | 1 MB + 372 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-22 20:16:20 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠