Submission #371137


Source Code Expand

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  string s;
  vector<string> vs;
  while(cin>>s) vs.PB(s);

  bool up = true;
  while(up && !vs.empty()){
	up = false;
	for(int i=0;i<SZ(vs)-2;++i){
	  if(vs[i] == "not" && vs[i+1] == "not" && vs[i+2] != "not"){
		vs.erase(vs.begin()+i, vs.begin()+i+2);
		up = true;
		break;
	  }
	}
  }

  if(!vs.empty()) cout << vs[0];
  FOR(i,1,SZ(vs)) cout << " " << vs[i];
  cout << endl;

  return 0;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User okaduki
Language C++11 (GCC 4.9.2)
Score 100
Code Size 1843 Byte
Status AC
Exec Time 48 ms
Memory 924 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 27 ms 800 KB
scrambled_01.txt AC 27 ms 732 KB
scrambled_02.txt AC 27 ms 772 KB
scrambled_03.txt AC 24 ms 924 KB
scrambled_04.txt AC 23 ms 920 KB
scrambled_05.txt AC 44 ms 924 KB
scrambled_06.txt AC 31 ms 880 KB
scrambled_07.txt AC 48 ms 800 KB
scrambled_08.txt AC 44 ms 792 KB
scrambled_09.txt AC 25 ms 792 KB
scrambled_10.txt AC 25 ms 728 KB
scrambled_11.txt AC 25 ms 924 KB
scrambled_12.txt AC 29 ms 920 KB
scrambled_13.txt AC 27 ms 792 KB
scrambled_14.txt AC 26 ms 920 KB
scrambled_15.txt AC 26 ms 788 KB
scrambled_16.txt AC 23 ms 920 KB
scrambled_17.txt AC 23 ms 924 KB
scrambled_18.txt AC 25 ms 916 KB