Submission #371320


Source Code Expand

#include<vector>
#include<map>
#include<climits>
#include<set>
#include<queue>
#include<stack>
#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<bitset>
#include<cstring>
#include<list>
#include<ctime>
#include<iterator>
using namespace std;
typedef vector<string>vs;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<double>vd;
typedef pair<int,int>pii;
typedef long long ll;
typedef pair<ll,ll>pll;
typedef vector<ll>vl;
#define rrep(i,x,n) for(int i=(x);i<(n);++i)
#define rep(i,x) rrep(i,0,(x))
#define fi first
#define se second
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define maxs(a,b) (a)=max(a,b)
#define mins(a,b) (a)=min(a,b)

int main(){

    vs V;
    string str;
    getline(cin,str);

    stringstream ss(str);
    while(ss){
        ss>>str;
        V.pb(str);
    }
    V.pop_back();
    string N="not";
    while(true){
        bool flag=false;
        vs next;
        rep(i,V.size()){
            if(i<V.size()-2){
                if(V[i]==N&&V[i+1]==N&&V[i+2]!=N){
                    i++;
                    flag=true;
                    continue;
                }
            }
            next.pb(V[i]);
        }
        V=next;
        if(!flag)break;
    }

    rep(i,V.size()){
        if(i)cout<<" ";
        cout<<V[i];
    }
    cout<<endl;
    return 0;
}

Submission Info

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