From 2f674dc80f0382f1c3178f435714960734dc9d3c Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sat, 6 Jun 2020 21:33:13 +0700 Subject: Reorganize stuff from secondary school --- 09/TP-HN-2014/cau2.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 09/TP-HN-2014/cau2.cpp (limited to '09/TP-HN-2014/cau2.cpp') diff --git a/09/TP-HN-2014/cau2.cpp b/09/TP-HN-2014/cau2.cpp deleted file mode 100644 index 8c87168..0000000 --- a/09/TP-HN-2014/cau2.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include - -using namespace std; - -int -main() -{ - ifstream infile; - infile.open("CAU2.INP"); - short n, i, j; - long d, count = 0; - infile >> n >> d; - short* v = (short*) malloc(n * sizeof(short)); - for (i = 0; i < n; i++) - { - infile >> v[i]; - for (j = 0; j < i; j++) - if (d * (v[i] - v[j]) > v[i] * v[j] * (i - j)) - count++; - } - infile.close(); - free(v); - - ofstream outfile; - outfile.open("CAU2.OUT"); - outfile << count << endl; - outfile.close(); - - return 0; -} -- cgit 1.4.1