complete 10419.cpp and cpp Makefile update

This commit is contained in:
2025-05-12 18:42:17 +09:00
parent b787e97487
commit 0a117b5038
2 changed files with 22 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ BUILD_DIR = ../../build
OUTPUT = cpp.out
all: build
build:
$(CC) -o $(BUILD_DIR)/$(OUTPUT) -O2 -Wall -lm --std=c++17 -fsanitize=address,leak,undefined $(SRC_DIR)/$(TARGET)

View File

@@ -0,0 +1,20 @@
#include <iostream>
int max_late_time(int d) {
int s = 1;
while (s * s + s <= d) {
s++;
}
return s - 1;
}
int main() {
int T;
std::cin >> T;
int d;
for (int t = 0; t < T; t++) {
std::cin >> d;
std::cout << max_late_time(d) << std::endl;
}
return 0;
}