Submission #371299


Source Code Expand

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;


int main(){
  string str;
  getline(cin, str);

  string ret = "";
  while(true){
    string tmp = "";
    while(true){
      string::size_type idx = str.find("not not ");
      if(idx == string::npos){
        tmp += str;
        break;
      }else{
        if(idx+10<str.length()){
          if(str.substr(idx+8, 3) == "not"){
            tmp += str.substr(0,idx+4);
            str = str.substr(idx+4);
          }else{
            tmp += str.substr(0,idx);
            str = str.substr(idx+8);
          }
        }else{
          tmp += str;
          break;
        }
      }
    }
    if(ret == tmp) break;
    ret = tmp;
    str = tmp;
  }

  cout << ret << endl;
  return 0;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User phyllo
Language C++ (GCC 4.9.2)
Score 0
Code Size 1238 Byte
Status WA
Exec Time 287 ms
Memory 920 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 18
WA × 1
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 26 ms 804 KB
scrambled_01.txt AC 26 ms 796 KB
scrambled_02.txt AC 26 ms 916 KB
scrambled_03.txt AC 26 ms 920 KB
scrambled_04.txt WA 26 ms 920 KB
scrambled_05.txt AC 287 ms 912 KB
scrambled_06.txt AC 28 ms 792 KB
scrambled_07.txt AC 269 ms 796 KB
scrambled_08.txt AC 263 ms 916 KB
scrambled_09.txt AC 26 ms 916 KB
scrambled_10.txt AC 27 ms 916 KB
scrambled_11.txt AC 26 ms 916 KB
scrambled_12.txt AC 27 ms 920 KB
scrambled_13.txt AC 27 ms 920 KB
scrambled_14.txt AC 28 ms 920 KB
scrambled_15.txt AC 27 ms 808 KB
scrambled_16.txt AC 25 ms 920 KB
scrambled_17.txt AC 28 ms 792 KB
scrambled_18.txt AC 26 ms 920 KB