Fix test
All checks were successful
Build / AerScript (push) Successful in 39s

This commit is contained in:
Rafal Kupiec 2025-08-29 22:37:17 +02:00
parent d73eb9b5b2
commit b4486bf603
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4

View File

@ -6,7 +6,7 @@ class Program {
string $r = '';
for(int $i = 1; $n >= 0 && $i < 10; $i++) {
$r = chr(0x41 + ($n % pow(26, $i) / pow(26, $i - 1))) + $r;
$n -= pow(26, $i);
$n -= (int)pow(26, $i);
}
return $r;
}
@ -15,7 +15,7 @@ class Program {
int $r = 0;
int $l = strlen($a);
for(int $i = 0; $i < $l; $i++) {
$r += pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
$r += (int)pow(26, $i) * (ord($a[$l - $i - 1]) - 0x40);
}
return (int) $r - 1;
}