Submission #371309


Source Code Expand

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<climits>
#include<string>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reg(i,a,b) for(int i=(a);i<=(b);i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=(b);i>=(a);i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX

vector<string> s;

int  main(void){
	string iis;
	char is[5005];
	getline(cin,iis);
	string ns ="";
	rep(i,iis.size()){
		if(iis[i]!=' ')ns+=iis[i];
		else{
			s.push_back(ns);
			ns = "";
		}
	}
	s.push_back(ns);
	/*
	rep(i,s.size()){
		printf("%s ",s[i].c_str());
	}*/
	/*
	while(scanf("%s%\n",is)!=EOF){
		s.push_back(string(is));
	}*/
	
	string no = "not";
	
	int p = s.size(); p--;
	while(1){
		if(p<=1)break;
		if(s[p]!=no && s[p-1]==no && s[p-2]==no){
			s.erase(s.begin()+p-2);
			s.erase(s.begin()+p-2);
			p-=2;
		}
		else p--;
		//printf("%d\n",p);
	}
	
	rep(i,s.size()){
		printf("%s%c",s[i].c_str(),((i+1==s.size())?'\n':' '));
	}
		
		
	
	
		
	return 0;
}



Submission Info

Submission Time
Task A - 二重否定除去法則
User SAT3
Language C++ (GCC 4.9.2)
Score 100
Code Size 1241 Byte
Status AC
Exec Time 25 ms
Memory 928 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 22 ms 924 KB
scrambled_01.txt AC 23 ms 792 KB
scrambled_02.txt AC 23 ms 928 KB
scrambled_03.txt AC 24 ms 800 KB
scrambled_04.txt AC 24 ms 924 KB
scrambled_05.txt AC 23 ms 928 KB
scrambled_06.txt AC 23 ms 808 KB
scrambled_07.txt AC 25 ms 924 KB
scrambled_08.txt AC 23 ms 928 KB
scrambled_09.txt AC 23 ms 928 KB
scrambled_10.txt AC 22 ms 804 KB
scrambled_11.txt AC 23 ms 804 KB
scrambled_12.txt AC 24 ms 920 KB
scrambled_13.txt AC 25 ms 796 KB
scrambled_14.txt AC 23 ms 808 KB
scrambled_15.txt AC 23 ms 808 KB
scrambled_16.txt AC 24 ms 800 KB
scrambled_17.txt AC 25 ms 844 KB
scrambled_18.txt AC 23 ms 924 KB