Submission #2355454
Source Code Expand
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <sstream> #include <map> #include <set> #include <queue> #include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <typeinfo> #include <numeric> #include <functional> #include <unordered_map> using namespace std; using ll = long long; using ull = unsigned long long; const ll INF = 1e16; const ll MOD = 1e9 + 7; #define REP(i, n) for(int i = 0; i < n; i++) int main() { string s; getline(cin, s); vector<string> v; string t; REP(i, s.size()){ if(s[i] != ' '){ t += s[i]; } else{ if(t != " "){ v.push_back(t); t = ""; } } } if(!t.empty()){ v.push_back(t); } REP(i, v.size() - 2){ if(v[i] == "not" && v[i + 1] == "not" && v[i + 2] != "not"){ v.erase(v.begin() + i); v.erase(v.begin() + i); i--; } } REP(i, v.size() - 1){ cout << v[i] << ' '; } cout << v[v.size() - 1] << endl; }
Submission Info
Submission Time | |
---|---|
Task | A - 二重否定除去法則 |
User | chocobo |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1190 Byte |
Status | RE |
Exec Time | 115 ms |
Memory | 384 KB |
Judge Result
Set Name | All | ||||||
---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||||
Status |
|
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 | 115 ms | 256 KB |
scrambled_01.txt | AC | 1 ms | 256 KB |
scrambled_02.txt | AC | 1 ms | 256 KB |
scrambled_03.txt | AC | 2 ms | 256 KB |
scrambled_04.txt | AC | 1 ms | 256 KB |
scrambled_05.txt | WA | 2 ms | 384 KB |
scrambled_06.txt | AC | 2 ms | 384 KB |
scrambled_07.txt | WA | 2 ms | 384 KB |
scrambled_08.txt | WA | 2 ms | 384 KB |
scrambled_09.txt | AC | 2 ms | 256 KB |
scrambled_10.txt | AC | 2 ms | 256 KB |
scrambled_11.txt | AC | 2 ms | 256 KB |
scrambled_12.txt | AC | 2 ms | 256 KB |
scrambled_13.txt | AC | 2 ms | 256 KB |
scrambled_14.txt | AC | 2 ms | 256 KB |
scrambled_15.txt | AC | 2 ms | 256 KB |
scrambled_16.txt | AC | 2 ms | 256 KB |
scrambled_17.txt | AC | 2 ms | 256 KB |
scrambled_18.txt | AC | 2 ms | 256 KB |