Submission #1776765


Source Code Expand

#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)4e18+20;
const LD PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

void solve(){
	string str;
	getline(cin,str);
	vector<string> word;
	int size = str.size();
	string temp = "";
	for(int i=0;i<size;++i){
		if( str[i] == ' ' ){
			word.push_back( temp );
			temp = "";
		}else{
			temp += str[i];
		}
	}
	if( temp != "" ){
		word.push_back( temp );
	}
	
	size = word.size();
	vector<string> ans;
	for(int i=0;i<size;++i){
		if( i+2 >= size ){
			ans.push_back( word[i] );
		}else{
			if( word[i] == "not" && word[i+1] == "not" && word[i+2] != "not" ){
				++i;
			}else{
				ans.push_back( word[i] );
			}
		}
	}
	size = ans.size();
	for(int i=0;i<size;++i){
		if( i ){
			cout << ' ';
		}
		cout << ans[i];
	}
	cout << endl;
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Submission Info

Submission Time
Task A - 二重否定除去法則
User akarin55
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1999 Byte
Status WA
Exec Time 2 ms
Memory 384 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 1 ms 256 KB
scrambled_01.txt AC 1 ms 256 KB
scrambled_02.txt AC 1 ms 256 KB
scrambled_03.txt AC 1 ms 256 KB
scrambled_04.txt AC 1 ms 256 KB
scrambled_05.txt WA 2 ms 384 KB
scrambled_06.txt AC 2 ms 384 KB
scrambled_07.txt WA 2 ms 384 KB
scrambled_08.txt WA 2 ms 384 KB
scrambled_09.txt AC 1 ms 256 KB
scrambled_10.txt AC 1 ms 256 KB
scrambled_11.txt AC 1 ms 256 KB
scrambled_12.txt AC 1 ms 256 KB
scrambled_13.txt AC 1 ms 256 KB
scrambled_14.txt AC 1 ms 256 KB
scrambled_15.txt AC 1 ms 384 KB
scrambled_16.txt AC 1 ms 384 KB
scrambled_17.txt AC 1 ms 384 KB
scrambled_18.txt AC 1 ms 256 KB