From 275ffe02fb08740111e45f0d4d6d533ba308096d Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Fri, 17 May 2013 11:35:28 +0200 Subject: add detect_new diff --git a/Makefile b/Makefile index 24b9395..c857c19 100644 --- a/Makefile +++ b/Makefile @@ -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 +#include +#include + +using namespace std; + +int main() { + set 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; +} -- cgit v0.10.1