Submission #371285


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 114514810;
const int MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int main()
{
	vs v;
	string s;
	while (cin >> s)
	{
		v.push_back(s);
	}
	bool update = true;
	while (update)
	{
		if (v.size() < 3) break;
		update = false;
		REP(i, v.size()-2)
		{
			if (v[i] == "not"&&v[i + 1] == "not"&&v[i + 2] != "not")
			{
				update = true;
				v.erase(v.begin() + i, v.begin() + i + 2);
			}
		}
	}
	REP(i, v.size())
	{
		cout << v[i] << (i == v.size() - 1 ? "\n" : " ");
	}
	return 0;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User amano
Language C++11 (GCC 4.9.2)
Score 0
Code Size 1405 Byte
Status RE
Exec Time 306 ms
Memory 924 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 17
RE × 2
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 RE 282 ms 800 KB
scrambled_01.txt AC 23 ms 924 KB
scrambled_02.txt AC 25 ms 924 KB
scrambled_03.txt AC 26 ms 812 KB
scrambled_04.txt AC 34 ms 804 KB
scrambled_05.txt AC 54 ms 796 KB
scrambled_06.txt AC 26 ms 924 KB
scrambled_07.txt RE 306 ms 924 KB
scrambled_08.txt AC 46 ms 924 KB
scrambled_09.txt AC 24 ms 924 KB
scrambled_10.txt AC 25 ms 924 KB
scrambled_11.txt AC 38 ms 748 KB
scrambled_12.txt AC 25 ms 916 KB
scrambled_13.txt AC 33 ms 924 KB
scrambled_14.txt AC 27 ms 804 KB
scrambled_15.txt AC 35 ms 800 KB
scrambled_16.txt AC 26 ms 924 KB
scrambled_17.txt AC 27 ms 800 KB
scrambled_18.txt AC 25 ms 924 KB