Submission #2799538
Source Code Expand
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
typedef long long ll;
#define tr(container, it) \
for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end()) //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define ill(_x) ll _x;scanf("%lld",&_x);
#define idb(_x) double _x;scanf("%lf",&_x);
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define sll set<ll>
#define vs vector<string>
#define in0(x, a, b)((x)>=a && (x)<=b )
#define in1(x, a, b)((x)>a && (x)<b)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const double pi = 3.14159265358979323846;
const int INF = 0x3f3f3f3f;
const int X10=1024,X11=2048,X12=4096,X13=8196,X14=16392,X15=32786,X16=65536,X17=131072,X18=262144,X19=524288,X20=1048576;
void _ (){
int a=0;
string s;
deque<string> stk;
while(cin >> s){
if(a == 2){
if(s!="not"){
stk.pop_back();stk.pop_back();a = 0;
}
stk.push_back(s);
}
else if(a ==1 ){
if(s!="not")a--;
else a++;
stk.push_back(s);
}
else {
if(s == "not" ){
a++;
}
stk.push_back(s);
}
}
while (!stk.empty()){
cout << stk.front() << " ";stk.pop_front();
}
}
int main() {
#ifdef Debug
freopen("/home/joduskame/Desktop/cpp/IO/Input.txt", "r", stdin);
freopen("/home/joduskame/Desktop/cpp/IO/Output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
_();
return 0;
}
Submission Info
Submission Time |
|
Task |
A - 二重否定除去法則 |
User |
Gosu_Hiroo |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1876 Byte |
Status |
WA |
Exec Time |
2 ms |
Memory |
384 KB |
Judge Result
Set Name |
All |
Score / Max Score |
0 / 100 |
Status |
|
Set Name |
Test Cases |
All |
scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt |
Case Name |
Status |
Exec Time |
Memory |
scrambled_00.txt |
WA |
1 ms |
256 KB |
scrambled_01.txt |
WA |
1 ms |
256 KB |
scrambled_02.txt |
WA |
1 ms |
256 KB |
scrambled_03.txt |
WA |
1 ms |
256 KB |
scrambled_04.txt |
WA |
1 ms |
256 KB |
scrambled_05.txt |
WA |
2 ms |
384 KB |
scrambled_06.txt |
WA |
2 ms |
384 KB |
scrambled_07.txt |
WA |
2 ms |
384 KB |
scrambled_08.txt |
WA |
2 ms |
384 KB |
scrambled_09.txt |
WA |
1 ms |
256 KB |
scrambled_10.txt |
WA |
1 ms |
256 KB |
scrambled_11.txt |
WA |
1 ms |
256 KB |
scrambled_12.txt |
WA |
1 ms |
256 KB |
scrambled_13.txt |
WA |
1 ms |
256 KB |
scrambled_14.txt |
WA |
1 ms |
256 KB |
scrambled_15.txt |
WA |
1 ms |
256 KB |
scrambled_16.txt |
WA |
1 ms |
256 KB |
scrambled_17.txt |
WA |
1 ms |
256 KB |
scrambled_18.txt |
WA |
1 ms |
256 KB |