summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--detect_new.cpp19
2 files changed, 20 insertions, 1 deletions
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 <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;
+}
contact: Jan Huwald // Impressum