Official

A - 真夏の気温差 / Midsummer Temperature Difference Editorial by admin

swe-2-high

For each day, the program computes \(A_i-B_i\) and appends L when it is at least \(K\), otherwise S. Because days are processed from day \(1\) to day \(N\), the \(i\)-th output character is exactly the classification of day \(i\). Each input pair is read once and classified in constant time, so the time complexity is \(O(N)\). The input itself is not stored, but the length-\(N\) output string is, giving \(O(N)\) space complexity.