Submission #371287


Source Code Expand

// {{{ Boilerplate Code <--------------------------------------------------
// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>

#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define ALL(A)     (A).begin(), (A).end()

using namespace std;

// }}}

int main(){
	string ret;
	int notct=0;

	while(!cin.eof()){
		string tmp;
		cin>>tmp;

		if(tmp=="")
			continue;


		if(tmp=="not"){
			notct++;
		}else{
			if(notct>=2)
				notct-=2;
			while(notct){
				notct--;
				ret.append("not ");
			}
			if(tmp.size()>=3 && tmp.substr(tmp.size()-3)=="not"){
				ret.append(tmp.substr(0,tmp.size()-3));
				notct++;
			}else{
				ret.append(tmp + " ");
			}
		}
	}
	while(notct){
		notct--;
		ret.append("not ");
	}

	ret[ret.length()-1]='\n';
	cout<<ret;





}

Submission Info

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

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 16
WA × 3
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 924 KB
scrambled_01.txt AC 24 ms 924 KB
scrambled_02.txt AC 25 ms 916 KB
scrambled_03.txt AC 24 ms 804 KB
scrambled_04.txt AC 26 ms 804 KB
scrambled_05.txt WA 28 ms 920 KB
scrambled_06.txt AC 27 ms 812 KB
scrambled_07.txt WA 26 ms 928 KB
scrambled_08.txt WA 26 ms 928 KB
scrambled_09.txt AC 24 ms 928 KB
scrambled_10.txt AC 26 ms 928 KB
scrambled_11.txt AC 26 ms 820 KB
scrambled_12.txt AC 30 ms 924 KB
scrambled_13.txt AC 25 ms 732 KB
scrambled_14.txt AC 26 ms 916 KB
scrambled_15.txt AC 28 ms 800 KB
scrambled_16.txt AC 26 ms 924 KB
scrambled_17.txt AC 27 ms 932 KB
scrambled_18.txt AC 26 ms 928 KB