Submission #371304


Source Code Expand

// tsukasa_diary's programing contest code template
#include <bits/stdc++.h>
using namespace std;
// define
#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define for_rev(i,a,b) for(int i=(a);i>=(b);--i)
#define allof(a) (a).begin(),(a).end()
#define minit(a,b) memset(a,b,sizeof(a))
#define size_of(a) int((a).size())
// typedef
typedef long long lint;
typedef double Double;
typedef pair< int, int > pii;
template< typename T >
using Matrix = vector< vector< T > >;
// popcount
inline int POPCNT(int x) { return __builtin_popcount(x); }
inline int POPCNT(lint x) { return __builtin_popcount(x); }
// inf
const int iINF = 1L << 30;
const lint lINF = 1LL << 60;
// eps
const Double EPS = 1e-9;
const Double PI = acos(-1);
// inrange
template< typename T >
inline bool in_range(T v, T mi, T mx) { return mi <= v && v < mx; }
template< typename T >
inline bool in_range(T x, T y, T W, T H) { return in_range(x,0,W) && in_range(y,0,H); }
// neighbor clockwise
const int DX[4] = {0,1,0,-1}, DY[4] = {-1,0,1,0};
const int DX_[8] = {0,1,1,1,0,-1,-1,-1}, DY_[8] = {-1,-1,0,1,1,1,0,-1};
// variable update
template< typename T > inline void modAdd(T& a, T b, T mod) { a = (a + b) % mod; }
template< typename T > inline void minUpdate(T& a, T b) { a = min(a, b); }
template< typename T > inline void maxUpdate(T& a, T b) { a = max(a, b); }
// converter
template< typename F, typename T >
inline void convert(F& from, T& to) {
	stringstream ss;
	ss << from; ss >> to;
}

string notpro = "not";

int main() {
	string in;
	
	vector< string > vs;
	while (cin >> in) vs.push_back(in);
	
	bool update = true;
	
	while (update) {
		update = false;
		
		for_(i,0,size_of(vs)-2) {
			if (vs[i] == notpro && vs[i + 1] == notpro && vs[i + 2] != notpro) {
				vs.erase(vs.begin() + i, vs.begin() + i + 2);
				update = true;
				break;
			}
		}
	}
	
	for_(i,0,size_of(vs)) cout << vs[i] << (i < size_of(vs) - 1 ? " " : "\n");
}

Submission Info

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