PE2 (AY20/21)
Problems
1. Tic Tac Toe
2. Sun
for (max = 0; tri <= n; max += 1)
{
tri = max * (max + 1) / 2;
}
for (long x = max - 2; x >= 0; x -= 1)
{
tri = x * (x + 1) / 2;
if (is_prime(n - tri))
{
cs1010_print_long(n - tri);
cs1010_print_string(" ");
cs1010_println_long(tri);
}
}3. Replace*
The official answer
My Recursive solution
4. Soil
5. Substring*
Tips
Last updated