93042024-02-20 11:45:18Leventusz09Sakktábla (75 pont)csharpAccepted 75/7532ms23932 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sakktáblatorta{
    class Program{
        static void Main(){
            int[] in1 = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int A = in1.Min();
            int B = in1.Max();

            if (B == 0){
                Console.WriteLine(0);
                return;
            }

            int tmin, i=0;
            while(true){
                tmin = i * i / 2;
                if (A < tmin || B < tmin + ((i%2==1)?(1):(0))) break;
                i++;
            }
            Console.WriteLine(i-1);
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/032ms22284 KiB
2Accepted0/032ms22520 KiB
3Accepted5/532ms22888 KiB
4Accepted5/532ms22940 KiB
5Accepted5/532ms23036 KiB
6Accepted5/532ms23132 KiB
7Accepted5/532ms23032 KiB
8Accepted5/532ms23040 KiB
9Accepted5/532ms23528 KiB
10Accepted5/532ms23932 KiB
11Accepted7/732ms23756 KiB
12Accepted7/730ms23776 KiB
13Accepted7/732ms23672 KiB
14Accepted7/730ms23532 KiB
15Accepted7/732ms23768 KiB