complete 10419.cpp and cpp Makefile update
This commit is contained in:
@@ -8,6 +8,8 @@ BUILD_DIR = ../../build
|
|||||||
|
|
||||||
OUTPUT = cpp.out
|
OUTPUT = cpp.out
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(CC) -o $(BUILD_DIR)/$(OUTPUT) -O2 -Wall -lm --std=c++17 -fsanitize=address,leak,undefined $(SRC_DIR)/$(TARGET)
|
$(CC) -o $(BUILD_DIR)/$(OUTPUT) -O2 -Wall -lm --std=c++17 -fsanitize=address,leak,undefined $(SRC_DIR)/$(TARGET)
|
||||||
|
|
||||||
|
|||||||
20
storage/zeta/cpp/completed/10419.cpp
Normal file
20
storage/zeta/cpp/completed/10419.cpp
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user