From 0a117b5038ba3def0aef026a1c1d02c2358a248a Mon Sep 17 00:00:00 2001 From: yenru0 Date: Mon, 12 May 2025 18:42:17 +0900 Subject: [PATCH] complete 10419.cpp and cpp Makefile update --- space/src-cpp/Makefile | 2 ++ storage/zeta/cpp/completed/10419.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 storage/zeta/cpp/completed/10419.cpp diff --git a/space/src-cpp/Makefile b/space/src-cpp/Makefile index 7d04d2b..56c8811 100644 --- a/space/src-cpp/Makefile +++ b/space/src-cpp/Makefile @@ -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) diff --git a/storage/zeta/cpp/completed/10419.cpp b/storage/zeta/cpp/completed/10419.cpp new file mode 100644 index 0000000..854a2c7 --- /dev/null +++ b/storage/zeta/cpp/completed/10419.cpp @@ -0,0 +1,20 @@ +#include + +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; +} \ No newline at end of file