Submission #371142


Source Code Expand

// Enjoy your stay.

#include <bits/stdc++.h>

#define long long long
#define LOOPVAR_TYPE long

#define all(x) (x).begin(), (x).end()
#define sz(x) ((LOOPVAR_TYPE)(x).size())
#define foreach(it, X) for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++)
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i, n) _rep2(i, 0, n)
#define _rep2(i, a, b) for(LOOPVAR_TYPE i = (LOOPVAR_TYPE)(a); i < (LOOPVAR_TYPE)(b); i++)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)

#define fir first
#define sec second
#define mp make_pair
#define mt make_tuple
#define pb push_back

const double EPS = 1e-9;
const double PI = acos(-1.0);
const long INF = 1070000000LL;
const long MOD = 1000000007LL;

using namespace std;

typedef istringstream iss;
typedef stringstream sst;
typedef pair<LOOPVAR_TYPE, LOOPVAR_TYPE> pi;
typedef vector<LOOPVAR_TYPE> vi;

string s[5555];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	int cur = 0;
	while(cin>>s[cur]){
		cur++;
	}
	vector<string> res;
	int combo = -1;
	int flag = 0;
	for(int i = cur-1; i>=0; i--){
		if(s[i] != "not"){
			if(flag){
				if(combo % 2 == 1) res.pb("not");
			}
			flag = 1;
			combo = 0;
			res.pb(s[i]);
		}else{
			combo++;
			if(!flag) res.pb("not");
		}
	}
	reverse(all(res));
	rep(i,sz(res))cout<<res[i]<<(i==sz(res)-1 ? "\n" : " ");
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User heuristics
Language C++ (GCC 4.9.2)
Score 0
Code Size 1404 Byte
Status WA
Exec Time 27 ms
Memory 932 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 15
WA × 4
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 AC 26 ms 792 KB
scrambled_01.txt AC 26 ms 924 KB
scrambled_02.txt AC 26 ms 808 KB
scrambled_03.txt WA 26 ms 924 KB
scrambled_04.txt WA 25 ms 920 KB
scrambled_05.txt WA 25 ms 924 KB
scrambled_06.txt AC 26 ms 928 KB
scrambled_07.txt AC 26 ms 800 KB
scrambled_08.txt WA 26 ms 924 KB
scrambled_09.txt AC 27 ms 808 KB
scrambled_10.txt AC 26 ms 912 KB
scrambled_11.txt AC 23 ms 920 KB
scrambled_12.txt AC 23 ms 920 KB
scrambled_13.txt AC 23 ms 924 KB
scrambled_14.txt AC 24 ms 920 KB
scrambled_15.txt AC 23 ms 796 KB
scrambled_16.txt AC 26 ms 932 KB
scrambled_17.txt AC 23 ms 920 KB
scrambled_18.txt AC 23 ms 800 KB