aboutsummaryrefslogtreecommitdiff
path: root/test.js
diff options
context:
space:
mode:
authorAnthony Wang2020-09-12 16:00:30 -0500
committerAnthony Wang2020-09-12 16:00:30 -0500
commitd870dd2be3af6a1a1b859c3bc90485f1101019ac (patch)
tree759a357d8ff64798848e6d7c7b240fc70a54964a /test.js
parent7d881a8f64cdef12df52276e008eb350737ef41b (diff)
Add test.js
Diffstat (limited to 'test.js')
-rw-r--r--test.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..e12086c
--- /dev/null
+++ b/test.js
@@ -0,0 +1,22 @@
+// Node.js
+
+function gcd(a, b) {
+ if (b > 0) return gcd(b, a % b);
+ else return a;
+}
+
+console.log("test");
+
+const N = 1000;
+var A = [];
+for (var i = 0; i < N; i++) {
+ A.push(i);
+}
+
+var ans = 0;
+for (i of A) {
+ for (j of A) {
+ ans += gcd(i, j);
+ }
+}
+console.log(ans);