text stringlengths 7 961k |
|---|
#include "TurnbasedGame.h"
namespace tbsd {
void TurnbasedGame::run() {
mainLoop([this] {processAllActions();});
}
void TurnbasedGame::processAllActions() {
// TODO: make it parallel for actions with the same Action::time
// TODO: make it stop if no players actions left
Unit maxAp = 0;
while... |
#include "pch.h"
#include "ModuleElem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CModuleElem::CModuleElem(mydb::CPackage * pPackage)
: CModuleData<CEntityElem>(pPackage)
{
}
CModuleElem::~CModuleElem()
{
} |
/**
* author: MaGnsi0
* created: 29/07/2021 18:53:32
**/
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0);
int n;
cin >> n;
vector<double> p(n);
for (int i = 0; i < n; ++i) {
cin >> p[i];
}
//dp[i][j] : i(nu... |
#include <Interpreters/InterpreterSystemQuery.h>
#include <Common/DNSResolver.h>
#include <Common/ActionLock.h>
#include <Common/typeid_cast.h>
#include <Common/getNumberOfPhysicalCPUCores.h>
#include <Common/SymbolIndex.h>
#include <Common/ThreadPool.h>
#include <Common/escapeForFileName.h>
#include <Common/ShellComma... |
// Copyright (c) 2011-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2017-2019 The Bulwark developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/... |
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ff = long double;
bool solve(string const& s) {
const int N = s.size();
auto a = s[0], b = s[s.size()-1];
if (a == b) {
return s.size() % 2 == 0;
} else { // a != b
return s.size() % 2 == 1;
}
}
int main() {
... |
#include "../Sources/AppDelegate.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string>
USING_NS_CC;
int main(int argc, char **argv) {
// create the application instance
AppDelegate app;
return Application::getInstance()->run();
} |
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the tools applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGP... |
#include <cstring>
#include <iostream>
#include <jni.h>
#include "interop.hh"
#include "SkShaper.h"
#include "TextLine.hh"
static void unrefTextLine(TextLine* ptr) {
ptr->unref();
}
extern "C" JNIEXPORT jlong JNICALL Java_org_jetbrains_skija_TextLine__1nGetFinalizer
(JNIEnv* env, jclass jclass) {
return sta... |
////////////////////////////////////////////////////////////////////////////
/*
This file is a part of an interpreter for Tao, a high level
object-oriented computing and scripting language.
Copyright (C) 2004-2005, Fu Limin.
Contact: fu.limin.tao@gmail.com, limin.fu@ircc.it
Thi... |
/**************************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to y... |
#include "Geometry/TrackerNumberingBuilder/plugins/CmsTrackerLayerBuilder.h"
#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
#include "Geometry/TrackerNumberingBuilder/plugins/ExtractStringFromDDD.h"
#include "Geometry/TrackerNumberingB... |
/*
Copyright (c) 2019 Flairieve
Copyright (c) 2020-2022 cobrapitz
Copyright (c) 2022 Péter Magyar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation ... |
#include <iostream>
#include <string>
int main() {
int number = 0;
std::cin >> number;
for (int i = 1; i <= number; i++) {
std::cout << i << " ";
}
return 0;
} |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
//===- Fusion.cpp - Implementation of linalg Fusion -----------------------===//
//
// Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... |
#include "Definitions.h"
/****************************************************************************
*
* Function : Main
*
* Description : Main routine for DICOM Storage Service Class SCU
*
****************************************************************************/
int main(int argc, const cha... |
#include "pf/sys/assert.h"
#include "pf/util/compressor/minimanager.h"
using namespace pf_util::compressor;
pf_util::compressor::MiniManager *g_util_compressor_minimanager = nullptr;
template <>
pf_util::compressor::MiniManager
*pf_basic::Singleton<pf_util::compressor::MiniManager>::singleton_ = nullptr;
MiniMana... |
// -*- coding: us-ascii-unix -*-
// Copyright 2014 Lukas Kemmer
//
// Licensed under the Apache License, Version 2.0 (the "License"); you
// may not use this file except in compliance with the License. You
// may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
/*
* TinyJS
*
* A single-file Javascript-alike engine
*
* - Useful language functions
*
* Authored By Gordon Williams <gw@pur3.co.uk>
*
* Copyright (C) 2009 Pur3 Ltd
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "S... |
/******************************************************************************
* Copyright (c) 2017 Philipp Schubert.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of LICENSE.txt.
*
* Contributors:
* Philipp Schubert and others
**********************... |
typedef float val_t;
inline float scan(char **p)
{
float n;
int neg = 1;
while (!isdigit(**p) && **p != '-' && **p != '.') ++*p;
if (**p == '-') neg = -1, ++*p;
for (n=0; isdigit(**p); ++*p) (n *= 10) += (**p-'0');
if (*(*p)++ != '.') return n*neg;
float d = 1;
for (; isdigit(**p); ++*p) n += (d /= 10) * (**p-'... |
// Copyright (c) 2011-2013 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "receiverequestdialog.h"
#include "ui_receiverequestdialog.h"
#include "bitcoinunits.h"
#include "guiconstants.h"
#i... |
/*
* Copyright (C) 2013 Apple Inc. All rights reserved.
* Copyright (C) 2013 University of Szeged. All rights reserved.
* Copyright (C) 2013 Company 100 Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1... |
#include "mathfunctions.h"
#include "tutorial_config.h"
#include "table.h"
#include <iostream>
double improve(double guess, double x) {
double newguess = x / guess;
return (newguess + guess) / 2;
}
bool goodenough(double guess, double x) {
return abs((guess * guess) - x) < 0.00000001;
}
double mysqrt(double x)... |
// Copyright (c) Microsoft Corporation
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "pch.h"
#include "xsapi/system.h"
#include "local_config.h"
#include "xbox_system_factory.h"
#include "Utils.h"
using namespace std;
#if UWP_API || TV_API || UNIT_TEST... |
/// \copyright Tobias Hienzsch 2019-2021
/// Distributed under the Boost Software License, Version 1.0.
/// See accompanying file LICENSE or copy at http://boost.org/LICENSE_1_0.txt
#ifndef TETL_ALGORITHM_TRANSFORM_HPP
#define TETL_ALGORITHM_TRANSFORM_HPP
namespace etl {
/// \brief Applies the given function to a ra... |
/*
* Copyright (c) 2021, Krisna Pranav
*
* SPDX-License-Identifier: BSD-2-Clause
*/
// includes
#include "system/Streams.h"
#include "archs/Arch.h"
#include "system/interrupts/Interupts.h"
#include "system/memory/MMIO.h"
#include "system/memory/Physical.h"
MMIORange::MMIORange()
{
}
MMIORange::MMIORange(size_t si... |
// ping_pong.cpp
#define N 13
#include <iostream>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <mpi.h>
using namespace std;
int toDo (int, int, int);
int main(int argc, char const *argv[])
{
MPI_Init(NULL, NULL);
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
int world_rank;
MPI... |
#pragma once
#include "glad/gl.h"
namespace baphomet::gl {
enum class BufTarget {
array = GL_ARRAY_BUFFER,
atomic_counter = GL_ATOMIC_COUNTER_BUFFER,
copy_read = GL_COPY_READ_BUFFER,
copy_write = GL_COPY_WRITE_BUFFER,
dispatch_indirect = GL_DISPATCH_INDIRECT_BUFFER,
draw_indirect = GL_DRAW_INDIRECT_BUFFE... |
#ifndef VICTOR_UTILS_HPP
#define VICTOR_UTILS_HPP
/**
* Useful utility function when working with Victor
*/
#include <victor_hardware_interface_msgs/JointValueQuantity.h>
namespace victor_utils
{
static victor_hardware_interface_msgs::JointValueQuantity vectorToJvq(const std::vector<double> &v)
{
... |
#include <iostream>
#include <cstring>
using namespace std;
int main () {
char w1[31],w2[31];
cin >> w1 >> w2;
long long len1=strlen(w1), len2=strlen(w2), minlen,i;
if (len1<len2){minlen=len1;}
else {minlen=len2;}
for (i=0; i<minlen; i=i+1){
if (w1[i] != w2[i]) break;
}
if (w1[i]==w2[i]) {cout <... |
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
#include <QtDebug>
#include "thumbnailmodel.h"
#include "thumbnailengine.h"
ThumbnailModel::ThumbnailModel(QObject * parent)
: QAbstractListModel(parent) {
}
QVariant ThumbnailModel::data(const QModelIndex & index, int role) const {
if(data_vector.size() > index.row()) {
switch(role) {
case Qt::DisplayRole: r... |
/////////////////////////////////////////////////////////////////////////////
// Name: src/html/m_list.cpp
// Purpose: wxHtml module for lists
// Author: Vaclav Slavik
// RCS-ID: $Id$
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
//////////////////////////////////////////... |
/*
* Copyright 2018 Google, LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/codec/SkAndroidCodec.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkSurfa... |
/* ****************************************************************
*
* Copyright 2014 Samsung Electronics All Rights Reserved.
*
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... |
/*************************************************************************
*
* Copyright 2020 Realm Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/lice... |
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is d... |
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2019 The PIVX developers
// Copyright (c) 2018-2019 The BLTG developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or htt... |
// Boost.TypeErasure library
//
// Copyright 2011 Steven Watanabe
//
// Distributed under the Boost Software License Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// $Id: builtin.hpp 83237 2013-03-02 01:03:12Z steven_watanabe $
#ifndef BOOST_TYPE_ERASURE_... |
#include "ofRectangle.h"
ofRectangle::ofRectangle (){
x = y = width = height = 0.0f;
}
ofRectangle::~ ofRectangle (){}
ofRectangle::ofRectangle (float _x, float _y, float _w, float _h){
x = _x;
y = _y;
width = _w;
height = _h;
}
ofRectangle::ofRectangle (ofRectangle const & r){
x = r.x;
y = r.y;
width = r... |
#include<bits/stdc++.h>
using namespace std;
int add(int a, int b) {
// Your code here
return a + b;
}
int main() {
int a, b;
cin >> a >> b;
cout << add(a, b) << endl;
return 0;
} |
#ifdef STAN_OPENCL
#include <stan/math/prim.hpp>
#include <test/unit/math/opencl/util.hpp>
#include <test/unit/util.hpp>
#include <gtest/gtest.h>
#include <algorithm>
auto diag_matrix_functor
= [](const auto& a) { return stan::math::diag_matrix(a); };
TEST(OpenCLPrim, diag_matrix_small) {
stan::math::vector_d d... |
#include <adbase/Mc.hpp>
#include <adbase/Logging.hpp>
namespace adbase {
namespace mc {
// {{{ ClientHandler::ClientHandler()
ClientHandler::ClientHandler(EventBasePtr& base, const std::string& hostname, int port,
Timer* timer, bool isRetry) :
_base(base),
_hostname(hostname),
_port(port),
_timer(timer),... |
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <memory>
#include <vector>
namespace ov {
template <typename NodeType>
class Output;
class Node;
using NodeVector = std::vector<std::shared_ptr<Node>>;
using OutputVector = std::vector<Output<Node>>;
} //... |
/**
* @file
* @copyright defined in eos/LICENSE.txt
*/
#include <eosio/chain/eosio_contract.hpp>
#include <eosio/chain/contract_table_objects.hpp>
#include <eosio/chain/controller.hpp>
#include <eosio/chain/transaction_context.hpp>
#include <eosio/chain/apply_context.hpp>
#include <eosio/chain/transaction.hpp>
#i... |
#include <functional>
#include <iostream>
#include <map>
#include <utility>
#include <boost/program_options.hpp>
#include "LinearProgram.h"
#include "Pivot.h"
namespace po = boost::program_options;
std::map<std::string, std::function<PivotFunctionReturnType(Tableau &tableau)>> pivotFunctions;
std::string allowedPiv... |
#include "FileContextMenu.h"
#include <GitQlientSettings.h>
#include <QApplication>
#include <QClipboard>
FileContextMenu::FileContextMenu(const QString &file, bool editionAllowed, QWidget *parent)
: QMenu(parent)
{
setAttribute(Qt::WA_DeleteOnClose);
const auto fileHistoryAction = addAction(tr("History"))... |
#include <stdio.h>
#include "Halide.h"
#include <iostream>
using namespace Halide;
int main(int argc, char **argv) {
Var x("x"), y("y");
Func f("f"), g("g"), h("h");
printf("Defining function...\n");
f(x, y) = max(x, y);
g(x, y) = min(x, y);
h(x, y) = clamp(x+y, 20, 100);
Var xo("xo"),... |
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "... |
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* CustomException.hpp :+: :+: :+: ... |
/*
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[100001];
int p[20][100001], d[100001];
bool v[100001];
void dfs(int cur)
{
v[cur]=1;
for(int next : adj[cur])
{
if(!v[next])
{
p[0][next]=cur;
d[next]=d[cur]+1;
dfs(next);
}
}
}
in... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "orttraining/training_ops/cuda/tensor/slice_grad.h"
#include "core/providers/cpu/tensor/utils.h"
#include "core/providers/cuda/tensor/slice_impl.h"
namespace onnxruntime {
namespace cuda {
ONNX_OPERATOR_KERNEL_EX... |
#include <vector>
#include <list>
#include <iostream>
#include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
vector<int> ivec;
list<int> ilst;
ivec.push_back(1);
ivec.push_back(2);
ivec.push_back(100);
ivec.push_back(4);
ivec.push_back(5);
ilst.push_back(1);
ilst.push_back(42);
ils... |
//===--- SILGenBuiltin.cpp - SIL generation for builtin call sites -------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
#include "TimerQueue.h"
#include "muduo-c11/base/Timestamp.h"
#include "EventLoop.h"
#include "Timer.h"
#include "TimerId.h"
#include <sys/timerfd.h>
#include <iostream>
#include <unistd.h> // read
namespace muduo {
namespace detail {
int createTimerfd() {
int timerfd = ::timerfd_create(CLOC... |
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2018 The VELES developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "activemasternode.h"
#include "db.h"
#include "init.h"
#include "main.h"... |
// Copyright 2015-2020 Tier IV, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... |
/**********
Copyright (c) 2020, Xilinx, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the fol... |
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/op/util/attr_types.hpp"
#include "ngraph/opsets/opset8.hpp"
#include "util/visitor.hpp"
using namespace std;
using namespace ngraph;
using ngraph::test::NodeBui... |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
/*******************************************************************************
*
* MIT License
*
* Copyright (c) 2019 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* ... |
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the terms found in... |
#pragma once
#include <exception>
#include <string>
#include <sstream>
#include <iostream>
#define TEST_MAIN(...) int __attribute__((const)) main(__VA_ARGS__)
#define TEST_IMPL_DEPARENS(...) __VA_ARGS__
#define SA_SAME(value, type) \
static_assert( \
::std::is_same_v<TEST_IMPL_DEPARENS value, ... |
#ifndef _ANIMATEDENTITY_HPP_
#define _ANIMATEDENTITY_HPP_
class AnimatedEntity {
private:
int spriteInitX;
int spriteEndX;
int spriteInitY;
int spriteEndY;
public:
AnimatedEntity(int spriteInitX, int spriteEndX, int spriteInitY, int spriteEndY);
int getSpriteInitX() const;
int getSpriteEndX() const;
int getS... |
///
/// Copyright (c) 2017, Intel Corporation
///
/// Redistribution and use in source and binary forms, with or without
/// modification, are permitted provided that the following conditions
/// are met:
///
/// * Redistributions of source code must retain the above copyright
/// notice, this list of conditions ... |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "testPch.h"
#include <functional>
#include "cppwinrt_onnx.h"
#include "AdapterSessionTest.h"
#include "ILotusValueProviderPrivate.h"
#include "onnxruntime_c_api.h"
#include "OnnxruntimeEngine.h"
#include "Onnxru... |
// Autogenerated from CppHeaderCreator
// Created by Sc2ad
// =========================================================================
#pragma once
// Begin includes
#include "beatsaber-hook/shared/utils/typedefs.h"
#include "beatsaber-hook/shared/utils/byref.hpp"
// Including type: System.Runtime.Serialization.IForma... |
// Copyright (c) 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
#include "Component.h"
Component::Component()
{
}
Component::~Component()
{
} |
#include <amax.system/exchange_state.hpp>
#include <eosio/check.hpp>
#include <cmath>
namespace eosiosystem {
using eosio::check;
asset exchange_state::convert_to_exchange( connector& reserve, const asset& payment )
{
const double S0 = supply.amount;
const double R0 = reserve.balance.amount;
... |
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
/*!
* Copyright (c) 2018 by Contributors
* \file src/tvm/relay/pass/alpha_eq.cc
* \brief Compute the set of variables not bound in the expression.
*/
#include <tvm/relay/expr_functor.h>
#include "./type_visitor.h"
#include "tvm/relay/pass.h"
namespace tvm {
namespace relay {
using namespace tvm::runtime;
struct... |
/**
* The Forgotten Server - a free and open-source MMORPG server emulator
* Copyright (C) 2015 Mark Samman <mark.samman@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; eithe... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
#include <cstdio>
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
int dp[301], in[301];
int main(){
int n;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d", &in[i]);
}
dp[0] = in[0];
for(int i=1; i<n; i++){
if( i == 1 ) dp[i] = MAX(dp[i-1] + in[i], in[i]);
else if( i == 2) dp[i] = MAX(dp[i-2] +... |
#if COMPILATION_INSTRUCTIONS
mpicxx -O3 -std=c++17 -Wfatal-errors $0 -o $0x.x && time mpirun -np 4 $0x.x $@ && rm -f $0x.x; exit
#endif
#include "alf/boost/mpi3/main.hpp"
#include "alf/boost/mpi3/version.hpp"
#include<iostream>
namespace mpi3 = boost::mpi3;
using std::cout;
int mpi3::main(int argc, char* argv[], mp... |
#include "catboost_logger_helpers.h"
void TMetricsAndTimeLeftHistory::TryUpdateBestError(const IMetric& metric, double error, THashMap<TString, double>& bestError, bool updateBestIteration) {
TString metricDescription = metric.GetDescription();
bool shouldUpdate = false;
if (!bestError.contains(metricDescr... |
/*
* librdkafka - Apache Kafka C library
*
* Copyright (c) 2012-2018, Magnus Edenhill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the... |
/*
Copyright (c) 2014-2015, Vlad Mesco
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following... |
#include "Main.h"
int main()
{
#ifdef MAIN_RETARGET
return RetargetMain();
#endif
#ifdef MAIN_VIEWER
return ViewerMain();
#endif
#ifdef MAIN_PLANNER
return PlannerMain();
#endif
} |
#ifndef FACTORY_CRC_HPP
#define FACTORY_CRC_HPP
#include <string>
#include <sstream>
#include "Module/CRC/CRC.hpp"
#include "../../Factory.hpp"
namespace aff3ct
{
namespace factory
{
extern const std::string CRC_name;
extern const std::string CRC_prefix;
struct CRC : public Factory
{
class parameters : public Fact... |
#include "ofxTCPServer.h"
#include "ofxTCPClient.h"
//--------------------------
ofxTCPServer::ofxTCPServer(){
verbose = true;
connected = false;
idCount = 0;
port = 0;
str = "";
messageDelimiter = "[/TCP]";
}
//--------------------------
ofxTCPServer::~ofxTCPServer(){
close();
}
//----------------------... |
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
START_ATF_NAMESPACE
#pragma pack(push, 1)
struct _effect_start_inform_zocl
{
char byLv;
unsigned __int16 wEffectCode;
unsigned __in... |
/*
* crtTM.cpp
*
* Created on: 2013-2-13
* Author: fasiondog
*/
#include "crtTM.h"
namespace hku {
TradeManagerPtr HKU_API crtTM(const Datetime& datetime, price_t initcash,
const TradeCostPtr& costfunc, const string& name) {
return TradeManagerPtr(new TradeManager(datetime, initcash, costfunc,... |
// Andrew Naplavkov
#ifndef BRIG_DATABASE_ORACLE_CLIENT_VERSION_HPP
#define BRIG_DATABASE_ORACLE_CLIENT_VERSION_HPP
#include <brig/database/oracle/detail/lib.hpp>
#include <brig/string_cast.hpp>
#include <string>
namespace brig { namespace database { namespace oracle {
inline std::string client_version()
{
if (de... |
// (C) Copyright Beman Dawes 2008
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/config for more information.
// MACRO: BOOST_NO_... |
/**
* Copyright (C) 2012-2014 MongoDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License, version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful... |
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2017-, Southwest Research Institute
* Copyright (c) 2017-, Open Perception, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are... |
#include "IntNode.h"
using namespace std;
IntNode* create_newIntNode(int v)
{
IntNode temp;
IntNode* ptr = temp.create();
ptr->setValue(v);
cout << "construct IntNode" << endl;
return ptr;
}
std::ostream& operator<<(std::ostream& os, const IntNode& n)
{
n.print(os);
return os;
}
IntNode::IntNode(int value) ... |
#include "math.h"
#include "str_modifiers.h"
#include "serial.h"
String lzeros(int number, int format_places){
/* Add zeros to int numbers according to number of places available
* Caution: if no. of number places does not fit the formar places, it
* returns the stringified number instead
* Entrada:
* - [int... |
// dear imgui, v1.86 WIP
// (drawing and font code)
/*
Index of this file:
// [SECTION] STB libraries implementation
// [SECTION] Style functions
// [SECTION] ImDrawList
// [SECTION] ImDrawListSplitter
// [SECTION] ImDrawData
// [SECTION] Helpers ShadeVertsXXX functions
// [SECTION] ImFontConfig
// [SECTION] ImFontA... |
#pragma once
// This file is generated from the Game's Reflection data
#include <cstdint>
#include <RED4ext/Common.hpp>
#include <RED4ext/Scripting/Natives/Generated/world/ProxyBoundingBoxSyncParams.hpp>
#include <RED4ext/Scripting/Natives/Generated/world/ProxyMiscAdvancedParams.hpp>
#include <RED4ext/Scripting/Nativ... |
/*
LICENSE
-------
Copyright 2005-2013 Nullsoft, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of cond... |
// Copyright (c) 2019-2021 Dr. Colin Hirsch and Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/config/
#ifndef TAO_CONFIG_SCHEMA_INTERNAL_ISTRING_HPP
#define TAO_CONFIG_SCHEMA_INTERNAL_ISTRING_HPP
#include "iless.hpp"
#include "node.hpp"
#include <set>
#include <string_view>
namesp... |
// Copyright (c) 2017-2020 The PIVX developers
// Copyright (c) 2020-2021 The PCTM developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "Denominations.h"
#include "amount.h"
namespace libzerocoin {
// All denomi... |
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Copyright (c) 2015-2019 The Bitcoin Unlimited developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "transactionview.h"
#include "addresstablemodel.h"
#inc... |
/// @file
/// @author David Pilger <dpilger26@gmail.com>
/// [GitHub Repository](https://github.com/dpilger26/NumCpp)
/// @version 1.3
///
/// @section License
/// Copyright 2020 David Pilger
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of this
/// software and associated documen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.