about summary refs log tree commit diff
path: root/others/other/README.md
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-16 21:59:09 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-02-16 21:59:09 +0700
commitfed71ad5b9c7e3524931b939ec369a559cf2b0b9 (patch)
treebcec2b6222af87088a6066524ebd0bcfebcbf2b8 /others/other/README.md
parent5a44eb260b9b35096df7371a702ba99b7265b3f9 (diff)
downloadcp-fed71ad5b9c7e3524931b939ec369a559cf2b0b9.tar.gz
Add others/other/spiral.pas
Diffstat (limited to 'others/other/README.md')
-rw-r--r--others/other/README.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/others/other/README.md b/others/other/README.md
index 8126221..067ea64 100644
--- a/others/other/README.md
+++ b/others/other/README.md
@@ -200,6 +200,29 @@ Tệp `FDP.OUT` gồm một dòng duy nhất ghi số tự nhiên k.
 |  10 10  |    2    |
 | 100 15  |   24    |
 
+## Vòng xoắn số nguyên
+
+Cho số nguyên dương n. Viết các số từ 1 đến n theo hình xoắn trôn ốc chữ nhật
+nằm ngang vuông nhất có thể.
+
+### Dữ liệu
+
+Tệp `SPIRAL.INP` gồm một dòng duy nhất ghi số nguyên dương n.
+
+### Kết quả
+
+Tệp `SPIRAL.OUT` ghi vòng xoắn trôn ốc.
+
+### Giới hạn
+
+n ≤ 10<sup>6</sup>.
+
+### Ví dụ
+
+| SPIRAL.INP |            SPIRAL.OUT            |
+| ---------- | -------------------------------- |
+|     12     | 1 2 3 4<br>10 11 12 5<br>9 8 7 6 |
+
 ## Từ điển
 
 Cho một từ điển gồm n từ w. Với q truy vấn, mỗi truy vấn đưa ra một xâu s, đếm