From 65b8ebda4c47fa27ac28899fb2b29097f445b6df Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Mon, 13 Jan 2020 16:29:31 +0700 Subject: I'm so burnt out rn --- codechef/brkbks.lua | 14 ++++++++++++++ codechef/chfdora.c | 33 +++++++++++++++++++++++++++++++++ codechef/dynamo.py | 7 +++++++ 3 files changed, 54 insertions(+) create mode 100755 codechef/brkbks.lua create mode 100644 codechef/chfdora.c create mode 100755 codechef/dynamo.py diff --git a/codechef/brkbks.lua b/codechef/brkbks.lua new file mode 100755 index 0000000..88dc15b --- /dev/null +++ b/codechef/brkbks.lua @@ -0,0 +1,14 @@ +#!/usr/bin/env lua +local read = io.read +local print = print + +for t = 1, read('*n') do + local s, w1, w2, w3 = read('*n', '*n', '*n', '*n') + if w1 + w2 + w3 <= s then + print(1) + elseif w1 + w2 <= s or w2 + w3 <= s then + print(2) + else + print(3) + end +end diff --git a/codechef/chfdora.c b/codechef/chfdora.c new file mode 100644 index 0000000..fc0dbf6 --- /dev/null +++ b/codechef/chfdora.c @@ -0,0 +1,33 @@ +#include + +int min(int a, int b) +{ + return (a < b) ? a : b; +} + +int main() +{ + int t, n, m; + + scanf("%d", &t); + while (t--) { + scanf("%d %d", &n, &m); + size_t a[n][m]; + for (int i = 0; i < n; ++i) + for (int j = 0; j < m; ++j) + scanf("%zu", a[i] + j); + + size_t count = 0; + for (int i = 0; i < n; ++i) + for (int j = 0; j < m; ++j) { + int max = min(min(i, j), min(n-i, m-j)-1); + for (int k = 0; + k <= max && a[i+k][j] == a[i-k][j] + && a[i][j+k] == a[i][j-k]; + count++, ++k); + } + printf("%zu\n", count); + } + + return 0; +} diff --git a/codechef/dynamo.py b/codechef/dynamo.py new file mode 100755 index 0000000..429a604 --- /dev/null +++ b/codechef/dynamo.py @@ -0,0 +1,7 @@ +#!/usr/bin/env python +for t in range(int(input())): + n = 10 ** int(input()) + print(n*2 + int(input()), flush=True) + print(n - int(input()), flush=True) + print(n - int(input()), flush=True) + input() -- cgit 1.4.1