complete 10419.cpp and cpp Makefile update
This commit is contained in:
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