diff options
-rw-r--r-- | test.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test.php b/test.php new file mode 100644 index 0000000..9ba6cd5 --- /dev/null +++ b/test.php @@ -0,0 +1,23 @@ +<?php +// PHP + +function gcd(int $a, int $b) { + if ($b > 0) return gcd($b, $a % $b); + else return $a; +} + +echo "test\n"; + +const N = 1000; +$A = array(); +for ($i = 0; $i < N; $i++) { + $A[$i] = $i; +} + +$ans = 0; +foreach ($A as $i) { + foreach ($A as $j) { + $ans += gcd($i, $j); + } +} +echo $ans; |