Migration to another compiler version and older cmake
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
void print(std::vector<int>& gifts) {
|
void print(std::vector<int>& gifts) {
|
||||||
for (auto gift : gifts)
|
for (auto gift : gifts)
|
||||||
@@ -16,7 +17,7 @@ namespace {
|
|||||||
std::sort(gifts.begin(), gifts.end());
|
std::sort(gifts.begin(), gifts.end());
|
||||||
|
|
||||||
for (int i = 0; i < k; ++i) {
|
for (int i = 0; i < k; ++i) {
|
||||||
auto value = std::sqrtl(gifts[gifts.size() - 1]);
|
auto value = std::sqrt(gifts[gifts.size() - 1]);
|
||||||
if (value == 1)
|
if (value == 1)
|
||||||
continue;
|
continue;
|
||||||
auto it = std::upper_bound(gifts.begin(), gifts.end(), value);
|
auto it = std::upper_bound(gifts.begin(), gifts.end(), value);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <cstddef>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct Coord {
|
struct Coord {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <span>
|
#include <span>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.30)
|
cmake_minimum_required(VERSION 3.25)
|
||||||
|
|
||||||
project(leetcode)
|
project(leetcode)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|||||||
Reference in New Issue
Block a user