Add test.php
This commit is contained in:
parent
159c04404b
commit
0de670f324
23
test.php
Normal file
23
test.php
Normal file
|
@ -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;
|
Loading…
Reference in a new issue