Submission #372472


Source Code Expand

#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <utility>
#include <vector>
using namespace std;

int main() {
    vector<string> S;
    string str;
    while (cin >> str) {
        S.push_back(str);
    }
    while (true) {
        bool modified = false;
        for (size_t i = 0; i + 2 < S.size(); ++i) {
            if (S[i] == "not" && S[i + 1] == "not" && S[i + 2] != "not") {
                S.erase(S.begin() + i);
                S.erase(S.begin() + i);
                modified = true;
                break;
            }
        }
        if (!modified)
            break;
    }
    for (size_t i = 0; i < S.size(); ++i) {
        cout << S[i];
        if (i + 1 == S.size())
            cout << endl;
        else
            cout << ' ';
    }
    return 0;
}

Submission Info

Submission Time
Task A - 二重否定除去法則
User ClarifierEP
Language C++ (GCC 4.9.2)
Score 100
Code Size 958 Byte
Status AC
Exec Time 46 ms
Memory 932 KiB

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 792 KiB
scrambled_01.txt AC 24 ms 804 KiB
scrambled_02.txt AC 25 ms 796 KiB
scrambled_03.txt AC 25 ms 932 KiB
scrambled_04.txt AC 24 ms 800 KiB
scrambled_05.txt AC 46 ms 864 KiB
scrambled_06.txt AC 25 ms 796 KiB
scrambled_07.txt AC 42 ms 932 KiB
scrambled_08.txt AC 44 ms 924 KiB
scrambled_09.txt AC 23 ms 928 KiB
scrambled_10.txt AC 25 ms 848 KiB
scrambled_11.txt AC 25 ms 920 KiB
scrambled_12.txt AC 25 ms 924 KiB
scrambled_13.txt AC 25 ms 932 KiB
scrambled_14.txt AC 24 ms 928 KiB
scrambled_15.txt AC 25 ms 800 KiB
scrambled_16.txt AC 25 ms 800 KiB
scrambled_17.txt AC 24 ms 932 KiB
scrambled_18.txt AC 26 ms 924 KiB