about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2016-10-22 11:07:02 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2016-10-22 11:07:02 +0700
commit88ae37bb28a41ea8844532c38e5cd8622b9f4701 (patch)
tree89f7f7cb7b5bdc3015a76d3d11ca4ef09b55b108
parent14cb73f4784ad91adfcf3c454275f0c614442400 (diff)
downloadcp-88ae37bb28a41ea8844532c38e5cd8622b9f4701.tar.gz
Add COCI 2006-2007 Contest 1
-rw-r--r--12/TP-2010/README.md1
-rw-r--r--COCI/2006-2007/contest1/herman.c15
-rw-r--r--COCI/2006-2007/contest1/modulo.c21
-rw-r--r--COCI/2006-2007/contest1/okviri.c69
-rw-r--r--COCI/README.md5
-rw-r--r--README.md6
6 files changed, 115 insertions, 2 deletions
diff --git a/12/TP-2010/README.md b/12/TP-2010/README.md
new file mode 100644
index 0000000..625312d
--- /dev/null
+++ b/12/TP-2010/README.md
@@ -0,0 +1 @@
+![](TP-2010.png)
diff --git a/COCI/2006-2007/contest1/herman.c b/COCI/2006-2007/contest1/herman.c
new file mode 100644
index 0000000..718a3ad
--- /dev/null
+++ b/COCI/2006-2007/contest1/herman.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <math.h>
+
+int main()
+{
+	short r;
+	long r2;
+
+	scanf("%hd", &r);
+	r2 = r * r;
+
+	printf("%.6f\n%ld.000000\n", r2 * M_PI, r2 * 2);
+
+	return 0;
+}
diff --git a/COCI/2006-2007/contest1/modulo.c b/COCI/2006-2007/contest1/modulo.c
new file mode 100644
index 0000000..14c0556
--- /dev/null
+++ b/COCI/2006-2007/contest1/modulo.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+int main()
+{
+	char i, mod[42] = {};
+	short a;
+
+	for (i = 0; i < 10; i++) {
+		scanf("%hd", &a);
+		mod[a % 42]++;
+	}
+
+	a = 0;
+	for (i = 0; i < 42; i++)
+		if (mod[i])
+			a++;
+
+	printf("%hd\n", a);
+
+	return 0;
+}
diff --git a/COCI/2006-2007/contest1/okviri.c b/COCI/2006-2007/contest1/okviri.c
new file mode 100644
index 0000000..33d186c
--- /dev/null
+++ b/COCI/2006-2007/contest1/okviri.c
@@ -0,0 +1,69 @@
+#include <stdio.h>
+#include <string.h>
+
+void ln1(char len)
+{
+	char i;
+
+	for (i = 0; i < len; i++) {
+		if (i % 12 == 10)
+			putchar(42);
+		else if (i % 4 == 2)
+			putchar(35);
+		else
+			putchar(46);
+	}
+
+	putchar(10);
+}
+
+void ln2(char len)
+{
+	char i;
+
+	for (i = 0; i < len; i++) {
+		if (i % 12 == 9 || i % 12 == 11)
+			putchar(42);
+		else if (i % 2)
+			putchar(35);
+		else
+			putchar(46);
+	}
+
+	putchar(10);
+}
+
+void ln3(char *s)
+{
+	char i;
+
+	printf("#.%c.", *s);
+
+	for (i = 1; i < strlen(s); i++) {
+		if (i % 3 == 1)
+			printf("#.%c.", s[i]);
+		else
+			printf("*.%c.", s[i]);
+	}
+
+	if (strlen(s) % 3)
+		puts("#");
+	else
+		puts("*");
+}
+
+int main()
+{
+	char s[16], len;
+
+	scanf("%s", s);
+	len = strlen(s) * 4 + 1;
+
+	ln1(len);
+	ln2(len);
+	ln3(s);
+	ln2(len);
+	ln1(len);
+
+	return 0;
+}
diff --git a/COCI/README.md b/COCI/README.md
new file mode 100644
index 0000000..9dac833
--- /dev/null
+++ b/COCI/README.md
@@ -0,0 +1,5 @@
+# CROATIAN OPEN COMPETITION IN INFORMATICS
+
+## COCI 2006-2007
+
+- [ ] [Contest 1](http://www.hsin.hr/coci/archive/2006_2007/contest1_tasks.pdf)
diff --git a/README.md b/README.md
index 6cc57b0..5c131bf 100644
--- a/README.md
+++ b/README.md
@@ -3,14 +3,16 @@
 Bài tập luyện tập thi Olympic, học sinh giỏi Tin học, trong đó:
 
 * `10`, `11`, `12` chứa các bài tập, đề thi *chính quy* phân theo lớp
+* `COCI` là các bài tập từ 
+  [Giải Tin học Croatia mở rộng](http://www.hsin.hr/coci/)
 * `NTU` là các bài tập từ [Đại học Nha Trang](http://laptrinh.ntu.edu.vn/)
 * `THT-C` là các bài làm dự thi hội thi Tin học trẻ (không còn đề)
 * `codeforces` chứa các bài tập từ... [Codeforces](http://codeforces.com/)
 * `daily` là các bài từ subreddit
   [/r/dailyprogrammer](https://www.reddit.com/r/dailyprogrammer)
 
-Trong mỗi thư mục con sẽ có tệp `README.md` ghi lại đề bài. Riêng `NTU` và
-`codeforces` sẽ chỉ có danh sách đường dẫn tới cái đề bài. Các đề bài sẽ được
+Trong mỗi thư mục con sẽ có tệp `README.md` ghi lại đề bài. Riêng `COCI`, `NTU`
+và `codeforces` sẽ chỉ có danh sách đường dẫn tới cái đề bài. Các đề bài sẽ được
 cập nhật dần.
 
 Bài làm trên Pascal được được dịch thử trên FPC 2.6 trở lên, bài viết trên C