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 |
|---|---|---|---|---|---|---|---|---|
fa27ace3372cd6eb2a4ff8783eb526fdc455c125 | 53f453201564ac715cafb7c68c7eb77bd5d0879c | hkaiser/range-v3 | /include/range/v3/view/zip.hpp | C++ | hpp | 11,047 | permissive | // Range v3 library
//
// Copyright Eric Niebler 2013-2014
//
// Use, modification and distribution is 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)
//
// Project home: https://github.com/ericniebler/range-v3
//
... |
a21b36d7ac7f6f1db4e52139252330be7d1aeb58 | 6019f24410a31bd5e277284b5eb9bf66cfe0c159 | TokiMaki/Neso_Run- | /Main.cpp | C++ | cpp | 751 | no_license | #include "stdafx.h"
#include "Run_time_Framework.h"
CRun_time_Framework fx;
void main(int argc, char *argv[]) {
glutInit(&argc, argv);
fx.Registeridle([]() {fx.Update(); });
fx.RegisterRender([]() {fx.draw(); });
fx.RegisterKeyboardDown([](unsigned char key, int x, int y) {fx.KeyboardDown(key, x, y); });
fx.Regi... |
37e49779cf2ed5917461b1429ef70226aae5265c | 6d96dae8ac319ef530993a81bc1d6fd611860214 | michael370662/Interview_questions | /Frog_jump.cpp | C++ | cpp | 1,072 | no_license | // you can use includes, for example:
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <iterator>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
int solution(int A, int B, int D) {
int count;
coun... |
301a5d777621f734aa112105575df5242ab3742e | 09a4d22ef7b2624ac02e7e5c209f761da9c51c97 | liuyangzhuan/STRUMPACK | /examples/testPoisson2dMPI.cpp | C++ | cpp | 3,777 | permissive | /*
* STRUMPACK -- STRUctured Matrices PACKage, Copyright (c) 2014, The
* Regents of the University of California, through Lawrence Berkeley
* National Laboratory (subject to receipt of any required approvals
* from the U.S. Dept. of Energy). All rights reserved.
*
* If you have questions about your rights to use... |
26f1b7143f40cc05ec9bd207820b19741c5ae738 | 1915da717bdcfee3c0090efc7f3c2c9f8c52d7bd | 20k/net_code_server | /directory_helpers.hpp | C++ | hpp | 381 | no_license | #ifndef DIRECTORY_HELPERS_HPP_INCLUDED
#define DIRECTORY_HELPERS_HPP_INCLUDED
#include <tinydir/tinydir.h>
struct tinydir_autoclose
{
tinydir_dir dir;
tinydir_autoclose(const std::string& directory)
{
tinydir_open(&dir, directory.c_str());
}
~tinydir_autoclose()
{
tinydir_clo... |
437cac78adc374ed5f106b27e133fa18974b13bc | ea2110773a3be626e61649ad75a0e0db98c604fb | VictorShlaev/mediumAlgoritms | /searchRot.cpp | C++ | cpp | 2,020 | no_license | /*
* There is an integer array nums sorted in ascending order (with distinct values).
* Prior to being passed to your function, nums is rotated at an unknown pivot index k (0 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For exam... |
9f6bdbe90142559be1ff94d0a14a72f4ed417ec4 | 64c632573c99936653279024fb30e3494f2e15fa | congleetea/rtc-us-ros-pkg-code | /rntl/rtcus_navigation/src/trajectory_clearance/workspace_trajectory_2d_circular_robot_clearance.cpp | C++ | cpp | 4,810 | no_license | /*
* ArbitraryTrajectoryClearanceCircularRobot.h
*
* Created on: Feb 19, 2013
* Author: Pablo Iñigo Blasco - Robotics and Computer Architecture (ATC) - University of Seville - 2012
* License: GPLv3
*/
#include <rtcus_navigation/trajectory_clearance/workspace_trajectory_2d_circular_robot_clearance.h>
#... |
4dae82b7c95d56f59228952d904d3ea4913c3ab2 | 49d44a9e1dbd06cfc1fa885bcbbf013ff80e77a4 | vladfridman/wisey | /include/Model.hpp | C++ | hpp | 8,100 | no_license | //
// Model.hpp
// Wisey
//
// Created by Vladimir Fridman on 2/2/17.
// Copyright © 2017 Vladimir Fridman. All rights reserved.
//
#ifndef Model_h
#define Model_h
#include <set>
#include <llvm/IR/Instructions.h>
#include "IBuildableObjectType.hpp"
#include "IMethod.hpp"
#include "BuilderArgument.hpp"
namespac... |
aa7048edec183b392613183ea249ff6da0af9e7d | 58a653fd50397789a89f127746995dc5fb2977f5 | CoolName11/UrchinEngine | /physicsEngine/src/collision/broadphase/BodyEndPoint.cpp | C++ | cpp | 702 | no_license | #include "collision/broadphase/BodyEndPoint.h"
namespace urchin
{
BodyEndPoint::BodyEndPoint() :
bodyBox(nullptr),
bIsMin(false),
value(0)
{
}
BodyEndPoint::~BodyEndPoint()
{
}
void BodyEndPoint::setBodyBox(BodyBox *bodyBox)
{
this->bodyBox = bodyBox;
}
BodyBox *BodyEndPoint::getBodyBox() const... |
bceab27b91fea83c52ea5e1b5989f97e9881b798 | 10e56644c5991ab806ecf32b0821c43903937876 | NUC-NCE/algorithm-codes | /codes - ac/Gym/102215B/20017645_AC_31ms_28kB.cpp | C++ | cpp | 672 | no_license | #include<bits/stdc++.h>
#define ll long long
using namespace std;
#define MOD 9973
int x=0,y=0,z=0,m=0;
string a,b;
int main(){
getline(cin,a);
getline(cin,b);
for(int i=0;i<a.length();i++) {
if(a[i]=='#'&&b[i]=='#') x++;
else if(a[i]=='#') y++;
else if(b[i]=='#') z++;
else... |
b83ab9cdcaae6b169fa70f19dbedd183f27a879d | 8585d7966f6f0cfd537e9aa0c4954cb25c891455 | dotnet/dotnet-api-docs | /snippets/cpp/VS_Snippets_CLR_System/system.Globalization.HijriCalendar_AddGet/CPP/hijricalendar_addget.cpp | C++ | cpp | 1,846 | permissive |
// The following code example displays the values of several components of a DateTime in terms of the Hijri calendar.
// <snippet1>
using namespace System;
using namespace System::Globalization;
void DisplayValues( Calendar^ myCal, DateTime myDT )
{
Console::WriteLine( " Era: {0}", myCal->GetEra( myDT ) );... |
f35cb5d88b4010235be7cebf5fcc3c0ecab05aa1 | ae60b21220ffddb2cc3aadac9dab18d02af9a4e9 | otcshare/chromium-src | /third_party/blink/renderer/core/dom/dataset_dom_string_map.cc | C++ | cc | 7,363 | permissive | /*
* Copyright (C) 2010 Apple 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 a... |
4ff58dc4881ce442bff5ff57057f397c5bf0db9f | 42f94fe297edf6403c2f3160c5e7a9ab85481cc2 | lsry/LeetCode | /cpp/L2200/LeetCode2208.cc | C++ | cc | 603 | no_license | #include <vector>
using std::vector;
#include <algorithm>
#include <queue>
class Solution {
public:
int halveArray(vector<int>& nums) {
std::priority_queue<double, vector<double>, std::less<double>> pq;
double sum{0.0};
for (int num : nums) {
sum += num;
pq.push(num... |
b5c3cc1a7116372c2526e0098fcd9e6b6d0560ba | 3f2ceedf827266a2f8a882a0494e8c25eea7acba | svn2github/MPC-BE | /src/ExtLib/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp | C++ | cpp | 26,942 | permissive | /* Copyright (c) 2009-2013 MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Contribut... |
923f5d6d40d4e40a3a651682a6dc5775b1a995bc | 2ac35978991f7c8623bdadc65122f6facab01d3d | Rahul365/Coding_Practice | /Graph_Algorithms/topologicalSort.cpp | C++ | cpp | 1,213 | no_license | #include<bits/stdc++.h>
#define print(a) for(int x : a) cout<<x<<" "; cout<<"\n"
using namespace std;
const int N = 1e5;
int V,E;
vector<int> g[N];
vector<int> indegree(N,-1);
int last = -1;
vector<int> topologicalsort(){
queue<int> q;
//push the vertices which have indegree[v] == 0 in queue
for(int v = 1;... |
35a18b679a584034e287ac573b558fb1c6a84794 | a01464233a97157b858baaffcdbd6715c2879346 | xunliu/guinsoodb | /src/include/guinsoodb/planner/expression/bound_columnref_expression.hpp | C++ | hpp | 1,599 | permissive | //===----------------------------------------------------------------------===//
// GuinsooDB
//
// guinsoodb/planner/expression/bound_columnref_expression.hpp
//
//
//===----------------------------------------------------------------------===//
#pragma once
#include "guinsoodb/planner/column... |
666e774437955258ac3a848d7fb78be25aad9c22 | 7698b7607e025fa11e6700b6ff4b2f3c7be8cebb | qzcx/Internet_Programming | /MessageServer/util.cc | C++ | cc | 279 | no_license | #include "util.h"
std::vector<std::string> util::split(const std::string &s, char delim) {
std::vector<std::string> elems;
std::stringstream ss(s);
std::string item;
while (std::getline(ss, item, delim)) {
elems.push_back(item);
}
return elems;
}
|
27091e1aa32041fc9fa76d29cecaddb995e14d78 | 812989922738e7db886aa5fe087e40b2da4ddce6 | felipegnunes/obi-solucoes | /2018/fase1/figurinhas_copa.cpp | C++ | cpp | 626 | no_license | // Ad hoc
#include <iostream>
using namespace std;
int main()
{
int N, C, M;
cin >> N >> C >> M;
bool album[N] = {false}; // Algumas versões do compilador não reconhecem esse comando
int figurinhas_carimbadas[C];
for (int i = 0; i < C; i++){
cin >> figurinhas_carimbadas[i];
}
... |
9ec05fdfcd2b206b091ba0240b24e8b79eedc0b8 | 7164d5c62f5c137dd077626181f347e18c66f56f | cyjseagull/K8SFramework | /src/NodeServer/NodeServer.cpp | C++ | cpp | 3,459 | no_license |
#include "NodeServer.h"
#include "NodeImp.h"
#include "ServerImp.h"
#include "TimerTaskQueue.h"
#include "ServerObject.h"
#include "ProxyManger.h"
#include "Fixed.h"
#include "ContainerDetail.h"
#include "ServerManger.h"
void NodeServer::initialize() {
if (!container_detail::loadContainerDetailFromEnv()) {
... |
fac85b2f20dbe99c852d6c4a97d305d5c09d2132 | 87b10c927e9fded307d552a60323117466f64596 | bibibogaga/leetcode-gogo | /11/11/11.cpp | C++ | cpp | 1,036 | no_license | /*
把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。输入一个递增排序的数组的一个旋转,输出旋转数组的最小元素。例如,数组 [3,4,5,1,2] 为 [1,2,3,4,5] 的一个旋转,该数组的最小值为1。
示例 1:
输入:[3,4,5,1,2]
输出:1
示例 2:
输入:[2,2,2,0,1]
输出:0
*/
/*
解法:二分查找
*/
#include <iostream>
#include <vector>
using std::vector;
using std::cout;
using std::endl;
class Solution {
public:
int minArray(v... |
510ce5e55ea79183e9e785009b2f8f74dc213890 | f5b7473a1b87501890f6bff4724024f8dc6201e5 | RileyDesrochers/Best_Solutions | /Trimming_Convex_Polygons.cpp | C++ | cpp | 1,829 | no_license | /*
Written by: Riley Desrochers
problem statement:https://acpc18.kattis.com/problems/trimmingpolygons
*/
#include <bits/stdc++.h>
#define FR(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
//input storage
int x[401],y[401],c[401];
//DP array
long long F[401][401];
//calculate the area... |
ce9be486dee69034f848ae2d28d981f3d7f4c641 | ca8d8afdd561d2b0cfa6d4aa9e58d90c96cde9cb | ttyang/sandbox | /sandbox/boost/interfaces/detail/function_traits.hpp | C++ | hpp | 2,234 | no_license | // (C) Copyright Jonathan Turkanis 2004.
// 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.)
// Disclaimer: Not a Boost library.
#ifndef BOOST_IDL_FUNCTION_TRAITS_HPP_INCLUDED
#define BOOST_IDL_FUNCTION_TRAITS_HPP_IN... |
975604883dafb7905577552fa3b87bb67bb4c809 | 6a9efa7d50100ee9c046392e28faaa3e1abafe93 | winsider/libsass | /src/sass_values.cpp | C++ | cpp | 15,245 | permissive | // sass.hpp must go before all system headers to get the
// __EXTENSIONS__ fix on Solaris.
#include "sass.hpp"
#include <cstdlib>
#include <cstring>
#include "util.hpp"
#include "eval.hpp"
#include "operators.hpp"
#include "sass/values.h"
#include "sass_values.hpp"
extern "C" {
using namespace Sass;
// Return th... |
6b162fb1d6c145d247013f8c3931da5a1e34176c | bb045b83d1416390236902903a577b3765e9aaf3 | NgoQui/opencv | /modules/gapi/test/common/gapi_tests_common.hpp | C++ | hpp | 28,238 | permissive | // This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2018-2020 Intel Corporation
#ifndef OPENCV_GAPI_TESTS_COMMON_HPP
#define OPENCV_GAPI_TESTS_COMMON_HPP
#i... |
268c2f5b55945594d4d7ceb0fd4de07076b66711 | 3917d1de01ff8b3299154b02489eb361c7575880 | AaronNGray/GenomeWorkbench | /src/gui/packages/pkg_sequence_edit/custom_tree.cpp | C++ | cpp | 12,572 | permissive | /* $Id: custom_tree.cpp 42735 2019-04-08 17:41:06Z kachalos $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" ... |
40efa67d05194f0adea33dab7ad103e10c45fcfe | b999b0579e499f855b5f47a97b61ee8d0ee6b572 | bg453cornell/Object-Oriented-Programming | /2.6/Point.cpp | C++ | cpp | 1,634 | no_license | #include "Point.h"
#include <sstream>
#include <cmath>
#include <iostream>
using namespace bowen::CAD;
Point::Point () {
m_x = 0.0;
m_y = 0.0;
}
Point::Point(double z) {
m_x = z;
m_y = z;
}
Point::Point (double x, double y) {
m_x = x;
m_y = y;
}
Point::Point (const Point& p) {
std::cout... |
389af83743086d00cdff526fec8b39b1114da64f | 30ac5fcbbc69d8cb535b76a1ba05f214fff12428 | Pangolin-hmt/DNU-CNTT08-02 | /vuongcanrong.cpp | C++ | cpp | 295 | no_license | #include<iostream>
using namespace std;
void main()
{
int d, i, j;
cout << "nhap vao d, r : ";
cin >> d; cin.ignore();
for (j = 1; j <=d; j++)
{
for (i = d; i >=1; i--)
{
if (j == d || j == d - i + 1 || i == d) cout << "* ";
else cout << " ";
}
cout << "\n";
}
cin.get();
} |
14b28c4b7363da8e369aa70a2d830205925ae198 | 957f347e0cccd7d8c26455ac609a7e0e60ac0d78 | dongdong331/test | /external/vulkan-validation-layers/layers/object_tracker_utils.cpp | C++ | cpp | 61,368 | permissive | /* Copyright (c) 2015-2017 The Khronos Group Inc.
* Copyright (c) 2015-2017 Valve Corporation
* Copyright (c) 2015-2017 LunarG, Inc.
* Copyright (C) 2015-2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You m... |
a6e4f60f24f04a1cd9e5569239209f342578ccce | 7db0c361719da35d466f1dfb33ed01cf784092d0 | lineCode/EagleGUI | /src/Eagle/Gui/Layout/GridLayout.cpp | C++ | cpp | 6,977 | no_license |
/**
*
* _______ ___ ____ __ _______
* /\ ____\ /| \ / __\ /\ \ /\ ____\
* \ \ \___/_ || _ \ | /__/____\ \ \ \ \ \___/_
* \ \ ____\ || |_\ \ |\ \ /\_ _\\ \ \ \ \ ____\
* \ \ \___/_ || ___ \ \ \ \\//\ \/ \ \ \____\ \ \___/_
* \ \... |
0e1bda7aaf2d6d5a1ae812249ad270b3acdabac9 | 0051a0944a4fe4f58042eb5f0a0849cabc1c0134 | simplegsb/media-design-school | /AI/Exercises/QuadTree/QuadTree/Main.cpp | C++ | cpp | 5,298 | no_license | #include <gazengine/Events.h>
#include <gazengine/gdi/model/GDICircle.h>
#include <gazengine/gdi/model/GDIQuadTree.h>
#include <gazengine/gdi/rendering/GDIRenderingEngine.h>
#include <gazengine/input/MouseButtonEvent.h>
#include <gazengine/math/Intersection.h>
#include <gazengine/math/Math.h>
#include <gazengine/Messag... |
425149a7b6ab0d480a225ce95baffcd23795aea5 | 8d770e7d44a047470b5281fb1adb735d39931de6 | keuhdall/Piscine_cpp | /j07/ex02/main.cpp | C++ | cpp | 1,003 | no_license | #include "Array.class.hpp"
#include <iostream>
int main() {
Array<int> arr_test;
Array<int> arr_i(3);
Array<std::string> arr_str(5);
try {
std::cout << arr_test[0] << std::endl;
} catch (std::exception & e) {
std::cerr << e.what() << std::endl;
}
arr_i[0] = 1;
arr_i[1... |
ec81cde348954d40462d4b2bcc506da1d2b851f3 | 438fb9b280601b836e29b8f39eaf17820b038b8a | LiberatorUSA/GUCEF | /platform/gucefCORE/src/gucefCORE_CDataNodeSerializableSettings.cpp | C++ | cpp | 5,212 | permissive | /*
* gucefCORE: GUCEF module providing O/S abstraction and generic solutions
* Copyright (C) 2002 - 2007. Dinand Vanvelzen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; ei... |
0b01af76e375377f6276cdde331ff7893422433c | fb919769ca5172f49a8ff4993047d57e253d65f5 | roussukke/Yorozuya | /YorozuyaGSLib/source/CGuildMasterEffectDetail.cpp | C++ | cpp | 10,197 | permissive | #include <CGuildMasterEffectDetail.hpp>
#include <common/ATFCore.hpp>
START_ATF_NAMESPACE
namespace Detail
{
Info::CGuildMasterEffectctor_CGuildMasterEffect2_ptr CGuildMasterEffectctor_CGuildMasterEffect2_next(nullptr);
Info::CGuildMasterEffectctor_CGuildMasterEffect2_clbk CGuildMaste... |
3cd8f235910c815c84738dfa13e8b6392db45639 | d84224086bfb0830d587bde20af6344b83307e63 | tuannm250100/SDL_GAME_BETTER | /TestGame/AmoObject.cpp | C++ | cpp | 498 | no_license | #include "AmoObject.h"
AmoObject::AmoObject()
{
rect_.x = 0;
rect_.y = 0;
x_val_ = 0;
y_val_ = 0;
is_move_ = false;
amo_type_ = NONE;
speed = 20;
}
AmoObject::~AmoObject()
{
}
void AmoObject::HandleMove(const int& x_border, const int& y_border)
{
rect_.x += speed;
if (rect_.x > x_border)
{
is_move_ = f... |
d7f7d3bd0630b5f05103f20c9b59317895c0114f | af64156fc80640a685cbdaeec3f9e7fce2304421 | HenryGJackson/PhysicsSimulation | /src/Forces/Gravity.cpp | C++ | cpp | 1,157 | no_license | #include "Forces/Gravity.hpp"
//Create functions that return a function that evaluates to the gravitational
// force between two bodies
double Gravity::Force(double mass1, double mass2, double distance){
double f = G*mass1*mass2*(-1) / distance*distance;
return f;
}
MathFunction* Gravity::Force(Star* s1, Star... |
8512128f2b87bddb451d081ab71b762efa6b54f0 | acd8334dfee5f50ac2e6d71dfa90a23e092df71f | wang-y-z/leetcode-algorithm | /225.用队列实现栈.cpp | C++ | cpp | 1,130 | no_license | /*
* @lc app=leetcode.cn id=225 lang=cpp
*
* [225] 用队列实现栈
*/
// @lc code=start
class MyStack {
public:
queue<int> q1;
queue<int> q2;
/** Initialize your data structure here. */
MyStack() {
}
/** Push element x onto stack. */
void push(int x) {
q1.push(x);
}
/*... |
466b04ce32ad513b6986529492c87c059002a922 | 9a4ceef36d245c7ffaa0c991146847217d0dfb4e | iridium-browser/iridium-browser | /components/safe_browsing/content/renderer/renderer_url_loader_throttle.cc | C++ | cc | 11,180 | permissive | // Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/safe_browsing/content/renderer/renderer_url_loader_throttle.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/metrics/histogr... |
b94d16ace8af6d7c45b344ffa3950910a806a550 | 147ea5605dcf43e87d4ae5504aa3c12008f3c863 | gowtham614/pal | /src/core/hw/gfxip/gfx9/gfx9PipelineChunkPs.cpp | C++ | cpp | 14,158 | permissive | /*
***********************************************************************************************************************
*
* Copyright (c) 2015-2018 Advanced Micro Devices, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associ... |
d7c4debf67b2e78c17e80c275b36be8f4a0c5bc2 | e6cfbb5caeed696f9d1cce11e9282bb4fde40245 | asalem2/csc-340-Data-Structures- | /Project6/Recursion/RecursiveADT.cpp | C++ | cpp | 3,235 | no_license | /* Ahmed Salem
* 910017087
* ahmeds@mail.sfsu.edu
* Class:Hui Yang 340-01
* Date: November 21, 2014
* IDE/Compiler: Netbeans
* This program is the file that contains all the functions.
*/
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include "RecursiveADT.h"
using namespace std;
//... |
b86984dcddbb0f1d4f96102c1b518198b08612a7 | ef6dc792d685be0cad5168a2cf98039f6fbccddc | WuYu-99/caterpillar | /lib/mockturtle/mockturtle/interface.hpp | C++ | hpp | 33,785 | permissive | /* mockturtle: C++ logic network library
* Copyright (C) 2018 EPFL
*
* 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 u... |
17b44fcb6bf4e46af622a28fa7214df1bcd21834 | 7cfaa0f4eb9bd819aa157f67f446f6b9148b2af6 | rongzha1/incubator-mxnet | /src/operator/nn/moments.cc | C++ | cc | 3,172 | permissive | /*
* 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 ... |
78507095d4f5dc364cb32b796ec9ff461d19555c | 5d68896454935354cdab7a67cf2c0417d19d1152 | kedartal/math | /stan/math/prim/prob/normal_lpdf.hpp | C++ | hpp | 4,739 | permissive | #ifndef STAN_MATH_PRIM_PROB_NORMAL_LPDF_HPP
#define STAN_MATH_PRIM_PROB_NORMAL_LPDF_HPP
#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/err.hpp>
#include <stan/math/prim/fun/as_column_vector_or_scalar.hpp>
#include <stan/math/prim/fun/as_array_or_scalar.hpp>
#include <stan/math/prim/fun/as_value_column_arr... |
b5d58637ec884d00c931d4c16befffe6587ac3e3 | 782c195189d059b339a54001cf7b21c574e5be79 | parcuse/leetcode | /LongestStr.cpp | C++ | cpp | 677 | no_license | int lengthOfLongestSubstring(string s) {
int cursor1 = 0;
string max_data = "";
size_t max = 0;
size_t length = s.size();
for (int cursor2 = 0;cursor2 < length; cursor2++){
if (max_data.find(s[cursor2]) == string::npos){
string tmp_max_data = s.sub... |
cf4d215eb5cf0c90a541048050e38048f09b6cfb | 1e8a1750ec3b02f35f89c969e40680b63bf50d89 | WaykiChain/wicc-wasm-cdt | /wasm_llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp | C++ | cpp | 37,710 | permissive | //===----------- PPCVSXSwapRemoval.cpp - Remove VSX LE Swaps -------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===--------------------------------------------------------... |
998ef4a73d39aee98d335d221efe5093adc74f6b | f3d78fafe0133fe774bd68e5acc7b5f0f069fc9d | tpehrson123/hafb-cpp-fundamentals | /Module1/LA1-2/my_array.cpp | C++ | cpp | 1,410 | no_license | #include <iostream>
#include <cmath> // for sqrt() function
#include <iomanip> // for formatted output
using namespace std;
const int kMaxMum = 5;
int main()
{
float average = 0;
int sum = 0;
// C-Style arrays
// Array notation: type name [elements];
int grades[kMaxMum] = {10, 20, 30, 10, 50};... |
c86adcdeec78d3d22ecb4697ddddf7be89e250e3 | dee24076589ed28b00349059d0f280e7f8f2a116 | MalcolmYllenius/BPG | /Source/Sensors_Code/Private/Sensor.cpp | C++ | cpp | 1,303 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "Sensors_Code.h"
#include "Sensor.h"
#include "VictimLocation.h"
// Sets default values
ASensor::ASensor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
Pri... |
44e911901eec509d37c8564dfb50057b32ce5a1d | 91aca6e7bef3fc9149285686a811b51a015ae86f | HalfMadDad/factor | /vm/os-unix.cpp | C++ | cpp | 8,826 | permissive | #include "master.hpp"
namespace factor
{
THREADHANDLE start_thread(void *(*start_routine)(void *),void *args)
{
pthread_attr_t attr;
pthread_t thread;
if (pthread_attr_init (&attr) != 0)
fatal_error("pthread_attr_init() failed",0);
if (pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_JOINABLE) != 0)
fatal_e... |
4e66ca28ec0248a5a84d64a9aee8ca68ce997d2b | 549da2486ceb3ab99184e1965398c9dabede3a06 | Matthias-Fauconneau/libmv | /src/libmv/multiview/homography_error_test.cc | C++ | cc | 4,227 | permissive | // Copyright (c) 2011 libmv authors.
//
// 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, merge, publish... |
1854460153992b9fbc543ca0f19dedc5f314f627 | 4fd5b9c43a547766d957f7408b977bf7ce8e3a85 | KhronosGroup/LLVM-SPIRV-Backend | /mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp | C++ | cpp | 33,167 | permissive | //===- FuncToLLVM.cpp - Func to LLVM dialect conversion -------------------===//
//
// 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
//
//===---------------------------... |
799f78b193abb3b3076afd5e5c6c573db4ed264a | b93e0c2436915f8df891b5463376d41e6801c5c1 | Dendyilhamakbar/Tugasbaru2 | /Tugasbaru.cpp | C++ | cpp | 1,428 | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main(){
cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(4);
// 1# Matrix X - Isi dan Tampilan Data
cout << "MATRIKS X : "<<endl;
double ac[3][5]={ {4,4,5,3,3},{3,3,4,2,3},{5,4,2,2,2} };
for(int i=0;i<3;i++){
for(int j=0;j<5;j++){
... |
bc3d4298e04040bdad79bf347075852b2190e528 | 3c0aa5ccecbaa654ad4c90358733fe6ea7051520 | fanleehao/Algorithm | /ClassOJ-2019Spring/test_1_windows.cpp | C++ | cpp | 1,255 | no_license | #include<iostream>
#include<math.h>
#include<algorithm>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<vector>
#include<sstream>
#include<iomanip>
#define LL long long //9223372036854775807(19位) 2的63次方
#define debug cout<<"******"<<endl;
#define INF 0x3fffffff
#define MAX 101000
using namespac... |
403c708aa01250c90d69394fb699c97d2721ab18 | ffc017b092f95d7463239d77d3b4daa95c616413 | dmaier-couchbase/cb-social | /node_modules/couchbase/deps/lcb/tests/iotests/mock-environment.cc | C++ | cc | 14,252 | permissive | /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2012 Couchbase, 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
*
* ... |
74e31fd2fd80f9f04dd92182390137dbfe1ea386 | c2cf04560720d999bd01590e9d02635c3b8a17df | nicholasmeier/ArchivedClassWork | /cs251/project2/nicholas_meier/proj2-src/queue_main.cpp | C++ | cpp | 2,922 | no_license | #include<iostream>
#include "myqueue.h"
using namespace std;
int main(){
myqueue<int> * q_int = new myqueue<int>();
myqueue<double> * q_double = new myqueue<double>();
myqueue<char> * q_char = new myqueue<char>();
myqueue<string> * q_string = new myqueue<string>();
string s;
string _int = "int";
string _doub... |
7a1f984a171d0785773842e1dd57030bbea772ce | da8f372f31ec9a6933e1bf964b7596c2d0badf98 | TheoLeyenda/TSDVJ-UnrealGame | /Source/DualCombatColor_FPS/PlatformPawn.cpp | C++ | cpp | 2,016 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "PlatformPawn.h"
// Sets default values
APlatformPawn::APlatformPawn()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
b... |
cc40e40576080520b2097b983cb578f9c34470aa | 06ba8c6868cc693dd7607b8d697dc8785ef2025a | davencyw/templates | /cc/scientific_sim/src/main.cc | C++ | cc | 667 | no_license | #include <climits>
#include <omp.h>
#include <iostream>
#include <string>
#include "simenv.hh"
#include "cmdparser.hh"
int main(int argc, char const *argv[]) {
// parse command line arguments
SimEnv simenv;
cmdpars(argc, argv, simenv);
// create terminal output
std::cout << "\n"
<< "\n"
... |
7ef8f78dd1feec057dc5aa02341b6bab3c24e102 | 35b2748a6bcd3a42c625cb934bef6f271c50d941 | kgugala/vtr-verilog-to-routing | /vpr/src/base/read_route.cpp | C++ | cpp | 18,256 | permissive | /* Read in the .route file generated by VPR.
* This is done in order to perform timing analysis only using the
* --analysis option. This file set up the routing tree. It also checks that
* routing resource nodes and placement is consistent with the
* .net, .place, or the routing resource graph files. It is assumed
... |
8cdcec37729c4fae36c0752c22544d95d0d54b5a | a56332b99113806c0c9eb898c97d1ccf04724dda | toshok/zircon | /kernel/arch/x86/perf_mon.cpp | C++ | cpp | 76,588 | permissive | // Copyright 2017 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
// A note on the distribution of code between us and the userspace driver:
// The default location for code is the userspace drive... |
428989965819ea906b48216078638d9151a416cd | ffd1d84d7b660eed3066a8353faca78fd96d16c8 | sivm205/cpp-development | /cpp-development-first/c26.cpp | C++ | cpp | 255 | no_license | //reversing a number
#include<iostream>
using namespace std;
int main()
{
auto num{123456789}, res = 0;
cout<<"reversing s number is ="<<endl;
while(num>0)
{
res = num%10;
cout<<res;
num = num/10;
}
return 0;
} |
901fa3f332e82a1f0c909aab5f5773a52e6732f6 | 070bb3a604cf0c9d17cd195dc06acfa2ec4de9df | ketoo/redis-client | /redis-client/CRedisPool.cpp | C++ | cpp | 4,905 | no_license | /**
* Copyright (c) 2015, (Copyright statement)
*
* @file CRedisPool.cpp
* @brief CRedisPool class is to create and manage redis connections in the buffer pool.
* These connections are ready to be used by any thread that needs them.
* @author: yp
* @date: Jul 6, 2015
*
* Revision Description: initial versi... |
c14fe60ecb9ce5f18b3cd22c602b4e5e9e0854f5 | f627a1cfa1e6e8471fb01b580547e2deec51497e | kwansu/Win32Api_Practice | /MultyWindow/MultyWindow/Main.cpp | C++ | cpp | 401 | no_license | #include "MultyWindow.h"
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance
, LPSTR lpszCmdParam, int nCmdShow)
{
MSG msg;
HWND hWnd;
Wnd_MultyWindow main_window;
hWnd = main_window.GetHWND();
if (!hWnd)
return -1;
ShowWindow(hWnd, nCmdShow);
while (GetMessage(&msg, NULL, 0... |
ca20625a267afd60af910a93abc9ba31cb586cb1 | caab7ac7611b67f9e72c69dcb482cc5561e9744a | DennisLiu16/ros_simulation_env | /src/tf_pos_ns.cpp | C++ | cpp | 2,899 | no_license | #include "ros/ros.h"
#include "tf/transform_broadcaster.h"
#include "geometry_msgs/Twist.h"
#include "nav_msgs/Odometry.h"
double vx = 0.0;
double vy = 0.0;
double vth = 0.0;
const float PI = 3.14159265358979323;
ros::Subscriber sub;
void VelCallback(const geometry_msgs::Twist &msg)
{
vx = msg.linear.x;
vy = msg.... |
72af7c75f8ba0b43353ffc7e72128777afa6a936 | 49e8e22e7cd0d3b54f8543544e2731b4deab530b | v-jush/azure-client-tools | /code/Utilities/Guid.cpp | C++ | cpp | 988 | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "stdafx.h"
#include "Guid.h"
#include "DMException.h"
#include <Rpc.h>
using namespace std;
namespace Microsoft { namespace Azure { namespace DeviceManagement { namespace Utils {
wstring Guid::NewGuid()
{
UU... |
5f802585d643a4e82ff5f349db4aa57956d8df7d | 33db883e5fad867bb5b38f900e3c6538398882cf | Dir-MaGaSe/Portafolio_ManuelGallardo | /Portafolio 2 - Ejercicio 9.cpp | C++ | cpp | 1,165 | no_license | //Manuel Sebastián Gallardo Vásquez
//GV100520
#include<iostream>
#include<iomanip>
#include<string>
#include<conio.h>
using namespace std;
const string Autor = "Manuel Sebastian Gallardo Vasquez";
const string Carnet = "GV100520";
void imprimirArreglo(int arr[][3][2], int filas, int columnas, int profundidad)... |
4cac3fe5ee36cd2bf207ecd1cd154e9a5fc144c4 | 5c5f5c9ed549ec9a5fdc09dfdf1f406c8b7c8f72 | adityanjr/code-DS-ALGO | /LeetCode-Challenges/2020/7. July/Week4/Single_Number_III/solution.cpp | C++ | cpp | 435 | permissive | class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
int r = 0;
int last = 0;
vector<int> result(2, 0);
for(int num: nums) {
r ^= num;
}
last = r & (~(r - 1));
for(int num: nums) {
if((num & ... |
b8a496f076c21781bb262ccb05efc47203f2eafd | fbc5434bf73c28ec9fb2fb0a00f80aaac747c961 | avatarbuss/dotnet-api-docs | /samples/snippets/cpp/VS_Snippets_Wpf/DiagnoseProblematicPrintJob/CPP/Program.cpp | C++ | cpp | 15,334 | permissive | //Program.cpp file
using namespace System;
using namespace System::Collections::Generic;
using namespace System::Text;
using namespace System::Printing;
using namespace System::IO;
namespace DiagnoseProblematicPrintJob {
//<SnippetTimeConverter>
private ref class TimeConverter {
internal:
... |
822297d53b63ab45b413306e5b4afb6e26beae9d | 030e15bca2a4971f068d342c6b2042a08e600be5 | KonstantinovD/Basics-of-CPP-BSU-2017 | /TestProject/resources/task5.cpp | C++ | cpp | 1,466 | no_license | #include "..\taskManager\TaskInclude.h"
#include <iostream>
class BaseA{
public:
//The first class with vitrual func may be used as standart class in arrays
//in case we don't make this func virtual, pointer to the BaseA will call only BaseA func
//it is interesting that all the functions after that you ... |
d78bf4f147880edd978aec84d751ade9c247ed00 | 994f2cdc8cbc10a7ddab07e6d26c491f90747172 | operativeF/Kvasir | /Lib/Chip/CM4/STMicro/STM32F429/GPIOJ.hpp | C++ | hpp | 31,121 | permissive | #pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//General-purpose I/Os
namespace GpiojModer{ ///<GPIO port mode register
using Addr = Register::Address<0x40022400,0x00000000,0x00000000,std::uint32_t>;
///Port x configuration bits (y = 0..15)
constexpr Registe... |
6a04cbaa1dc037a1b51e1b8d7fe9fc587fdb4ce8 | f281d255f327e43a48a2e3c3ba781186cbac1d9e | cooljeanius/CodeAnalyst-3_4_18_0413-Public | /src/ca/libs/libca/image_errors.cpp | C++ | cpp | 1,142 | no_license | /**
* @file image_errors.cpp
* Report errors in images
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author John Levon
*/
#include "image_errors.h"
#include "arrange_profiles.h"
#include <iostream>
using namespace std;
void report_image_error(inverted_profile const & pro... |
313a21fd2aa7dcde3abb0e53d8589b8aaa86ce36 | 54b768b569839f0af17a9de660212f9d911b8c57 | NeilChongSun/2DGamesProgramming | /HelloZelda/TileMap.cpp | C++ | cpp | 10,643 | no_license | #include "TileMap.h"
#include<ImGui/Inc/imgui.h>
#include"Camera.h"
namespace {
std::unique_ptr<TileMap> sInstance;
}
void TileMap::StaticInitialize()
{
XASSERT(sInstance == nullptr, "tilemap already initialized!");
sInstance = std::make_unique<TileMap>();
}
void TileMap::StaticTerminate()
{
sInstanc... |
b008bb6ed1e7e3586185e54b0dfda364c763c621 | 037e4fb9931f6f7700768b8ee06d0b4728d8cbed | mirzaei-ce/core-habebit | /src/test/scheduler_tests.cpp | C++ | cpp | 4,945 | permissive | // Copyright (c) 2012-2015 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 "random.h"
#include "scheduler.h"
#include "test/test_habebit.h"
#include <boost/bind.hpp>
#include <boost/random/... |
a87971a78736b63133e040d46201bfb53d9bc555 | d659716a501cd0402bd34d29681f9955f9d3362b | jl2337/Programming-for-Financial-Engineering | /Level 3/2.2 Ex1/2.2 Ex1/point.hpp | C++ | hpp | 452 | no_license | //
// point.hpp
// 2.2 Ex1
//
// Created by 刘佳杰 on 2/20/19.
// Copyright © 2019 刘佳杰. All rights reserved.
//
#ifndef point_hpp
#define point_hpp
#include <stdio.h>
#include <iostream>
#include <sstream>
using namespace std;
class point{
public:
point(double,double);
double get_x();
double get_y();
... |
1dd9a28b5640090b525479b6ac4a1bd748b207f6 | d73551f1a2b490315412b6f58da3c49ee2edd4ff | frezzerovshik/T.P.L.S.2.N.1 | /TP.L.S.2.N.1/Relatives/Brother.hpp | C++ | hpp | 463 | no_license | //
// Brother.hpp
// T.P.L.B.1_2.SEM
//
// Created by Артем Шарапов on 13/09/2019.
// Copyright © 2019 Артем Шарапов. All rights reserved.
//
#pragma once
#include "Base.hpp"
class Brother : public Base{
string* kindOf;
public:
Brother();
Brother(const Base& init) : Base(init){kindOf = new string;kindO... |
3a89e5b66774186088f5428eded21b6491b81626 | 6609f126ed2468642a78ffaec66f0f48e5b4ac1b | alfgook/fuel-sim-mpi | /SaG4n/src/G4SaG4nParticleHPReactionWhiteBoard.cc | C++ | cc | 3,772 | no_license | //
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration... |
0c5d89d69162dbe50d46de5ca91c35b8becd88b5 | dd26f8892c64041d364388f6684d70e336e36b08 | JanathonL-CMU/tech-interview-handbook | /utilities/C++/google high frequency/41. First Missing Positive.cpp | C++ | cpp | 920 | permissive | //41. First Missing Positive
/*
Given an unsorted integer array, find the smallest missing positive integer.
Example 1:
Input: [1,2,0]
Output: 3
Example 2:
Input: [3,4,-1,1]
Output: 2
Example 3:
Input: [7,8,9,11,12]
Output: 1
Note:
Your algorithm should run in O(n) time and uses constant extra space.
*/
// Put e... |
7302150ae5a6620c218f0da14bd5529cd42bbf91 | 9b7485e0cd2871cd8d113939efbdd5f4ab5e214e | ahadou/REED-system | /client/utils/ssl.hh | C++ | hh | 2,687 | permissive | /*
* ssl.hh
*/
#ifndef __SSL_HH__
#define __SSL_HH__
#include <arpa/inet.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <resolv.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/type... |
847c358d0681f9f0f0d1928e0f4d5584c6a03577 | 88f67253d68bb3f423e40c2fa1e9737701b7c85c | patywang/git-ufrrj | /Exer ED1/Semana_2 - Patrícia Wang/Simplesmente_3/ListaSEncad.cpp | C++ | cpp | 4,370 | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "ListaSEncad.h"
using namespace std;
ListaSEncad::ListaSEncad()
{
pri = NULL;
it = NULL;
}
float ListaSEncad::Consulta()
{
if(it != NULL){
return it->consultaInfo();
}else{
cout << "Erro: n� inv�lido!" << endl;
... |
bf6416c15d7fab8653fff0f9601edb9b7b02895a | d32e5d3785882b7f4a2de293a66d0f5e78bd3420 | gganis/cvmfs | /cvmfs/swissknife_graft.cc | C++ | cc | 11,556 | no_license | /**
* This file is part of the CernVM File System.
*
* Process a set of input files and create appropriate graft files.
*/
#include "cvmfs_config.h"
#include "swissknife_graft.h"
#include <fcntl.h>
#include <unistd.h>
#include <cstdio>
#include <vector>
#include "fs_traversal.h"
#include "hash.h"
#include "plat... |
a34b2d9fc00c3b6528a904ea57382de22a674cdd | 9fab44a9b2923f6f92e4f43e8dfd087e4af3e6e0 | elsypinzonv/algorithm-analysis | /greedy/watering_grass.cpp | C++ | cpp | 1,411 | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
void process(vector< pair<long double, long double> > v, long double m){
vector< pair<long double, long double> > result;
pair<long double, long double> best;
long double x = 0, sum, i;
best = {-1,+1};
x = sum = i... |
a5a430a837c01942f0eab711b0322652857fb1ed | 63751766a39d5b6614d166a86af345de1b58a97f | iccowan/learn_cpp | /2021/movies.cpp | C++ | cpp | 1,657 | no_license | #include <iostream>
#include <list>
#include <fstream>
using namespace std;
/**
* Gets the user input from the console
*
* @param userInput the pointer to output the user input to
*/
void getUserInput(string &userInput) {
cout << "Press `l` to list movies or type the name of a new movie: ";
getline(cin, u... |
1e929f69848cdce5be21e0b57377a9459001f295 | c3620f2d12b374097d1c21026cc98aa240dfa169 | autyinjing/Cpp-learning | /C++ Primer plus/4_compoundtype/example/arraynew.cpp | C++ | cpp | 826 | no_license | // =====================================================================================
//
// Filename: arraynew.cpp
//
// Description:
//
// Version: 1.0
// Created: 2014年02月22日 10时04分24秒
// Revision: none
// Compiler: g++
//
// Author: Aut(yinjing), linuxeryinjing@... |
0bd2cff482a181da3bc21b03e0d7ee823f9fd229 | ff6c659a7eded8862891d949d7cd27a3ab4167b1 | DockingMule/CSC_205 | /classProblem3-18/classProblem3-18/classProblem318.cpp | C++ | cpp | 468 | no_license | // This program illustrates a problem that can occur if
// cin is used to read character data into a string object.
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name;
string city;
cout << "Please enter your name: ";
getline(cin, name);
cout << "... |
3b9a38c39cce001462ff6a7df68efdb00549bb1b | 0357173ecd07ac97d49f26b5d4cde0ad780a1668 | akaikesan/programcomp | /BeginnersSelection/coins.cpp | C++ | cpp | 326 | no_license | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<=n;i++)
using namespace std;
int main(){
int a, b, c, x;
cin >> a >>b >>c >>x;
int ctr = 0;
rep(i,a){
rep(j,b){
rep(k,c){
if (500*i + 100*j + 50*k == x){
ctr += 1;
}
}
}
}
cout << ctr << endl;
return... |
9c58f4ad28899db28e3bc3d4d8d404b40bfad709 | 291fb7757e50fda366aaf2cd7aa017402b495324 | PIPIKAI/ACM | /code/2015蓝桥杯-3.cpp | C++ | cpp | 503 | permissive | #include <stdio.h>
// 1/3
void test(int x[])
{
int a = x[0]*1000 + x[1]*100 + x[2]*10 + x[3];
int b = x[4]*10000 + x[5]*1000 + x[6]*100 + x[7]*10 + x[8];
if(a*3==b) printf("%d / %d\n", a, b);
}
void f(int x[], int k)
{
int i,t,p;
if(k==9){
for( p=0;p<9;p++)
printf("%d ",x[p]);
printf("\n");
return;
}
for(... |
3790427bdf1f091979e05d91118ddda8bb142f87 | ac2e459b9e9434556e531c7ed310e290d290f85e | adnaan1703/Codes | /practice_codes/dsuClass.cpp | C++ | cpp | 1,171 | no_license | #include <bits/stdc++.h>
using namespace std;
class DisjointSet {
private:
int length;
vector<int> nodes;
vector<int> size;
int root(int i) {
while(nodes[i] != i) {
nodes[i] = nodes[nodes[i]];
i = nodes[i];
}
return i;
}
public:
DisjointSet() {
length = 1e6;
DisjointSet(length);
}
Disjoint... |
b3a6e1df82efd96814bb8a0e150323753ed66bbb | f72fc90f6c9fa1150e07a036d9550701e28b45a2 | Udayadroit/inventory-extraction | /src/clustering/features/BasicMomentsFeature.cpp | C++ | cpp | 1,984 | permissive | /*******************************************************************************
* Copyright 2011 Sebastian Colutto
*
* 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.a... |
60fd17d0bd0950d58d8bfda126068639cce8a05e | b4b279df623ed441e9dc4e13cccee94b292e31b4 | anvesh649/programming-revamp | /InterviewBit/Heaps and Maps/Merge K Sorted Arrays!.cpp | C++ | cpp | 1,667 | no_license | /* An efficient solution is to use heap data structure. The time complexity of heap based solution is O(N Log k). where N is count of all elements
1. Create an output array.
2. Create a min heap of size k and insert 1st element in all the arrays into the heap
3. Repeat following steps while priority queue is not empty... |
c25bba6b8f7e5b6da59c1d58ecc56f1d8477795b | 3f87c3fb129978155853f93892b307f954b95320 | Uunicon/Data-Structure | /HW7_Problem3.cpp | C++ | cpp | 4,691 | no_license | #include<iostream>
using namespace std;
#define MaxVertexNum 100 // 最大顶点数设为100
typedef int Vertex; // 用顶点下标表示顶点,为整型
typedef int WeightType; // 边的权值设为整型
typedef int DataType; // 顶点存储的数据类型设为整型
//--------队列------------
struct QNode //队列结点
{
int Node;
struct ... |
f3c13f38fe92a4e9df4111e96b4a3645f4cb3b79 | c89cd2bcf6e965f8c163a0b11da561251248c44b | sca1a/acm-valladolid | /accepted/p191_intersection/acm.cpp | C++ | cpp | 2,937 | no_license |
/* @JUDGE_ID: 40922FK 191 C++ */
/******************************************************************************
Solution to Problem 191 - Intersection
by: Francisco Dibar
date: Mar-13-2004
******************************************************************************/
#include <iostream>
#inclu... |
92ab69e395fdac27e8690b26d812174ddd2669f4 | 8a35e45c8949eb32519aee150774ecc5cd8510ab | Kitware/vtk-examples | /src/Cxx/Points/FitImplicitFunction.cxx | C++ | cxx | 2,312 | permissive | #include <vtkBoundedPointSource.h>
#include <vtkCamera.h>
#include <vtkFitImplicitFunction.h>
#include <vtkGlyph3D.h>
#include <vtkNamedColors.h>
#include <vtkNew.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#incl... |
dd1b5b2b4a0246dcfc527f11097e123a03c4fd57 | d6a5ea1afde027ce3225ef7e0da6b70ab14940c4 | joshuabarrow221/Generator | /src/Physics/Hadronization/LeptoHadronization.cxx | C++ | cxx | 22,169 | no_license | //____________________________________________________________________________
/*
Copyright (c) 2003-2020, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org
Alfonso Garcia <alfonsog \at nikhef.nl>
NIKHEF (Amsterdam)
*/
//___________________________________________________... |
bb0bcbfe396bd2c4f659473f6d72d276ec40895b | e71fb31f1a1f536b7f131405500484047716e144 | Group-3-CS201R/Group4_Assignment5 | /Group4-Project5/Group4-Project5/Property.cpp | C++ | cpp | 1,918 | no_license | #include <iostream>
#include <string>
#include <vector>
#include "Property.h"
using namespace std;
Property::Property(string name, string color, int cost, int mortgage, int rentBase, int rentOneHouse, int rentTwoHouse,
int rentThreeHouse, int rentFourHouse, int rentHotel, int houseBuyCost, int hotelBuyCost) :
Tile... |
e5d85d7aed915044206bc917c8182c78088616f0 | 7f48c4ae85bada6b9a89ded372c0da7d3339c68a | mafo23/tic-tac-toe | /main.cpp | C++ | cpp | 4,673 | no_license | #include <iostream>
#include <limits>
#include "display.h"
#include "game.h"
#include "ai.h"
void twoPlayer();
void singlePlayer();
int main(int argc, char const *argv[]) {
int v;
std::cout << "If you would like to play vs a computer, enter 1, otherwise, enter 2" << std::endl;
while (!(std::cin >> v && (v... |
afd8ac45816864b5cd75f1f7624d72d60e6bcdb7 | 23da7f655ff9879583921b1471ddf93d3bcb6bff | Chriswmillar/CodePad | /src/LEDFadeManager.cpp | C++ | cpp | 2,056 | no_license | #include "LEDFadeManager.h"
#include "LEDFader.h"
#include "Arduino.h"
#include "Config.h"
#include "Pins.h"
/*
Constructor. Generic. Boring
*/
LEDFadeManager::LEDFadeManager() {
for(int i=0; i < NUM_LED_FADERS; i++){
_led_faders[i].init(i+1, _get_pin_number(i+1));
}
}
/*
start one of the leds fading up
:pa... |
b03ae0fe028d29085fc47b50ecb729ceb90cd2c6 | 63e8c09354be4ad697851fbb38a38ad51c44a0df | zeroth/BatchProcessing | /JobQueue.cpp | C++ | cpp | 824 | no_license | #include "JobQueue.h"
#include <QMutexLocker>
#include <QDebug>
JobQueue *JobQueue::instance()
{
static JobQueue* _instance = new JobQueue();
return _instance;
}
void JobQueue::add(Job *j)
{
QMutexLocker locker(&mutex);
jobs.append(j);
if(!this->isRunning())
this->start();
}
void JobQueue... |
324b2188586e574787dc1f1e9b0f73d0d905d327 | 5e1e729b95a0078321f298b2bc3d34a254508b23 | theiren46/llvm | /lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | C++ | cpp | 19,321 | permissive | //===-- AMDGPUAsmPrinter.cpp - AMDGPU Assebly printer --------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
f67e202bc1303e4977866b785c3e2a4a29e9ef2e | c705d9a47135e980aed700704c5f18561726df9c | sneumann/mzR | /src/pwiz/analysis/demux/DemuxDebugReadWriteTest.cpp | C++ | cpp | 4,154 | no_license | //
// $Id$
//
//
// Original author: Austin Keller <atkeller .@. uw.edu>
//
// 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 r... |
aafa5780d20fd40d3dea6c33fe0c501edd0064ed | a97122a54ee598c6205436459392ebab048e5090 | cesar-magana/Interview-Cake | /12. Combinatorics, probability, and other math/02. Find and Ordered Set/contains01.cpp | C++ | cpp | 2,005 | no_license | #include <iostream>
#include <vector>
// C++11 lest unit testing framework
#include "lest.hpp"
using namespace std;
bool contains(const vector<int>& v, int n)
{
// check if an integer is present in the vector
size_t floorIndex = 0;
size_t ceilingIndex = v.size();
while ( floorIndex < ceilingInde... |
1259760bcd0a1d8f160c6f7ceb5d0c2fa74f7795 | 95bb0d72ead195eb4ba69ed682fe74bd819a3a13 | theoad/dataStructures | /min_heap.hpp | C++ | hpp | 4,623 | no_license | //
// min_heap.hpp
// wet2
//
// Created by Théo Adraï on 08/06/2018.
// Copyright © 2018 Théo Adraï. All rights reserved.
//
#ifndef min_heap_hpp
#define min_heap_hpp
#include <stdio.h>
#include <new>
#include <cassert>
template <class T>
class Min_heap {
int _next_free_index;
int _array_size;
public... |
b05c0c5181e849220d3e2a962557d09208c8d2c1 | 2facf5048bdd714efd650fc061b3dfda2bbe8941 | nick625/Gamez_nicolas_csc5-_42829 | /homework/Assignment 7/Gaddis_8ThEd_chap8_prob3/main.cpp | C++ | cpp | 1,198 | no_license | /*
* File: Lottery Winners modifcation binary search
* Author: Nicolas gamez
* Created on May 25, 2016, 2:44 pM
*/
//system libraries
#include <iostream>
using namespace std;
//User Libraries
//Global Constants
const int SIZE =10;
//Function Prototypes
int BList (int[],int,int);
//Execution Begins Here
int ma... |
c2b3381fdf68e94ab0574854464e899888bff776 | 8269ed5275cfcb60c6c5d2f5083f9abbcfb22347 | luqun/LogDevice | /logdevice/server/read_path/LocalLogStoreReader.cpp | C++ | cpp | 19,823 | 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 "LocalLogStoreReader.h"
#include <algorithm>
#include <memory>
#include <fol... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.