diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | detect_new.cpp | 19 |
2 files changed, 20 insertions, 1 deletions
@@ -8,7 +8,7 @@ NTLIB := -lboost_iostreams $W/%: $W/%.cpp @/bin/echo -e "GCC\t$@" - @$(CXX) $(NTLIB) -o $@ $^ + @$(CXX) $(NTLIB) -O2 -o $@ $^ rec_clean :: $W/clean $W/clean: diff --git a/detect_new.cpp b/detect_new.cpp new file mode 100644 index 0000000..e5bf80c --- /dev/null +++ b/detect_new.cpp @@ -0,0 +1,19 @@ +#include <set> +#include <string> +#include <iostream> + +using namespace std; + +int main() { + set<string> known; + string i; + for (getline(cin, i); cin.good(); getline(cin, i)) { + if (known.count(i)) { + cout << "0" << endl; + }else{ + known.insert(i); + cout << "1" << endl; + } + } + return 0; +} |