版本比较
I AC P4911 河童重工的计算机 !
正文
增加 19 行删除 19 行
111 行未改动全部展开11211311411511611611711811912012112212112212312412512412512612712812918 行未改动14814915015115215315415215315415515615715810 行未改动1691701711721731741751731741751761771781793 行未改动18318418518618718818919018718818919019119219319417 行未改动2122132142152162162172182192204 行未改动2252262272282292292302312322332 行未改动236237238239240240241242243244246 行未改动全部展开49149249349449549549649749849919 行未改动111 行未改动全部展开 F(i,start,cmds.size()-1){ if(RET){ if(is_fun) RET=0; return; } } auto tmp=split_by_fh(cmds[i]); for(auto s:tmp){ auto words=split_by_kg(s); #define gt(x) get(words[x],i)
if(words[0]=="udef") continue;
else if(words[0]=="callfunc"){ int tmp=vars::line; vars::line=mp[words[1]]; cmd(mp[words[1]]+1,1);18 行未改动 else if(words[0]=="ret") { RET=1; if(words.size()==2) vars::ret=(int)gt(1); }
#define put1(x) {\ if(words.size()==4) gt(3)=x;\ else vars::val=x;\ }10 行未改动 else if(words[0]=="rsft") put1(gt(1)>>gt(2)) else if(words[0]=="band") put1(gt(1)>(2)) else if(words[0]=="bor") put1(gt(1)|gt(2)) else if(words[0]=="bxor") put1(gt(1)^gt(2))
#define put2(x) {\ if(words.size()==4) gt(3)=bool(x);\ else vars::flag=bool(x);\ }3 行未改动 else if(words[0]=="lle") put2(gt(1)<=gt(2)) else if(words[0]=="leql") put2(gt(1)==gt(2)) else if(words[0]=="land") put2(((bool)gt(1))&((bool)gt(2))) else if(words[0]=="lor") put2(((bool)gt(1))|((bool)gt(2)))
else if(words[0]=="rint") { int xxx; cin>>xxx; if(words.size()==2) gt(1)=xxx;17 行未改动 } if(RET){ if(is_fun) RET=0; return; } }}void pre(){ F(i,1,cmds.size()-1){ auto tmp=split_by_fh(cmds[i]);4 行未改动 } } }}main() { main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n;2 行未改动 F(i,1,n) getline(cin,s),cmds.push_back(s); cmds=qu_zhu_shi(); pre(); cmd(1,0); return 0; return 0;}```
继[cyaron](https://www.luogu.com.cn/record/65667106)后又一道程序模拟题246 行未改动全部展开 int arr=0; string s2=get_var(s1,arr); erase_not_var(s1); int ans=calc(s1); if(arr==-1) if(arr==-1) var[find_var(s2)].num=ans; else var[find_array(s2,arr)].num=ans; break; }19 行未改动