{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"Dzy有一个机器可以吞吐金币的机器,机器有两种模式:\n\n+ 模式1为FIFO代表”First In First Out“,即先进先出\n+ 模式2为FILO代表\"First In Last Out\",即先进后出\n\n现dzy会不定时向机器里塞入金币,和取出金币,给定当前机器的模式和dzy的操作,请求出每次取金币得到的金币价值\n"}},{"title":"Input","value":{"format":"MD","content":"第一行包含一个整数$t$代表组数\n接下来 $n$ 输入操作情况:\nIN x:代表塞入价值为x的金币\nOUT:代表取出金币"}},{"title":"Output","value":{"format":"MD","content":"每得到一个字符串\"OUT\", 须根据 \"FIFO\" 或 \"FILO\"的原则,输出一个整数代表金币价值, 如果此时机器内没有金币,则输出\"None\""}},{"title":"Sample","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e4\n4 FIFO\nIN 1\nIN 2\nOUT\nOUT\n4 FILO\nIN 1\nIN 2\nOUT\nOUT\n5 FIFO\nIN 1\nIN 2\nOUT\nOUT\nOUT\n5 FILO\nIN 1\nIN 2\nOUT\nIN 3\nOUT\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e1\n2\n2\n1\n1\n2\nNone\n2\n3\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}