Submission #371286


Source Code Expand

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cstdio>
#include<map>
#include<set>
#include<queue>
#include<sstream>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)
#define pb push_back
#define fi first
#define se second

typedef pair<int,int> pii;


int main(){
	
	vector<string> ans;
	string in;
	while(cin>>in){
		ans.pb(in);
	}
	
	while(1){
		bool hit = false;
		rep(i,ans.size()){
			if(ans.size()-i >= 3 && ans[i+0]=="not" && ans[i+1]=="not" && ans[i+2]!="not"){
				ans.erase(ans.begin()+i);
				ans.erase(ans.begin()+i);
				hit = true;
			}else{
				
			}
		}
		
		
		if(!hit)break;
	}
	
	rep(i,ans.size()){
		if(i!=0)printf(" ");
		cout<<ans[i];
	}cout<<endl;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User nikollson
Language C++ (GCC 4.9.2)
Score 100
Code Size 807 Byte
Status AC
Exec Time 54 ms
Memory 932 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 19
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 25 ms 800 KB
scrambled_01.txt AC 25 ms 812 KB
scrambled_02.txt AC 27 ms 752 KB
scrambled_03.txt AC 22 ms 928 KB
scrambled_04.txt AC 24 ms 924 KB
scrambled_05.txt AC 46 ms 928 KB
scrambled_06.txt AC 25 ms 924 KB
scrambled_07.txt AC 46 ms 800 KB
scrambled_08.txt AC 54 ms 932 KB
scrambled_09.txt AC 24 ms 840 KB
scrambled_10.txt AC 25 ms 928 KB
scrambled_11.txt AC 26 ms 800 KB
scrambled_12.txt AC 26 ms 808 KB
scrambled_13.txt AC 25 ms 924 KB
scrambled_14.txt AC 26 ms 800 KB
scrambled_15.txt AC 24 ms 928 KB
scrambled_16.txt AC 24 ms 928 KB
scrambled_17.txt AC 26 ms 804 KB
scrambled_18.txt AC 26 ms 808 KB