From 9e28e4c7b67c54229df11d355047ac8a88ea1817 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sun, 15 Dec 2019 15:09:13 +0700 Subject: Normalize pathname --- NTU/smaca.c | 61 ------------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 NTU/smaca.c (limited to 'NTU/smaca.c') diff --git a/NTU/smaca.c b/NTU/smaca.c deleted file mode 100644 index 711040a..0000000 --- a/NTU/smaca.c +++ /dev/null @@ -1,61 +0,0 @@ -#include -#include -#include - -long gcd(long a, long b) -{ - long c; - while (b) { - c = a % b; - a = b; - b = c; - } - return a; -} - -int main() -{ - char m, n, i, j, l, val0 = 0, *val; - long *k, *h, x, g; - - scanf("%hhd %hhd", &m, &n); - - val = malloc(n); - for (i = 0; i < n; i++) - val[i] = 1; - - k = malloc(m * 4); - for (i = 0; i < m; i++) - scanf("%ld", &k[i]); - - h = malloc(m * 4); - for (i = 0; i < n; i++) { - memcpy(h, k, m * 4); - - for (j = 0; j < m; j++) { - scanf("%ld", &x); - for (l = 0; l < m && x > 1; l++) { - g = gcd(h[l], x); - h[l] /= g; - x /= g; - } - if (x > 1) { - val[i] = 0; - for (j++; j < m; j++) - scanf("%ld", &x); - break; - } - } - - if (val[i]) - val0++; - } - - printf("%hhd\n", val0); - for (i = 0; i < n; i++) - if (val[i]) - printf("%hhd ", i + 1); - puts("\b"); - - return 0; -} -- cgit 1.4.1