Submission #371314
Source Code Expand
#include <iostream> #include <sstream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <cstring> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <map> #include <set> #include <bitset> #include <numeric> #include <utility> #include <iomanip> #include <algorithm> #include <functional> using namespace std; typedef long long ll; typedef vector<int> vint; typedef vector<long long> vll; typedef pair<int,int> pint; typedef pair<long long, long long> pll; #define MP make_pair #define PB push_back #define ALL(s) (s).begin(),(s).end() #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) { return s << '<' << P.first << ", " << P.second << '>'; } template<class T> ostream& operator << (ostream &s, vector<T> P) { for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; } template<class T> ostream& operator << (ostream &s, vector<vector<T> > P) { for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; } template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) { EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; } int main() { //freopen( "/Users/macuser/Dropbox/Contest/input.in", "r", stdin ); string str; string res; while (getline(cin, str)) { res = ""; for (int i = 0; i < (int)str.size(); ++i) { if (str.substr(i, 8) == "not not ") { int j = i; for (j = i; j < (int)str.size(); j += 4) { if (str.substr(j, 4) != "not ") break; } if (!(str.substr(j, 3) == "not" && j == (int)str.size()-3)) { int con = (j-i)/4; if (con & 1) i = j-4; else i = j; } } res += str[i]; } cout << res << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 二重否定除去法則 |
User | drken |
Language | C++ (GCC 4.9.2) |
Score | 100 |
Code Size | 2411 Byte |
Status | AC |
Exec Time | 95 ms |
Memory | 932 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 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 | AC | 25 ms | 932 KB |
scrambled_01.txt | AC | 25 ms | 924 KB |
scrambled_02.txt | AC | 26 ms | 796 KB |
scrambled_03.txt | AC | 25 ms | 808 KB |
scrambled_04.txt | AC | 25 ms | 928 KB |
scrambled_05.txt | AC | 25 ms | 928 KB |
scrambled_06.txt | AC | 95 ms | 924 KB |
scrambled_07.txt | AC | 26 ms | 920 KB |
scrambled_08.txt | AC | 25 ms | 920 KB |
scrambled_09.txt | AC | 26 ms | 916 KB |
scrambled_10.txt | AC | 26 ms | 820 KB |
scrambled_11.txt | AC | 25 ms | 928 KB |
scrambled_12.txt | AC | 26 ms | 916 KB |
scrambled_13.txt | AC | 25 ms | 800 KB |
scrambled_14.txt | AC | 25 ms | 924 KB |
scrambled_15.txt | AC | 25 ms | 924 KB |
scrambled_16.txt | AC | 27 ms | 820 KB |
scrambled_17.txt | AC | 26 ms | 824 KB |
scrambled_18.txt | AC | 25 ms | 932 KB |