C. Okabe and Boxes time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Okabe and Super Hacker Daru are stacking and removing boxes. There are n boxes numbered from 1 to n. Initially there are…
821C - Okabe and Boxes 思路:模拟.因为只需要比较栈顶和当前要删除的值就可以了,所以如果栈顶和当前要删除的值不同时,栈就可以清空了(因为下一次的栈顶不可能出现在前面那些值中). 代码: #include<bits/stdc++.h> using namespace std; #define ll long long vector<int>st; int main() { ios::sync_with_stdio(false); cin.tie(); ,ans=…
A. Okabe and Future Gadget Laboratory time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Okabe needs to renovate the Future Gadget Laboratory after he tried doing some crazy experiments! The…