complete 10419.cpp and cpp Makefile update

This commit is contained in:
yenru0 committed 2025-05-12 18:42:17 +09:00
1 parent b787e97487
commit 0a117b5038
2 files changed
+22

No files matched your search

+2
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)
+20
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;
}