blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
bad886cc651375909c8472519d0c1c38ea6a8af4 | 7ee4ad40c131f6a2062716896226cd48250a5f5a | CoderDXQ/Brush-Algorithm-problem | /P1160 数组解法.cpp | C++ | cpp | 631 | no_license | #include<bits/stdc++.h>
using namespace std;
int n,a,b,k,v[100000]={0};
struct student{
int l,r;
}d[100000];
int main()
{
cin>>n;
d[0].r=1;d[1].l=0;//头元素
for(int i=2;i<=n;i++){
cin>>a>>b;
if(b)
{ d[d[a].r].l=i;
d[i].r=d[a].r;
d[i].l=a;
d[a].r=i;//一定要放在后面
}
else{
d[d[a].l].r=i;
... |
134421d6c19fd7bd98bb3cf15c0a226824b853b9 | 8315d3c72f6eccf86bac0cd62c31f13900873728 | davidmp/FundamentosProgG2 | /codexample/AlgoritmoCMain.cpp | C++ | cpp | 433 | no_license | #include <iostream>
void suma10Numeros(void){
int contador=1;
float valor_num, suma_numeros=0;
while(contador<=10){
printf("Ingrese valor numerico de la posicion %i :", contador);
scanf("%f",&valor_num);
suma_numeros=suma_numeros+valor_num;
contador=contador+1;
}
printf("La suma de los 10 num... |
80abc9fa16194b6e5e1a766dd64b9146c35f1e65 | a563c7e2fa0616eb03a4aac3031728e0321463a5 | yrnkrn/zapcc | /tools/clang/lib/AST/ASTStructuralEquivalence.cpp | C++ | cpp | 54,215 | permissive | //===--- ASTStructuralEquivalence.cpp - -------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
3b9cf8a5ca19961d4e0b054470f43b878e6053a9 | d9f564c14c814315b12008ead5f22be0156feb3b | cjawahar/wssaLab3 | /SPI_1/FXOS8700CQ.cpp | C++ | cpp | 4,546 | no_license | #include "FXOS8700CQ.h"
#include <math.h>
//******************************************************************************
// Public Function Definitions
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//... |
ccc567552484300a4cf8b637f274909285e10643 | 2815d51496e84eabb604f456bba6dc5dcd831832 | vinceplusplus/z3D | /z3D/Audio/SndPlayer.cpp | C++ | cpp | 4,680 | no_license |
#include "SndPlayer.h"
#include "Oal.h"
#include "wavSndPlayer.h"
#include "ovSndPlayer.h"
#include "openal/include/al/al.h"
namespace z3D
{
namespace Audio
{
SndPlayer::SndPlayer(unsigned int source_name)
{
_source_name=source_name;
}
SndPlayer::~SndPlayer()
{
alDeleteSources(1,&_source_name);
}... |
3fcfa43b00c8972e74857c0db5104c4ed9f18d5e | 645cbf32e06a8837357f3bb90648f5ca837f32fd | DanielNeville/cbmc | /src/linking/linking.cpp | C++ | cpp | 36,753 | permissive | /*******************************************************************\
Module: ANSI-C Linking
Author: Daniel Kroening, kroening@kroening.com
\*******************************************************************/
/// \file
/// ANSI-C Linking
#include <cassert>
#include <stack>
#include <util/find_symbols.h>
#include... |
2330e49d7a27e5678e6a6d5c8065a9d8155822e2 | ea31846a84b0f096528c3f5603c55ca5e6c6c9a3 | litao1009/SimpleRoom | /externals/OCCTLib/inc/RWStepShape_RWFaceOuterBound.hxx | C++ | hxx | 1,833 | no_license | // This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to
// this header file considered to be the "object code" form of the original source.
#ifndef _RWStepShape_RWFaceOuterBound_HeaderFile
#d... |
1995b3414a8117f4f70e9d4716e5052c39977a71 | 98f2c807ac4c47e189be6d7c423f5c00348d8b76 | OUC-MYM/HDU | /2012.cpp | C++ | cpp | 675 | no_license | #include<iostream>
#include<cmath>
using namespace std;
bool is_prime(int n)
{
n=n*n+n+41;
int flag=0;
for(int i=2; i<=sqrt(n)+1; i++)
{
if(n%i==0)
{
flag=1;
break;
}
}
if(flag)
return false;
return true;
}
int main()
{
int x,y;
... |
49779b416b2004ddb829bd287c1e72faa2c469a8 | 0768e8fe36247f37b770ba3d88e3dfe0667949bc | fa93hws/iges_reader | /src/geo/vector3d.cpp | C++ | cpp | 5,798 | no_license | //*************************************************************************
// File: vector3d.cpp
// Author: Yan LIU
// Date: 04-10-2013
// Email: liuyan0411@gmail.com
//*************************************************************************
#include "vector3d.h"
#include <math.h>
NS_BEGIN
double ... |
f5ec899a4ef74d05b2edd376b89769d31c382ce3 | 0e475b9f84d226b4f552def7125388378d3f6729 | Oxann/ETEngine | /Engine/source/EtPipeline/Assets/EditableFontAsset.cpp | C++ | cpp | 18,749 | permissive | #include "stdafx.h"
#include "EditableFontAsset.h"
#include <ft2build.h>
#include <freetype/freetype.h>
#include <stb/stb_image_write.h>
#include <EtCore/FileSystem/FileUtil.h>
#include <EtCore/Content/ResourceManager.h>
#include <EtCore/IO/BinaryWriter.h>
#include <EtRendering/GlobalRenderingSystems/GlobalRenderin... |
e33bee0730442a5b9a3e67f398d0bbe0cdc131bc | da0d4f77ed8224083339bd3422a08688f5f4e829 | wzyy2/chromium-browser | /ash/message_center/message_list_view.cc | C++ | cc | 20,295 | permissive | // Copyright (c) 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/message_center/message_list_view.h"
#include "ash/message_center/message_center_view.h"
#include "base/command_line.h"
#include "base/l... |
2e107c6cb90e05e7819e7d2c0ed04aecb6466465 | 6857f253ad0b1ad196bf16980ca7f82c5699f765 | vishalbelsare/arangodb | /3rdParty/rocksdb/6.27/file/random_access_file_reader.cc | C++ | cc | 16,835 | permissive | // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// Copyright (c) 2011 The LevelDB Authors. All rights r... |
baa929d01c46ec71b39b113b1cbcafd89d354c87 | 4b62a63602744f9eafc34371f87b0f729464678a | cylof22/Granite | /ui/click_button.cpp | C++ | cpp | 2,330 | permissive | /* Copyright (c) 2017-2020 Hans-Kristian Arntzen
*
* 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 the rights to use, copy, modify, me... |
b9fb6ef6894ce7b1652a2c7f4ce5c9541e11ea2e | 787f3cd345aaebecc804cdd2f9e7720ba27c22a7 | anoopemacs/cpp_in_action | /WinCalc05/Serial.cpp | C++ | cpp | 2,338 | no_license | #include "Serial.h"
// Bartosz Milewski (c) 2000
using std::ios_base;
const unsigned long TruePattern = 0xfab1fab2;
const unsigned long FalsePattern = 0xbad1bad2;
Serializer::Serializer (std::string const & nameFile)
: _stream (nameFile.c_str (), ios_base::out | ios_base::binary)
{
if (!_stream.is_open ()... |
e64a347964b6809e7d6df7d2534a320e5d6999c7 | ef50423a4b0ea6e01e92281c4854b005e7f2ae13 | csverma610/Jaal | /Jaal/src/MeshCore/MeshMeanCurvatureFlow.cpp | C++ | cpp | 11,735 | no_license | #include "MeshMeanCurvatureFlow.hpp"
JMeshMeanCurvatureFlow :: JMeshMeanCurvatureFlow()
{
igl::matlab::mlinit(&engine);
}
JMeshMeanCurvatureFlow :: ~JMeshMeanCurvatureFlow()
{
igl::matlab::mlclose(&engine);
}
void JMeshMeanCurvatureFlow :: setMesh(const JMeshPtr &m)
{
orgMesh = m;
currStep = 0;
i... |
340a3fab4d60e7bd55a8af3dce1b59b49956525c | 4f572d290d9a807d9b7c8138305d3461bdd425e4 | zawata/SC-AVG | /SC-AVG/Util.cpp | C++ | cpp | 941 | permissive | #include "stdafx.h"
#include <strsafe.h>
#include <windows.h>
#include "Util.h"
void Util::ErrorExit(LPTSTR lpszFunction)
{
// Retrieve the system error message for the last-error code
LPVOID lpMsgBuf;
LPVOID lpDisplayBuf;
DWORD dw = GetLastError();
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_M... |
592276f7c76e7dce8977eaf7b4aa4cf964b54688 | 9c28091064e5268ace92490f166511ddd4e37e2f | assasinwar9/ScreenTranslator | /src/ocr/tesseract.cpp | C++ | cpp | 8,076 | permissive | #include "tesseract.h"
#include "debug.h"
#include "languagecodes.h"
#include "task.h"
#include <leptonica/allheaders.h>
#include <QBuffer>
#include <QDir>
#include <QLibrary>
#if defined(Q_OS_LINUX)
#include <fstream>
static qint64 getFreeMemory()
{
std::string token;
std::ifstream file("/proc/meminfo");
qint... |
3f19e98970c6823c28390098e1f81c6c126b39a5 | 94e7071d3805b9dacab5c9c05412514ab6258a03 | jsenn/ifcplusplus | /external/Coin3D/src/lists/SoAuditorList.cpp | C++ | cpp | 7,543 | permissive | /**************************************************************************\
* Copyright (c) Kongsberg Oil & Gas Technologies AS
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Red... |
f2c1f428b82f659222cf654b6de30279556b1afb | ef2791c474f900d23d7c462f38756b49c8a82f5e | Coreyander/Linked-List-Line-Editor | /LLLineEditor.cpp | C++ | cpp | 9,636 | no_license | #include <iostream>
#include <string>
using namespace std;
// HEADER ===========================================================================
struct Node {
Node* next = nullptr;
string data;
};
void insertEnd(Node* head, string line);
void insertAt(Node* head, string line, unsigned int n);
void deleteL... |
9be969b79995e6220a60721548d877c2687cc7bf | 83d6eedf2e6d138f103def767fe17accaa7bcd37 | isabella232/libral | /lib/src/host.cc | C++ | cc | 4,093 | permissive | #include <libral/host.hpp>
namespace aug = libral::augeas;
namespace libral {
result<prov::spec> host_provider::describe(environment& env) {
static const std::string desc =
#include "host.yaml"
;
auto aug = env.augeas({ { "Hosts.lns", "/etc/hosts" } });
err_ret(aug);
_aug = aug.ok();
re... |
c7e0c86ca31679bc99ed99aee82ca3ced6599f25 | 9fc7ad5be9b140721ffeb7748dc7afcb1a5b8810 | gpudev0517/Fire-Simulator | /NVIS/External/GFSDK_SSAO_GL/Renderer_GL.cpp | C++ | cpp | 17,839 | no_license | /*
* Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved.
*
* NVIDIA CORPORATION and its licensors retain all intellectual property
* and proprietary rights in and to this software, related documentation
* and any modifications thereto. Any use, reproduction, disclosure or
* distribution of this soft... |
029d20ced2d4768dde1fff18f494f9c8465b49cb | c3ab96e808f41437d27d03164bd80fc076f85f27 | qfizik/tket | /bubble/src/Circuit/ClassicalExpBox.hpp | C++ | hpp | 3,678 | permissive | // Copyright 2019-2021 Cambridge Quantum Computing
//
// 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... |
50ff01cca07ef22211d4fdd53924280a761688a2 | 1fd15d18c2922d3bbde93cc50d7cb3e8252a5b61 | msdgwzhy6/LogDevice | /logdevice/common/protocol/HELLO_Message.cpp | C++ | cpp | 23,322 | permissive | /**
* Copyright (c) 2017-present, Facebook, Inc. and its affiliates.
* 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.
*/
#include "HELLO_Message.h"
#include <memory>
#include <openssl/ssl.h>
#include <foll... |
c5b3f702399cd1b3cf107676f5df8e30f589d60a | f670d7072ba88d8b81a2f6e5272862b94bd7aa1d | caogenwang/tencentcloud-sdk-cpp | /gme/src/v20180711/model/RoomUser.cpp | C++ | cpp | 3,159 | permissive | /*
* Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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
... |
68ac25cc61fb9e58585a9c98eee21ce3dd851323 | 7ba350154a7b886a02f4984b51eea18e66d7f98d | BlackFury/Server-1 | /T4C Server/TinyXML/tinyxmlparser.cpp | C++ | cpp | 35,192 | no_license | #include <ctype.h>
#include <stddef.h>
#include "tinyxml.h"
//#define DEBUG_PARSER
#if defined( DEBUG_PARSER )
# if defined( DEBUG ) && defined( _MSC_VER )
# include <windows.h>
# define TIXML_LOG OutputDebugString
# else
# define TIXML_LOG printf
# endif
#endif
// Note tha "PutString" hardcodes the same list. Th... |
e8fcf2aa027ec1a46d8792e34ebbfcff8f78c831 | c279bc3ca8f696eb2e5140978ee148076bf6d985 | bmeck/v8 | /src/wasm/wasm-opcodes.cc | C++ | cc | 15,280 | permissive | // Copyright 2015 the V8 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.
#include "src/wasm/wasm-opcodes.h"
#include "src/messages.h"
#include "src/runtime/runtime.h"
#include "src/signature.h"
namespace v8 {
namespace inter... |
8b96d9228427de2d89fc9cb0f3b6c23d15e42ef3 | f8ed06c57bcbfa3a8e929ce0c630ae4850c34ce4 | renereimann/homework | /quiz_week_3/src/particle.hpp | C++ | hpp | 1,676 | no_license | // Summer of C++
// Quiz Week 3
// Solution by: Rene Reimann
/*
* Write a class that serves as a unique identifier for other objects.
* I should be able to use this identifier as a class member to use for comparisons.
*
* The class should compare equal to copies of itself, but not to objects
* created at the ... |
438defc44424e1ae333ea72143dad6a09420bf97 | a7bdd4b9e6a5e9591fea1c1dae2e56650d2ab8e4 | SyncSoftInc/OlliixApps | /src/windows/flutter/generated_plugin_registrant.cc | C++ | cc | 535 | no_license | //
// Generated file. Do not edit.
//
// clang-format off
#include "generated_plugin_registrant.h"
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <geolocator_windows/geolocator_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
FlutterSecureStorageWin... |
8628342ad4575607bcddb14a686363d6ee46ca35 | 99c3e3745c748bc062caf97b724542e6656a6a66 | pelermu/zaap | /src/test/multisig_tests.cpp | C++ | cpp | 11,943 | permissive | // Copyright (c) 2011-2013 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "key.h"
#include "keystore.h"
#include "policy/policy.h"
#include "script/script.h"
#include "script/script_error.h"... |
019c6064a35252cdbec40e53b4dbf5d5e23b9c7b | 98fb548f6994a956e757f01b5c24740314862c04 | GWooK/CS104-Assignments | /hw5/search.cpp | C++ | cpp | 348 | no_license | #include <iostream>
#include "search_window.h"
#include <QApplication>
using namespace std;
int main(int argc, char* argv[])
{
if(argc < 2){
cerr << "usage: ./search index_file...Please provide an index file" << endl;
return 1;
}
//QT stuff
QApplication app(argc, argv);
SearchWindow win;
win.sho... |
901ffe0f9a7d3921856b3d1ff020b51248a5965f | 038c62131644d02d53d34d23a6c51e5a72614404 | acsbendi/Lord-of-the-Seas | /client/ui/views/MovableView.hpp | C++ | hpp | 1,050 | no_license | //
// Created by Bendi on 9/4/2018.
//
#ifndef LORD_OF_THE_SEAS_MOVABLEVIEW_HPP
#define LORD_OF_THE_SEAS_MOVABLEVIEW_HPP
#include <SFML/Graphics/Drawable.hpp>
#include <memory>
#include <SFML/Graphics/Color.hpp>
#include "../../../common/gamecore/IMovableObserver.hpp"
#include "../../../common/gamecore/Position.hpp"
... |
945cb9b369872ff7d7add01bc7a76b32f4fd7677 | 343c3068afa1f44aca49aa30efde7d8a578ee609 | Huqingnan123/MyLeetcode | /0514.自由之路/0514-自由之路.cpp | C++ | cpp | 754 | no_license | class Solution {
public:
int findRotateSteps(string ring, string key) {
int n = ring.size(), m = key.size();
vector<int> pos[26];
for (int i = 0; i < n; ++i) {
pos[ring[i] - 'a'].push_back(i);
}
vector<vector<int>> dp(m, vector<int>(n, 0x3f3f3f3f));
for (a... |
388682e21c21a92e807128d3bb162058730b6b79 | d241d289b64a32da91bfe53b4d96bdeebfff7250 | alijuma/chromium | /chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.cc | C++ | cc | 2,450 | permissive | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/printing/cloud_print/privet_http_asynchronous_factory_impl.h"
#include <memory>
#include "chrome/browser/local_discovery/endpoi... |
2fd022d0031491e9d8db2a019efba1228371f6d4 | 3cac001173c7c5562393bdc1b5f5423907373b6a | starrrrria/animation | /Lab2/matrix.cpp | C++ | cpp | 12,142 | no_license | //
// matrix.cpp
// Lab2
//
// Created by 补锌 on 2021/3/1.
//
#include "matrix.hpp"
CMatrix4x4::CMatrix4x4()
{
///初始化各元素
Clear();
}
CMatrix4x4::CMatrix4x4(const CMatrix4x4 &m)
{
matrix[0] = m.matrix[0];
matrix[4] = m.matrix[4];
matrix[8] = m.matrix[8];
matrix[12] = m.matrix[12];
... |
988dde1eec610c8dc5de4b87d57c8f4f9b4de904 | f0b73a234170b80dcf304093292e70df64856454 | prasannajitsahoo/lab6 | /lab6_q1.cpp | C++ | cpp | 1,543 | no_license | //Tax Rate Calculation using Functions
#include<iostream>
using namespace std;
// ask user to enter the values
// call the functions
// number as arguement
// tell the tax value to user
//Write a function that obtains from the user and returns a value for unitCst, units, and taxRt to the calling module.
int ask (in... |
02534429854f6b862bd7ebea8796b4eb77d7fc83 | b2c3237e01d3e71109b88a002621e73ed87507eb | razvan-ilie/OneFactorMC | /OneFactorMC/UpAndOutKnockoutPricer.cpp | C++ | cpp | 556 | no_license | #include "UpAndOutKnockoutPricer.hpp"
UpAndOutKnockoutPricer::UpAndOutKnockoutPricer(Payoff pOff, std::function<double(double)> disc, double level) : Pricer(pOff, disc), barrier(level)
{
}
void UpAndOutKnockoutPricer::processPath(std::vector<double>& path)
{
numSims++;
double level = barrier;
// if there... |
2b729b4b4b83f25c05ebd5e97ede6a0d6fc6ff7c | 2e4a24d29b9216e47c3bc3e6646cab4de09f290e | wayover/mors | /mors/morse.cpp | C++ | cpp | 8,578 | no_license | #include "morse.h"
morse::morse() //konstruktor bezprametrowy przypisujący 1 dla każdej zmiennej
{
czestotliwosc = 1;
pauza = 1;
czaskropka = 1;
czaskreska = 1;
znakprzerwa = 1;
}
morse::morse(int m_czestotliwosc, int m_pauza, int m_czaskropka, int m_czaskreska, int m_znakprzerwa) //konst... |
768d87558898f5cdd27ab88ccb204edd2756df1b | 5a123efad185122be561416d53ed0cc1c142a112 | Tubbz-alt/uploads | /upload_app/src/expression.cpp | C++ | cpp | 12,550 | no_license | ////////////////////////////////////////////////////////////////////////////////
// expression.cpp - load serialized kinect frame data
// Copyright (C) 2011, 2012 Rob Myers <rob@robmyers.org>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General... |
d4c0edf3d2a27dadf9357d68fcd9498eaad9a5d3 | 07b14705eb70b19ce4d49052bafb17dc8c7d1202 | Kangulu/plt | /test/shared/test_state_card.cpp | C++ | cpp | 2,246 | no_license | #include <boost/test/unit_test.hpp>
#include <memory>
#include <iostream>
#include "../../src/shared/state.h"
using namespace state;
using namespace std;
BOOST_AUTO_TEST_SUITE(state_Card)
BOOST_AUTO_TEST_CASE(Card_constructor){
shared_ptr<Ressources> ressources = make_shared<Ressources>(1,2,3,4,5,6,7,8);
sh... |
281c04030381b2461795e5761ad93419127c237c | 56a6300d63994c8716eb5a963e7718499e18303f | iridium-browser/iridium-browser | /third_party/dawn/src/dawn/tests/unittests/validation/QueueSubmitValidationTests.cpp | C++ | cpp | 13,944 | permissive | // Copyright 2018 The Dawn Authors
//
// 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 agreed t... |
d971e5c437ef1a704ac5826a773341f17db42f12 | 46a3f49c8782a9b9f8493e4fa97ee20b955732e8 | darcyg/cpp-redis | /src/pubsub.hpp | C++ | hpp | 2,364 | no_license | #ifndef PUBSUB_HPP
#define PUBSUB_HPP
#include "async_connection.hpp"
#include "types.hpp"
namespace redis {
class Listener {
public:
virtual void on_message(const string& channel, const string& message) = 0;
virtual void on_pmessage(const string& pattern, const string& channel, const string& message) = 0;
}... |
768aacca10ce5f05c525affef6ec67c8848abb0b | 8ada17c38eaf70ea297d1a09018ade9ff9e8a80f | JumHorn/leetcode | /Cplus/BagofTokens.cpp | C++ | cpp | 461 | permissive | #include <algorithm>
#include <vector>
using namespace std;
class Solution
{
public:
int bagOfTokensScore(vector<int> &tokens, int P)
{
sort(tokens.begin(), tokens.end());
int res = 0, i = 0, j = tokens.size() - 1, score = 0;
while (i <= j)
{
if (P - tokens[i] >= 0)
{
P -= tokens[i++];
++score;... |
06d3cafa8f6077aab228bea9bb6f64daf5c7082f | bbd58f6cd8263a403c27dacaebd9d0d090b6c76a | GiantPay/GiantCore | /src/test/zerocoin_coinspend_tests.cpp | C++ | cpp | 2,973 | permissive | // Copyright (c) 2017-2018 The PIVX developers
// Copyright (c) 2018-2019 The GIANT developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "libzerocoin/Denominations.h"
#include "libzerocoin/CoinSpend.h"
#include "l... |
9dabcf34e43d2fe4c5cd388ad0ca54aba846c559 | fb30b34956c2d1e5a62842ba4552c018b82e98db | stnava/pybind11 | /tests/test_numpy_array.cpp | C++ | cpp | 20,710 | permissive | /*
tests/test_numpy_array.cpp -- test core array functionality
Copyright (c) 2016 Ivan Smirnov <i.s.smirnov@gmail.com>
All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE file.
*/
#include <pybind11/numpy.h>
#include <pybind11/stl.h>
#incl... |
7afd481e5fb555c9e6798ca978f68cdf1775be2f | 4fb83a6d13bca871d6094e4f9316e94ccb63b9be | yoshiheight/Sample.D3DField | /src/Scene/Light.cpp | C++ | cpp | 4,236 | permissive | /**
* @file
* ライト管理の定義
*/
#include "StdAfx.h"
#include "Light.h"
// スピード定数
const float Light::MOVE_SPEED = 10.0f;
const float Light::LIGHT_COLOR_SPEED = 0.1f;
/**
* コンストラクタ
*/
Light::Light()
: m_colorR(1.0f), // ライト色R
m_colorG(1.0f), // ライト色G
m_colorB(1.0f), ... |
870faabca34cdade87b18390d61e012cc4d90439 | b5d42ffc8c94d966898a7ccf177a59fefa7b8190 | CAFxX/llvm | /lib/Target/X86/AsmParser/X86AsmParser.cpp | C++ | cpp | 33,867 | permissive | //===-- X86AsmParser.cpp - Parse X86 assembly to MCInst instructions ------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
1a8c1c2c7d2babb9757b23b34c6fa0deaac439de | f98ed51387945b0df117e57e3ae7cdb0d35cf034 | wuqingjun/steamtrain | /pie.cc | C++ | cc | 738 | no_license | #include "color.h"
#include "CSCIx229.h"
#include "pie.h"
#define GL_GLEXT_PROTOTYPES
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
extern float shinyvec[1];
extern float white[4];
extern float black[4];
//
// draw circular surface.
//
void pie(double r, Color color)
{
double d = 1.0;
... |
845e236d0e08d7c80652eea104b9bc09b5a511b9 | 3275f55ff01435098e5df4b8b5e601905e425cd0 | MRSD2018/reefbot-1 | /frame_grabber/src/grab_frame.cc | C++ | cc | 6,150 | permissive | /* frame_grabber
* Grabs frames from the video stream and writes to the disk using
* libVLC and SDL and modelled using the ROS framework.
* Author: Srinivasan Vijayarangan (srinivasan@cmu.edu)
* Date: 21 Feb 2011
*/
#include <iostream>
#include <sstream>
#include <string>
#include <vlc/vlc.h>
#include <SDL/SD... |
0a62b0fba54857eca911d6ba8dac12f27862027b | ad4f9c2607ce35e342c55496f960591bbe2262a7 | peter-frentrup/pMath | /richmath/src/boxes/sectionornament.cpp | C++ | cpp | 1,183 | no_license | #include <boxes/sectionornament.h>
#include <boxes/box-factory.h>
#include <boxes/errorbox.h>
using namespace richmath;
extern pmath_symbol_t richmath_System_BoxData;
extern pmath_symbol_t richmath_System_List;
extern pmath_symbol_t richmath_System_None;
//{ class SectionOrnament ...
SectionOrnament::SectionOrnam... |
106445bd51c3a98237d9cbe095cf5c931d95c6b2 | 3d63f2e3511aaae675cb06176b6b68ab5b465eaa | ecmwf/metkit | /src/tools/bufr-sanity-check.cc | C++ | cc | 15,336 | permissive | /*
* (C) Copyright 1996- ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an interg... |
e0a65b2b0c59514a86eca76c2f2a66ba5e51327b | 9ed308fa51839a05b8856989fe46c3464fd9afc4 | skotopes/ssh-bot | /src/r_robot.cpp | C++ | cpp | 7,350 | no_license | /*
* r_processor.cpp
* robot
*
* Created by Alexandr Kutuzov on 21.04.09.
* Copyright 2009 White Label ltd. All rights reserved.
*
*/
#include "r_robot.h"
char * private_key = NULL;
/*!
@method robot
@abstract constructor
@discussion class constructor
*/
Robot::Robot() {
verbose = false;
}
... |
44f074b073500b72b11d1d3508be245e7030ab81 | ed708734e685bd41b02e682fd2c8b96b731d1ed1 | thientu/Transformer-DyNet | /dynet/dynet/exec.cc | C++ | cc | 42,451 | permissive | #include "dynet/exec.h"
#include <unordered_map>
#include <queue>
#include "dynet/param-nodes.h"
#include "dynet/globals.h"
#include "dynet/timing.h"
#ifdef HAVE_CUDA
#include "dynet/gpu-ops.h"
#endif
using namespace std;
namespace dynet {
ExecutionEngine::ExecutionEngine(const ComputationGraph& cg)
: device_... |
1a103ab17c7e11a5f72cd9055e931e5c0eb0815d | 36bdfd319aaeb68e5ed0fae4ffdb8a8b6fa1f62f | Aldwulf/03_BuildingEscape_V2 | /BuildingEscape_V2/Source/BuildingEscape_V2/OpenDoor.cpp | C++ | cpp | 1,247 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "OpenDoor.h"
#include "GameFramework/Actor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can t... |
4da6afb1d3067a3d20490e701e696bdafe754b2d | 5807afaca7239a51428a802cd3cf4ffbb2ddbe24 | apmckinlay/jsdi | /src/abi_x86/stdcall_thunk.cpp | C++ | cpp | 16,135 | no_license | /* Copyright 2013 (c) Suneido Software Corp. All rights reserved.
* Licensed under GPLv2.
*/
//==============================================================================
// file: stdcall_thunk.cpp
// auth: Victor Schappert
// date: 20130802
// desc: Implement a __stdcall stub wrapping a Suneido callback
... |
af3bb6720fb753f5b8f7140c0e98dd9abd6d2846 | fccafc524a5a423100eac0e2dfe975e49a493bd8 | mikroncoin/mikron_node | /rai/lib/numbers.cpp | C++ | cpp | 24,055 | permissive | #include <rai/lib/numbers.hpp>
#include <rai/lib/blocks.hpp>
#include <rai/node/common.hpp>
#include <ed25519-donna/ed25519.h>
#include <blake2/blake2.h>
#include <cryptopp/aes.h>
#include <cryptopp/modes.h>
#include <boost/endian/conversion.hpp>
thread_local CryptoPP::AutoSeededRandomPool rai::random_pool;
name... |
b71378ed54c53fdbe673f3208483ae596eb18b69 | 6848411b89512f86ab3cbe52a207d7763c034a32 | Forty-Tw0/myFault | /myFault/idtHook.cpp | C++ | cpp | 4,060 | no_license | extern "C"
{
#include "ntddk.h"
}
#include "mmHook.h"
#include "idtHook.h"
/*********************************************************************************
* HookInt - Hooks an x86 interrupt in the interrupt descriptor table.
*
* Parameters -
* unsigned long pOldHandler - pointer to a variable to st... |
112dd6d8bbf8350f5023710c6f1b1963189e8752 | 0e2c680625f1adfb605989ad72cd9c531c89cff8 | cortexm/io | /reg/stm32/f0/i2c.hpp | C++ | hpp | 464 | permissive | /**
* Peripheral Definition File
*
* I2C - Inter-integrated circuit interface
*
* MCUs containing this peripheral:
* - STM32F0xx
*/
#pragma once
#include <cstdint>
#include <cstddef>
#include "io/reg/stm32/_common/i2c_v2.hpp"
namespace io {
namespace base {
static const size_t I2C1 = 0x40005400;
static const siz... |
0abfbe3b27e5b701cef820264b9951b0095435ba | ef1f174c8149711dcf596700e18b163ab1fcbfa3 | Asteip/KaboSolve | /src/solver/problems/pMoreMoney.hpp | C++ | hpp | 363 | no_license | #ifndef P_MORE_MONEY_HPP
#define P_MORE_MONEY_HPP
#include "../problem.hpp"
#include "../constraint.hpp"
#include "../constraints/cEqual.hpp"
#include "../constraints/cAllDiff.hpp"
class PMoreMoney : public Problem {
public:
PMoreMoney();
~PMoreMoney();
//void applyConstraint(int id);
void afficher();
pr... |
f988ceffd11ea1a51320376cfdf7b956548bb048 | 2c9d94bad9554471c5ce121aeab98985fd90512d | gd226/cs4321 | /Sort.cpp | C++ | cpp | 6,532 | no_license |
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "heapfile.h"
#include "scan.h"
#include "Sort.h"
int recLenGlobal;
short *fieldSizesGlobal;
int sortKeyIndexGlobal;
TupleOrder sortOrderGlobal;
AttrType *fieldTypesGlobal;
//-----------------------------------------------------... |
96b2d8a9d670388224f0e3708cd6e61143ee9056 | b329e7bfe73753701da38dfcfa55ed45860cb6cd | BackupTheBerlios/kicad-svn | /branches/bokeoa-scons/pcbnew/modedit.cpp | C++ | cpp | 18,099 | no_license | /****************/
/* modedit.cpp */
/****************/
#ifdef __GNUG__
#pragma implementation
#endif
#include "fctsys.h"
#include "common.h"
#include "pcbnew.h"
#include "trigo.h"
#include "3d_viewer.h"
#include "bitmaps.h"
#include "protos.h"
#include "id.h"
/****************************... |
10370cb8b9e1c7fd17ea5d0a5949ad9d13728544 | b491a1ba86090c39782835111194417581c6e587 | johnhaddon/appleseed | /src/appleseed/foundation/mesh/binarymeshfilereader.cpp | C++ | cpp | 7,577 | permissive |
//
// This source file is part of appleseed.
// Visit http://appleseedhq.net/ for additional information and resources.
//
// This software is released under the MIT license.
//
// Copyright (c) 2010-2013 Francois Beaune, Jupiter Jazz Limited
// Copyright (c) 2014-2016 Francois Beaune, The appleseedhq Organization
//
... |
f012befc53de9fae7451721dc08729191ac2a15c | 39bded632212510ea9764022c1d57d3db00f7323 | wrren/riot.cpp | /tests/int_key.cpp | C++ | cpp | 900 | no_license | #define CATCH_CONFIG_RUNNER
#include "int_key.h"
#include <fstream>
#include <string>
#include <iostream>
riot::api_key_t int_key::m_key = "";
void int_key::set_key( const riot::api_key_t& key )
{
m_key = key;
}
const riot::api_key_t& int_key::get_key()
{
return m_key;
}
int main( int argc, char** argv )
{
std... |
d0b860fa27ccb2eda82d83a4e01cf19579346dc9 | beade44669cb7d6c9bb85e3a7743c6c5186639d2 | governmentbg/EPEP_2019_d2 | /CAC_Source_1.7884/array.cpp | C++ | cpp | 2,887 | no_license | #include "common.h"
// ----- TIntegerArray -------------------------------------------------------
static bool lesseqli(const intptr_t value1, const intptr_t value2)
{
return value1 <= value2;
}
TIntegerArray::TIntegerArray(bool sorted)
: lesseql(sorted ? lesseqli : NULL)
{
mbk_init(this);
}
#if RANGECHECK
intptr... |
ed5f5e3fa9049b39982fe717ca9c1fe49a93b5a4 | 3da70d313ccb4b0da67ab67f34bbe461f511d608 | proaholic/Win2K3 | /NT/sdktools/depends/src/exe/msdnhelp.cpp | C++ | cpp | 28,149 | no_license | //******************************************************************************
//
// File: MSDNHELP.CPP
//
// Description: Implementation file for all the classes related to enumerating
// help collections and performing help lookups in the various
// help viewers.
//
// ... |
e1d9f0f1aff4cc22eaf9e66476114b3b4eec4828 | 09bae5c103d3ae3d31d7af90d1f1bb3a2f0c76f9 | jongja/jongja | /Algorithm/SWEA/SWEA_H1913.cpp | C++ | cpp | 2,372 | permissive | /* Completed!!
*
*
*/
#define MAX_N 1000
#define MAX_M 20
struct Result {
int y, x;
};
typedef struct PAIR
{
int x, y;
}pair_t;
typedef struct StarMap {
int cnt, cx, cy, size;
pair_t rotate[20][4]; // 0 : original
// 1 : 90
// 2 : 180
// 3 : 270
}star;
int Map[MAX_N][MAX_N];
int ... |
c56bd42b1e346169c17330163085c1625b8e1d92 | 7780e65f47f751fd76a4f76a924472371427a76d | sudeepdino008/competitive-programming-solutions | /spoj/reserruction/gss1.cpp | C++ | cpp | 4,169 | no_license | //#include GRAPH
#define DEBUG //comment when you have to disable all debug macros.
#define LOCAL //uncomment for testing from local file
#define NDEBUG //comment when all assert statements have to be disabled.
#include <iostream>
#include <cstring>
#include <sstream>
#include <fstream>
#include <cstdlib>
... |
7e790cdcd9e9f5cb5d46140270ac404a2dff2fe1 | c4383a86f2b167f09041829c48665d859217125e | noqisofon/Jack_O_lantern | /include/lantern/video/ITexture.hxx | C++ | hxx | 1,589 | no_license | #pragma once
#include "lantern/geom/dimension2d.hxx"
#include "lantern/video/color.hxx"
#include "lantern/video/DriverType.hxx"
namespace lantern {
namespace video {
/*!
*
*/
enum class TextureLockMode {
READ_WRITE,
READ_ONLY,
WRI... |
05e06be7d4b17ce82f8addca35363db9509ef5d2 | 9288153bcc8e85f87518a2c8fd1fc45c3d3e7df2 | pinakin2050/CPP-OOP | /5-Friend Class and Friend Functions/FriendFnsLCO.cpp | C++ | cpp | 1,114 | no_license | #include<iostream>
#include<string>
using namespace std;
class Superhero {
string _name;
int _age;
Superhero();
protected:
Superhero(string& name, int age) : _name(name), _age(age){}
void run() { cout << "I can run." << endl; }
public:
void sayName();
friend class Superman;
friend class Spiderman;
};
void... |
4e97098cb8f66a5896dc1fd804e7fe087a8c70b5 | 397f86aced77c7e0a0ddcdd8235a6ead48fb52d4 | YuninMiscApp/opencv_ldw | /test/test_distancetransform.cpp | C++ | cpp | 9,363 | no_license | /*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... |
9f136572ddc54bc3187ee3b38982fcc4ab900a88 | 23aff8de68e4028f441bc651ea617209a6386c7a | LevyForchh/llvm-project | /llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp | C++ | cpp | 19,707 | permissive | //===--- unittests/DebugInfo/DWARF/DwarfGenerator.cpp -----------*- C++ -*-===//
//
// Part of the LLVM 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
//
//===---------------------------... |
8e17e257ac036b7560e84110faccc4f52dd9294b | dd0cb42f18a569db4ddcc7d8bd64d0bcdf5879d4 | fsinoradzki/OperatingSystems | /t.cpp | C++ | cpp | 3,271 | no_license | #include <iostream>
#include <math.h>
#include <unistd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string>
#include <fstream>
#include <vector>
#include <iomanip>
using namespace std;
#include "file.h"
#include "diskprocess.h"
//API function definitions
bool Create(st... |
b542c03615f42a1c3280d72a6f98b85622d0358d | 8e4b56ef6fb9cc2b4458680ddeb1fd7d19cc31c5 | Arimionim/os-kidshell | /main.cpp | C++ | cpp | 4,020 | no_license | #include <iostream>
#include <map>
#include <vector>
#include <unistd.h>
#include <sstream>
#include <sys/wait.h>
#include <cstdlib>
#include <cstring>
std::map<std::string, std::string> envPars;
bool running = true;
void printHelpMessage(){
std::cout << ":help for this message\n"
":exit for exi... |
d305caf0d62584585da265836f5624dc758aa4f1 | 76236dbe17bf3c4dd5024c08e4a06c7f4840ea7e | ysadat7/chemical-kinetics-solver | /source/run_integrator/solver_calculations/Synchronize_Gas_Liquid_Model.cpp | C++ | cpp | 2,387 | permissive | /*
* Synchronize_Gas_Liquid_Model.cpp
*
* Created on: 26 Oct 2017
* Author: detlevcm
*/
// I should ensure I have a synch list from the pre-processing
#include "../headers/Headers.hpp"
void Synchronize_Gas_Liquid_Model(
size_t number_synchronized_species,
size_t liquid_species_count, size_t gas_speci... |
579c97019a5c1a026addb4ac757eb70b33a3dd1a | f7c23529e49963d4705e5aff88e0d9e508de0ea1 | agrippa/chimes | /src/tests/frontend/Linux-g++-4.8_(Ubuntu_4.8.4-1ubuntu15)_4.8.4/cpp/cond_ptr_return/cond_ptr_return.cpp.pre.transformed.cpp | C++ | cpp | 44,243 | no_license | # 1 "cond_ptr_return.cpp.pre.transformed.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h" 1 3 4
# 147 "/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h" 3 4
typedef long int ptrdiff_t;
# 212 "/usr/lib/gcc/... |
a99ed653a70ef6a6b92d437901cf81d79e6c5412 | cc42862497f0dca3460505d4e66e95e7939c5e79 | aws/aws-sdk-cpp | /generated/src/aws-cpp-sdk-codecatalyst/source/model/UpdateDevEnvironmentRequest.cpp | C++ | cpp | 1,668 | permissive | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/codecatalyst/model/UpdateDevEnvironmentRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::CodeCatalyst::Model;
using namespace Aws::Util... |
a3d241d92281a2a6fe5f0a2acbe1a5ce129797f0 | fbc689e864b7c7773ab6f2e5dd86b4c109cff3f2 | kyokushin/Tracker2 | /src/DelayTracker.cpp | C++ | cpp | 8,388 | no_license | #include <DelayTracker.h>
#include "median.h"
//#define DEBUG
#ifdef DEBUG
#include <iostream>
#endif
ys::DelayTracker::DelayTracker()
:_klt_context(NULL)
,_klt_cur_feature_list(NULL)
,_klt_first_feature_list(NULL)
,_in_object_flags(NULL),_state(NOT_ALLOCATE)
,_feature_num(100),_before_image(NULL)
{ }
ys::Del... |
f484bee6b94e3f5679442e52e2f519352f055e1e | 8ed49ce5d216569ea7228c1eae4e30e55921c3b5 | maoxiezhao/Cjing3D | /Cjing3D/system/systems/sceneAnimationSystem.cpp | C++ | cpp | 6,653 | permissive | #include "system\sceneSystem.h"
#include "renderer\renderer.h"
#include <functional>
#include <array>
namespace Cjing3D {
namespace
{
void StepAnimationChannelHandler(
TransformComponent& transform, AnimationComponent::AnimationSampler& sampler,
AnimationComponent::AnimationChannel::TargetPath path, U32 le... |
d67c9a90a1230ea5e54d41347201531262b008bb | f238b261bbfe7795e41194a005c110e12dfe91d8 | narayanr7/HeavenlySword | /code/game/simpletransition.cpp | C++ | cpp | 7,865 | no_license | //------------------------------------------------------------------------------------------
//!
//! \file simpletransition.cpp
//!
//------------------------------------------------------------------------------------------
// Necessary includes
#include "simpletransition.h"
#include "game/entity.h"
#include "game/en... |
00db7595efc78e5f1d964100e4dfdcf0b58fc35b | 42fdf49fe5b0ced94e6b60842e310c5e374ebcf9 | Piotrek321/Hackerrank | /Algorithms/Implementation/ChocolateFeast.cpp | C++ | cpp | 603 | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int t;
cin >> t;
for(int a0 = 0; a0 < t; a0++){
int n;
int c;
int m;
cin >> n >> c >> m;
int chocolate,wrappers, temp;
chocolate=n/c... |
410e4a4b2d2064155c7cf724de6c260763aade44 | cd77c07e3a630cffe6b2778c9cc467c0ced83f76 | kmjp/procon | /atcoder/abc201-250/abc211/b.cpp | C++ | cpp | 1,021 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))... |
b6746702193556574372620dd9d01b1f41536f71 | 315d3e503c93ad24f8d4870df5beedc252f5b23c | jmox0351/sst-core | /src/sst/core/eli/elementinfo.cc | C++ | cc | 3,642 | permissive | // Copyright 2009-2021 NTESS. Under the terms
// of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// Copyright (c) 2009-2021, NTESS
// All rights reserved.
//
// This file is part of the SST software package. For license
// information, see the LICENSE file in the ... |
87b654426c2b1a8f5fa1ffc1c604ae05ebd50ef8 | fae651e49a5ba3c12746946e5cb265e5efec2d09 | llxz999/c | /base.cpp | C++ | cpp | 4,959 | no_license | #include <iostream>
#include <cstdlib>
#include <windows.h>
using namespace std;
class base
{
public:int a;
static int count;
base(int a=0,int b=0, int c=0)
{
cout << "base() is called" << endl;
this->a = a;
this->b = b;
this->c = c;
count++;
}
~base()
{... |
4ab608ddc49dacccaa940bc301130d18c65e047b | 5c9a66183006dcf07f7316eaea72c8c04969c3fd | RokoMetek/MyGame | /Classes/Enemies.cpp | C++ | cpp | 8,924 | no_license | #include "Enemies.h"
Enemies::Enemies()
{
_moveType = 0;
//_offset = 0;
_shootType = 0;
}
Enemies::Enemies(Layer * layer)
{
Size visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
Size winSize = Director::getInstance()->getWinSize();
//Test Mo... |
488df8731c18dbc93a7da061bf72a1775912466d | e154b722d7cc2b065c8ac94901e6646e53b475e6 | wwwwodddd/Zukunft | /bzoj/2761.cpp | C++ | cpp | 256 | no_license | #include<stdio.h>
#include<set>
using namespace std;
set<int>s;
int x,n,t;
int main()
{
for(scanf("%d",&t);t--;puts(""))
for(s.clear(),scanf("%d",&n);n--;)
{
scanf("%d",&x);
if(!s.count(x))
printf("%d ",x),s.insert(x);
}
}
|
7275c14f389761101950e88a82ddc9fd8839cb71 | 8b43f0c99ea4c520a4e643efe36ab1ad3924799a | cryptobuks/Sequence | /src/script/sign.cpp | C++ | cpp | 8,997 | permissive | // Copyright (c) 2009-2017 Satoshi Nakamoto
// Copyright (c) 2009-2017 The Bitcoin Developers
// Copyright (c) 2016-2017 Duality Blockchain Solutions Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "script/si... |
8ffb6b9a102cf62eecd4d7b0f44feff44ea7330b | 4dedec9040abb3da991c7ebf58df0c2a313e6f45 | atribolt/QT_DVPL_Tool | /UnpackDvpl/ActionEncode.cpp | C++ | cpp | 1,167 | no_license | #include <QFile>
#include <QMutex>
#include <QFileInfo>
#include <QProgressBar>
#include <QLoggingCategory>
#include "DvplData.h"
#include "ActionEncode.h"
const QLoggingCategory encode("ActionEncode");
void ActionEncode::run()
{
const bool& isStop = (stopFlag != nullptr) ? *stopFlag : false;
... |
d9d6bcce487ad68956137dc2ecf57edd0de027fb | 186451e53c3f0db77505d36ca5da1fd613ffe8b0 | Shothogun/competitive-programming-exercises | /L6.Lista Grafo Busca/D_portais.cpp | C++ | cpp | 682 | no_license | #include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define ll long long
#define pb push_back
#define mp make_pair
#define ii pair<int, int>
#define matrix vector<vector<ll>>
#define DEBUG 0
int main()
{
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll inicial = 1;
ll t, n, element;
... |
0ca572ef3245c9744e3b8107ccee63eb9a5560ad | 8ce89e2fd7e200e60d32d022a9168f1304d06abb | compagnb/compagnb_sims2014 | /Wk5_Midterm_3DSprings/src/ofApp.cpp | C++ | cpp | 4,164 | no_license | #include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
light.setDiffuseColor(ofFloatColor(1.0,1.0,1.0));
light.setPosition(ofPoint(0.0,0.0,0.0));
/*
4 ---- 5
/| /|
0 ---- 1 |
| | | |
| 7 ---|-6
|/ |/
... |
4cdaff53f685c74c4222887a6d05ddae9f32f458 | 94fa0c922ea59e8c1ca852de0586111556722a0b | baibolatovads/work | /Algorithms and Data Structures/DFS BFS/adjDFS.cpp | C++ | cpp | 682 | no_license | #include <bits/stdc++.h>
using namespace std;
void dfs(int v, vector< vector<int> > adj, vector<bool> was, int cnt){
if(!was[v]){
was[v] = true;
cnt++;
for(int i = 0; i < adj[v].size(); i++){
dfs(adj[v][i], adj, was, cnt);
}
}
}
int getCnt(int start, vector< vector<int> > adj){
vector<bool> was(adj.size... |
a6158618b299b6f13c13dcdc1b45f8bb7ec2f3ab | 909d2748e5a37117feb288dd8b6ba74b1502f9b7 | leotfrancisco/patch-hosting-for-android-x86-support | /android-x86/external/opencore/fileformats/mp4/composer/src/mpeg4mediaheaderatom.cpp | C++ | cpp | 2,141 | no_license | /* ------------------------------------------------------------------
* Copyright (C) 2008 PacketVideo
*
* 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/li... |
496494a76079a3f48d6a6599cc7910426be70b06 | 4b080105277066bad4a7ea8944c347312cb53e46 | BANGLADESH228/CPP-2020-2021-HW8 | /counted.cpp | C++ | cpp | 973 | no_license | #include "counted.h"
int Counted::count = 0;
std::vector<int> Counted::freeId = std::vector<int>();
int Counted::getId()
{
return id;
}
int getMinId(std::vector<int> newVector)
{
int min_count = newVector.front();
int min_index = 0;
for (unsigned int i = 0; i < newVector.size(); i++)
{
... |
c653d9d1484633e5669eb80254b806259425ccf1 | c08a0c755542e878e4dfde24108ed3105e5ba02d | Guangehhhh/ouzel | /engine/input/Gamepad.hpp | C++ | hpp | 3,331 | permissive | // Ouzel by Elviss Strazdins
#ifndef OUZEL_INPUT_GAMEPAD_HPP
#define OUZEL_INPUT_GAMEPAD_HPP
#include <cstdint>
#include <string>
#include "Controller.hpp"
namespace ouzel::input
{
class InputManager;
class Gamepad final: public Controller
{
friend InputManager;
public:
enum class Ax... |
bbba5e3b881d8dd56617526ead57cdeab29288ec | 01d37965f0bd1a5f4525146bacd636868e78a998 | SunNailin/AutumnRecruitmentOnlineTest | /Huawei_ISBN/Huawei_ISBN.cpp | C++ | cpp | 1,014 | no_license | // Huawei_ISBN.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <set>
#include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;
string ISBN(string inStr) {
// 检查是否合法
if (inStr.length() != 11) {
return "ERROR";
}
for (int i = 0; i < inStr.length(); i+... |
1e9aed7fccef112077cf66646e100022764b49c1 | f54374f57fde2d381a77e5c7349cf5503deca89c | janie177/Reflections | /Reflections/LivingEntity.cpp | C++ | cpp | 1,947 | no_license | #include "LivingEntity.h"
#include "Tile.h"
#include "GameManager.h"
reflections::LivingEntity::LivingEntity(int x, int y, World & world, EntityType type, double speed, int width, int height, int textureID, int health, int damage)
: TexturedEntity(x, y, world, type, speed, width, height, textureID) {
this->health ... |
34c06e14cd9ba8cbc1b9ca97d5b9f17cc3e924d0 | 2cd63159f5754e873b4eb948203bb77c3afe94a6 | kss682/algorithms | /cses/intro/weird_algo.cpp | C++ | cpp | 249 | no_license | //https://cses.fi/problemset/task/1068
#include<bits/stdc++.h>
using namespace std;
int main(){
long long n;
cin>>n;
cout<<n<<" ";
while(n != 1){
if(n%2 == 0) n = n/2;
else n = 3*n + 1;
cout<<" "<<n;
}
} |
3bac045a52ef97c21163ac798dfe14eae527ef3c | 364eb15ef789b11f937d673893a968495eecd50c | bomkvilt/Yager | /engine/core/Public/core/world_ticks.hpp | C++ | hpp | 4,759 | no_license | #ifndef CORE_WORLD_TICKS_HPP
#define CORE_WORLD_TICKS_HPP
#include <functional>
#include <shared_mutex>
#include <boost/noncopyable.hpp>
#include "common/hit_timer.hpp"
#include "core/types.hpp"
#include "threading/thread_task.hpp"
/**/ class TickManager;
/**/ class Object;
/** Tick function binder
*/
struct FTi... |
75e2106a7c6a4975f0193a0f3dabeedd2a5cc6cd | 656ace223b5f1574ee91bbff50c181344db9f343 | smeenai/llvm-project | /lldb/source/Commands/CommandObjectCommands.cpp | C++ | cpp | 76,230 | permissive | //===-- CommandObjectCommands.cpp -----------------------------------------===//
//
// Part of the LLVM 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
//
//===---------------------------... |
77a65f601341d688f5a28a987810691749d79321 | 6ca23b9654f76837bf912bfb8820b3a070497cb3 | ngnevan/ydk-cpp | /cisco-ios-xe/ydk/models/cisco_ios_xe/PIM_MIB.hpp | C++ | hpp | 26,836 | permissive | #ifndef _PIM_MIB_
#define _PIM_MIB_
#include <memory>
#include <vector>
#include <string>
#include <ydk/types.hpp>
#include <ydk/errors.hpp>
namespace cisco_ios_xe {
namespace PIM_MIB {
class PIMMIB : public ydk::Entity
{
public:
PIMMIB();
~PIMMIB();
bool has_data() const override;
... |
611039eb34634701fa03914955a0cb91848a64fe | cb98311a9198b9546b9be8e4db0a4dc0d343e0f2 | chain2/chain2 | /src/compactblockprocessor.cpp | C++ | cpp | 2,300 | permissive | #include "compactblockprocessor.h"
#include "compactthin.h"
#include "blockencodings.h"
#include "thinblock.h"
#include "streams.h"
#include "util.h" // LogPrintf
#include "net.h"
#include "netmessagemaker.h"
#include "utilprocessmsg.h"
#include "consensus/validation.h"
#include "compacttxfinder.h"
void CompactBlockPr... |
b5eb0339e005a19d4fcc28d7a15e328a2a5888a8 | 428805781fc607e8c736969de2113704da1e3bf6 | jeevan-gaikwad/real-time-rendering | /OpenGL_On_Linux/xwindows/25_Feb_18/01-PP-per-vertex/xwindows_opengl.cpp | C++ | cpp | 17,387 | no_license | #include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<memory.h>
#include<X11/Xlib.h>
#include<X11/Xutil.h>
#include<X11/XKBlib.h>
#include<X11/keysym.h>
#include<GL/glew.h>
#include<GL/gl.h>
#include<GL/glx.h>
#include<fstream>
#include"vmath.h"
#include"Sphere.h"
using namespace std;
using namespace vmath... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.