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 |
|---|---|---|---|---|---|---|---|---|
777b08f0b28769637ef0011f74122c27a64f343b | 98e4e1cde0a02aee8b797dc68f74524f503c599c | sumanthreddy07/Competitive_Programming | /CPP/June_2021/week_4/CC_carnival_finale(bunch_of_coins).cpp | C++ | cpp | 1,481 | no_license | #include <bits/stdc++.h>
#define endln "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define run(i,a,b) for(long i=a;i<=b;i++)
#define revrun(i,a,b) for(long i=b;i>=a;i--)
#define display(A) for(auto x : A) cout<<x<<" "; cout<<"\n";
typedef long long ll;
typedef long l;
#define mod 1000000007
//#... |
08c2cb2de0a22aab1785a9acbb80c3ded0bceaa6 | 16879482f4a5f9cbfa26bc41a212e0ad920b0fa9 | zyb2017/Graphical | /Vulkan/PCSample1_1/BNVulkanEx/util/DrawableObjectCommon.cpp | C++ | cpp | 4,065 | no_license | #include "DrawableObjectCommon.h"
#include <assert.h>
#include "HelpFunction.h"
#include "MatrixState3D.h"
#include <string.h>
DrawableObjectCommonLight::DrawableObjectCommonLight(float* vdataIn, int dataByteCount, int vCountIn, VkDevice& device, VkPhysicalDeviceMemoryProperties& memoryroperties)
{
this->devicePointe... |
530e1546b7d578fc2dd76b1461628da65e7524bf | e20a93673d62296af3223f4637f6e5a55132f641 | AryaGosuDev/TornadoOGL | /TornadoOGL/TornadoOGL.cpp | C++ | cpp | 17,342 | no_license | // TornadoOGL.cpp
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include "Shaders.hpp"
#include "Texture.hpp"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#define GLM_ENABLE_EXPERIMENTAL
#define GLM_GTC_... |
b50a5fcca2bdf450c761356227ce7773213cf8d0 | a2db61086540fb808403040b9c6d626acb9fbe1e | vlenouvel/tower-defense-ecp | /src/elements/Batiments/TourDeGlace.cpp | C++ | cpp | 3,001 | no_license | /*
* TourDeGlace.cpp
*
* TowerDefense ECP
*
*/
#include "TourDeGlace.h"
#include <cmath>
#define PI 3.14159265
TourDeGlace::TourDeGlace(Coordonnees tCoord) : TourAttaque(tCoord), rayonExplosion(10) {
ConfigManager *configManager = ConfigManager::getInstance();
prix = configManager->mapTourD... |
e912fbc27c66a821998361dd010d7ab14258805d | 635bd002f65eaf1827fdc0dbe9e482a5712834f5 | rangora/Plat | /Source/Plat/WorldMap.cpp | C++ | cpp | 18,434 | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "WorldMap.h"
#include <random>
AWorldMap::AWorldMap() {
PrimaryActorTick.bCanEverTick = false;
CollisionMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Temp"));
ConstructorHelpers::FObjectFinder<UStaticMesh> MeshObj... |
5c29f4ab4ff76ce2572e3c5fe33e3740f51b5f57 | d39ba7308f86b5517a0dbdd4cc067846e9d3b320 | zcy05331/code-backup | /Codeforces/CF1468M.cpp | C++ | cpp | 3,379 | no_license | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/hash_policy.hpp>
#define R register
#define ll long long
#define pair std::pair<int, int>
#define mp(i, j) std::make_pair(i, j)
#define sum(a, b, mod) (((a) + (b)) % mod)
#define meow(cat...) fprintf(stderr, cat)
const int MaxN = 2e... |
6af399cfe9035123729caf1c3ecf2573c2fee7db | e06a9c03a4ad3e47cfe570647515d71edfbcebec | Pandinosaurus/ITK | /Modules/Registration/Common/test/RegistrationITKv3/ImageRegistration12.cxx | C++ | cxx | 12,968 | permissive | /*=========================================================================
*
* Copyright NumFOCUS
*
* 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.or... |
8e67d74e31581a2343ec34d559ed36c329c0a600 | fdbb0f5d99f1024f98fa2a5e0cc173e518d71e9d | skzr001/Leetcode | /163. Missing Ranges/lc163.cpp | C++ | cpp | 576 | no_license | class Solution {
public:
vector<string> findMissingRanges(vector<int>& nums, int lower, int upper) {
vector<string> res;
long long start=(long)lower;
for(int i=0;i<=nums.size();i++){
long long end=i<nums.size()&&nums[i]<=upper?(long)nums[i]:(long)upper+1;
if(start==en... |
59c6ecf37fa7e7e0f49a4c5cad2698cc59ef1ecd | ec140f80fc80d0a9c9bb13ed6e4f997d1ea97632 | raiseyang/leetcode | /11-container-with-most-water.cpp | C++ | cpp | 382 | no_license | class Solution
{
public:
int maxArea(vector<int>& height)
{
int max_area = 0;
int i = 0, j = height.size()-1;
while (i < j)
{
max_area = max(max_area, (j-i)*min(height[i], height[j]));
if (height[i] < height[j])
++i;
else
... |
1678657a483ecb25fbfb98e2d21eed069a1a4d58 | 71559ab587a4881b6b273e4b7ef43fd52fb4bfec | AITutorials/tensorflow | /tensorflow/lite/delegates/gpu/cl/kernels/conv_weights_converter.cc | C++ | cc | 6,217 | permissive | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
1dd30974f583077e51cc5badf157a68cdf3ab2cb | e3de061b6b5dbac020acd576925ffeb9dbf53283 | Orion545/OI-Record | /Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day1程序包/GD-Senior/answers/GD-0116/money/money.cpp | C++ | cpp | 1,209 | no_license | #include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<iostream>
#define N 1005
#define M 25005
using namespace std;
int a[N],b[N];
int t2[M];
int n,maxa,tot,ans,T;
bool key,key2;
bool cmp(int a,int b)
{
return a<b;
}
void dfs(int x,int y)
{
for (int i=1;i<=n;i++)
{
if (x==0) t2[y]=2,ke... |
3d704179f346991996bc065ce98080f8055341ab | f4e444e985e82041ec740410745602d7037a4c8a | suptaphilip/C-Plus-Plus-Object-Oriented | /5. Virtual Functions/1.Basic/4.HowVirtualWorks.cpp | C++ | cpp | 881 | permissive | #include <iostream>
using namespace std;
class Base
{
public: string GetMessage()
{
return "Base class function";
}
};
class Derived: public Base
{
public: string GetMessage()
{
return "Derived from Base class function - Derived level One";
}
};
class DoubleDerived: public Derived
{
public: string GetMe... |
c0cf42d90acfffedf5bf2383d93a0b08a941eba1 | 9e9ef91e6abc6639f18c751d1ed53c0c723d496c | boonkey/BattleShips | /BattleShips/BattleShips/Ship.cpp | C++ | cpp | 2,777 | no_license | #include "Board.h"
Ship::Ship(char t, DIRECTION direction):type(t),alive(true),dir(direction) {}
// returns true belongs to player A
bool Ship::isSideA() { return IsCharUpperA(type) != 0; }
void Ship::setDirection(DIRECTION direction) {
dir = direction;
}
DIRECTION Ship::getDirection() {
return dir;
... |
8d4866ab7ca588b3ed31e9bd32034910c0ebd79a | 9a1f2cbfb0ad7ef29ab074af4112e6e3a460b925 | MisterHLunaticwraith/MRH_FrameworkMission_TGV | /cfghpp/cfgsounds.hpp | C++ | hpp | 297 | no_license | //sounds[] = {briefing};
/*
//ci-dessous template à copier coller hors des commentaires
///
class NOM
{
name = "OST";
sound[] = {"\media\music\NOM.ogg", 5, 1, 100};
titles[] = {};
};
class NOM
{
name = "OST";
sound[] = {"\media\sounds\NOM.ogg", 5, 1, 100};
titles[] = {};
};
*/
|
f5416515215cbbd1347a12c706476b54bcaf075a | 2be06d4afaaedcf76de5c5389f91594653e35886 | doldre/ACM | /practice/NE/1004.cpp | C++ | cpp | 3,017 | no_license | /************************************************
*Author :mathon
*Email :luoxinchen96@gmail.com
*************************************************/
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <st... |
b1710c8aa92fbc51eaf985e5f9b3bc7f354999c8 | d2d98fb1490641947c46eb7c63f41830d585c905 | bino7/chromium | /chrome/renderer/net/net_error_helper.cc | C++ | cc | 14,247 | permissive | // Copyright (c) 2013 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/renderer/net/net_error_helper.h"
#include <memory>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "ba... |
6126e5966f127a0cbc0ecabddd4ae78669d08f00 | d3f36c00be900e81381608152252d110000423e5 | Stimels7/talkcoin-wallet | /src/test/key_tests.cpp | C++ | cpp | 5,203 | permissive | #include <boost/test/unit_test.hpp>
#include <string>
#include <vector>
#include "key.h"
#include "base58.h"
#include "uint256.h"
#include "util.h"
using namespace std;
static const string strSecret1 ("6uu5bsZLA2Lm6yCxgwxDxHyZmhYeqBMLQT83Fyq738YhYucQPQf");
static const string strSecret2 ("6vZDRwYgTNidWzmKs9... |
51192f7f0aec9cbccd374a5087838a5d24757d7e | e1ee0e87cea0dfdb8e567e4cd6726077abdf960d | nvcoin/nv | /src/kernel.cpp | C++ | cpp | 19,359 | permissive | /* @flow */
// Copyright (c) 2012-2013 The PPCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <boost/assign/list_of.hpp>
#include <boost/lexical_cast.hpp>
#include "db.h"
#include "kernel.h"
#include... |
d2db3d0d11c063d915052962d36a0578b642dbf4 | b3e4754f59f3b3b84e471c498281282b24836fa2 | jeanphilippeD/range | /test/algorithm_ext_test/push_back.cpp | C++ | cpp | 4,436 | no_license | // Boost.Range library
//
// Copyright Neil Groves 2010. 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)
//
//
// For more information, see http://www.boost.org/libs/range/
//
#... |
69309e9d906724572aebec98b52e51b1de02aba3 | 47c3dadde64d117aeb8784a02d82b08c51042873 | Mich121/Snake | /Snake/Snake.cpp | C++ | cpp | 1,701 | no_license | #include "Snake.h"
#include <chrono> // -> dzieki tym biblioteka mozemy uzyc funkcji sleep_for
#include <thread> // -> lepiej uzywac tej funkcji niz Sleep()
Snake::Snake() : coord({ 10,10 }), d(Direction::Start), lengthofsnake(1)
{
body.push_back(coord);
}
Snake::~Snake() {}
COORD Snake::GetCoord()
{
return coord;... |
9c5cbf97c7d78bccccec34498afabea97ec6f47e | 9479004043062ae8e388680fad54b6501354beb0 | doggycoder/Urho3D | /Source/Urho3D/AngelScript/IOAPI.cpp | C++ | cpp | 23,876 | permissive | //
// Copyright (c) 2008-2019 the Urho3D project.
//
// 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, mod... |
6ad79d922af94d504fc261ac756a45403d9f5051 | 69a2434561d8815356f1988fc84335b2a5278f32 | Tunixer/cuda-render | /saxpy/main.cpp | C++ | cpp | 1,604 | no_license | #include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <string>
void saxpyCuda(int N, float alpha, float* x, float* y, float* result);
void printCudaInfo();
void usage(const char* progname) {
printf("Usage: %s [options]\n", progname);
printf("Program Options:\n");
printf(" -n --arraysize <... |
1e2837d1bd6cb5856bf69e37f549ab493e717fbd | 2501543e9bc431f3261aa3c0cc66d3d3ec484b3f | Jayashrita/TS-TARGET | /TD_TS-target-plumed2.6.cpp | C++ | cpp | 18,149 | permissive | /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2016-2017 The ves-code team
(see the PEOPLE-VES file at the root of this folder for a list of names)
See http://www.ves-code.org for more information.
This file is part of ves-code, version 1.
ves-code is free s... |
af82b6d372827178f2e2b80ea06ac8013484c9e6 | 909956913f3ec6e9aa289b061349907e0ea80717 | ia-toki/tcframe | /include/tcframe/runner/verdict/SubtaskVerdict.hpp | C++ | hpp | 1,258 | permissive | #pragma once
#include <string>
#include <tuple>
#include <utility>
#include "Verdict.hpp"
#include "tcframe/util.hpp"
using std::move;
using std::tie;
namespace tcframe {
struct SubtaskVerdict {
private:
Verdict verdict_;
double points_;
public:
SubtaskVerdict()
: SubtaskVerdict(Verdict::a... |
c90a5090c3709fd6b0c5755f89119f3b335370d6 | e7cc02a0d1d883b510e60cae0cecae900c948a94 | PsyCommando/ppmdu_spriteeditor | /src/ppmdu/utils/algo.hpp | C++ | hpp | 2,032 | no_license | #ifndef ALGO_HPP
#define ALGO_HPP
/*
algo.hpp
2017/05/05
psycommando@gmail.com
Description: Misc algorithms.
*/
namespace utils
{
/************************************************************************************
ExponentOfTwo
Calculate exponents of 2 at compile time! (c++14)
**********... |
2714b03c8703bb4efe380e6aa83bcad7a0a9bda8 | 79d4d246672c8d830428b0b90cb3712deb5daae8 | ashwin1104/Space-Wars | /src/Player.cpp | C++ | cpp | 1,657 | no_license | #include "Player.hpp"
// sets initial position to (0,0)
// sets width and height based on passed image of player
// initializes starting lives to 3
// initializes shooting interval between lasers
// marks start time for shooting
// initializes pixels moved by each key press (speed)
void Player::setup(ofImage player_im... |
fab78e127a98138865043b50af5a27906994da1a | 5e39ad81de4f6be8ba5a61c72c37f1f9a6a1cc5a | pmsuder/Sorting-Algorithms-Implementations-and-Performance-Analysis | /Sorting Performance Analysis/Sorting Performance Analysis/Sorting.cpp | C++ | cpp | 3,636 | no_license | #include "Sorting.h"
void InsertionSort(vector<int> *Array)
{
//int sortedEdge = 0; //index of the last element in the sorted region
for (unsigned int i = 1; i < Array->size(); i++)
{
int entry = Array->at(i);
int j = i - 1;
while (j >= 0)
{
if (entry > Array->at(j))
{
break;
... |
c26fbd6bbd5f4834dd1588d792d6c57e46bb8a65 | e64eda5ee165829e2eaa1f5ed44c7110338b921c | wangyun123/Learn | /LearnQt/multiThread/MyMutex/ThreadA.cpp | C++ | cpp | 265 | no_license | #include "ThreadA.h"
#include <QDebug>
ThreadA::ThreadA(QObject *parent) :
QThread(parent)
{
}
void ThreadA::run()
{
for(int i=0; i<5; i++)
{
mutex.lock();
qDebug() << "ThreadA" << i;
sleep(1);
mutex.unlock();
}
}
|
3106f6a52ea7d54149fc253ecd68d04911a817ec | fd4ded4f39a8104a1ccb4cf53ba7b8c3df54e890 | yongjianmu/leetcode | /second/23_Merge_k_Sorted_List/main_bak.cpp | C++ | cpp | 1,735 | no_license | #include "../include/header.h"
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class mycomparison
{
public:
bool operator() (const ListNode* lhs, ListNode* rhs) const
{
return (lhs->val <= rhs->val);
}
};
class Solution {
public:
typedef prior... |
67c14ed26aecc6b7ce35e97ce0fc6615e7275558 | 679580ee2f1be5406771d17e7dc33c2c70849473 | grodansparadis/swifitch-software | /lib/WiFiManager/WiFiManager.cpp | C++ | cpp | 21,335 | no_license | /**************************************************************
WiFiManager is a library for the ESP8266/Arduino platform
(https://github.com/esp8266/Arduino) to enable easy
configuration and reconfiguration of WiFi credentials using a Captive Portal
inspired by:
http://www.esp8266.com/viewtopic.php?f=29... |
77d1d619ae696595c6a546c9fe02798e40cf395a | f66343f31ab0d62d39d40d1d4d621a5296e41a0f | bino7/chromium | /content/renderer/media/video_track_recorder.cc | C++ | cc | 46,502 | permissive | // Copyright 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 "content/renderer/media/video_track_recorder.h"
#include <utility>
#include "base/bind.h"
#include "base/logging.h"
#include "base/macros.h"
#i... |
84a625e7fe84e406897472b4a2ac5371148dd88f | 8eae608eb7e3946834872280ef5cda4dc90cf30c | tomazos/spk | /loader.cc | C++ | cc | 3,312 | no_license | #include "loader.h"
#include <SDL2/SDL_vulkan.h>
#include <dlfcn.h>
#include <memory>
#include "dvc/log.h"
namespace spk {
instance::instance(spk::instance_ref handle, const spk::loader& loader,
spk::allocation_callbacks const* allocation_callbacks)
: handle_(handle),
dispatch_table_(
... |
d42047cf48f2f92fc148e32d8b6d5edc1efefbf1 | 74f4cc10023e83f58f1effa24021db59324c2099 | pKrumov/SoftUni-C-PB | /2.3.exc 2D Rectangle Area.cpp | C++ | cpp | 369 | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main(){
double x1,x2,y1,y2;
cin >> x1 >> y1 >> x2 >> y2;
double lenght = abs(x1 - x2);
double height = abs(y2 - y1);
cout.setf(ios::fixed);
cout.precision(2);
cout << lenght * height << endl;
cout << (leng... |
91519da8435ec0874deae9d834fed1410fcd2164 | 605af3008cc95d6627d94bc9def50666f971d95a | Darkatomz/c-programing | /tictactoegamelogic.cpp | C++ | cpp | 4,065 | no_license | #include"GameLogic.h"
/*TODO LIST
>> Stop players to not overwrite each others position
>> Allow players to choose how many round they want
>> Play against AI(<<)
*/
void Tictactoe::ShowCurrentBoard() {
for (int x{ 0 }; x < 3; x++) {
for (int y{ 0 }; y < 3; y++) {
std::cout << gameboard[x][y]<<"\t|";
if (y ... |
636921f7057f4441b319008f52657babf15e84ed | e201906c4809cd31f464a4380c27c42b29f2d076 | covarell/usercode | /src/GeneratorInterface/EvtGenInterface/test/FindEvtGenParts.cc | C++ | cc | 2,292 | no_license | #include <memory>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include <fstream.h>
#include <iostream.h>
#inc... |
98b6d6c9acc52a10936878382dd42f45626b33ac | 495354b0a37e3c0b4146ae50b62e72463a726042 | lij-oci/rmw_opendds | /rmw_opendds_cpp/src/rmw_node.cpp | C++ | cpp | 2,282 | permissive | // Copyright 2014-2017 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ... |
cfe9c3aed70bee74bd9f6a84e43881bb65baee36 | 3fdf76a08b14cd9a2107ba624c40c77a52353986 | rockandsalt/ITK | /Modules/IO/ImageBase/src/itkImageIOFactory.cxx | C++ | cxx | 1,844 | permissive | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
480eb433039f1a700655314e7cb58b054ee2ee0e | 09c24915fdd3bbd6720c0043f111c4be595d49a0 | chadrockey/chromium | /chrome/browser/extensions/updater/extension_updater_unittest.cc | C++ | cc | 63,675 | permissive | // Copyright (c) 2012 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 <list>
#include <map>
#include <set>
#include <vector>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
... |
be5190d7f6568cdc5bcb654e7f614e496115a013 | 5af9db747cf311915e17211b7ae1c88c86b73d71 | SaqlainAveiro/Competitive-Programming-Solves | /CodeForces/Chunga-Changa.cpp | C++ | cpp | 500 | no_license | #include<bits/stdc++.h>
using namespace std;
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Ouput.txt","w",stdout)
#define Pi 2*acos(0.0)
typedef long long int lli;
lli i,j,k,l,m,n,t,a,b,c,d,x,y,p,q,s,r,f,sum=0,total=0;
int main()
{
ios_base :: sync_with_stdio(false);... |
134efc83b65fd828b5c4da6eb3f5882c5f49c802 | 845c1a76b68af25092b8ea89edc4cd9708268659 | CadQuery/pywrap | /opencascade/Geom_Ellipse.hxx | C++ | hxx | 9,345 | permissive | // Created on: 1993-03-10
// Created by: JCV
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser Gen... |
843887d6bfd6c9065318bf177e5aadb4d40ab74e | 063c73261a4dbd3e4569a6c6d878ce334d804741 | NynkeDekkerLab/qtrk | /cputrack/BeadFinder.cpp | C++ | cpp | 5,942 | no_license | #include "std_incl.h"
#include "utils.h"
#include "kissfft.h"
#include <list>
#include "threads.h"
#include <functional>
#include "BeadFinder.h"
using namespace BeadFinder;
int NextPowerOf2(int x)
{
int y=1;
while (y<x)
y*=2;
return y;
}
float abs(std::complex<float> x) { return sqrtf(x.imag()*x.imag()+x.real()... |
f55a4f57ac53692b19eb35173081e7f2553c1682 | ba097942d8f3677bb6e631ac1243215045c3e764 | Fdzjrqlw/CodeForcesTraining | /bitmask/484A.cpp | C++ | cpp | 1,287 | no_license |
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std ;
int seq1[65] , seq2[65] ;
long long two[65] ;
int n ;
long long solve(long long l , long long r){
if(l == r)
return l ;
int l1 = 0 , l2 = 0 ;
memset(seq1 , 0 , sizeof(seq1)) ;
memset(seq2 , 0 ... |
7296abf7aab7e189d6f22056a70e1ff9f15841a8 | 755307c4253ed5b435de020cddbfcdf23e6feefe | ZhanLongqi/GAMES102 | /homeworks/project/src/hw4/Systems/CanvasSystem.cpp | C++ | cpp | 10,691 | no_license | #include "CanvasSystem.h"
#include "../Components/CanvasData.h"
#include <_deps/imgui/imgui.h>
#include"mylib.h"
using namespace Ubpa;
void CanvasSystem::OnUpdate(Ubpa::UECS::Schedule& schedule) {
schedule.RegisterCommand([](Ubpa::UECS::World* w) {
auto data = w->entityMngr.GetSingleton<CanvasData>();
if (!dat... |
670a22b3e61a6e2d5a176bbfaa6e4dfee2ded2fc | af171b5e9c7de59affdc867411da2208a2521cfe | NicholasWon47/xtensor | /test/test_xsort.cpp | C++ | cpp | 7,861 | permissive | /****************************************************************************
* Copyright (c) 2016, Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* ... |
8020de06f035332a8d066764ece5ac9b60bd3640 | 9a08619157ace0a6474ef6c1eac3c984d6ee2d83 | usman-kakakhel/Sorting | /main.cpp | C++ | cpp | 894 | no_license | /* *
* Title : Algorithm Efficiency and Sorting
* Author : Main Usman Naeem Kakakhel
* Description : All sorting functions are being called
*/
#include "sorting.h"
int main()
{
int lista[] = {7, 3, 6, 12, 13, 4, 1, 9, 15, 0, 11, 14, 2, 8, 10, 5};
int listb[] = {7, 3, 6, 12, 13, 4, 1, 9, 15, 0, 11, 14, 2, 8... |
c0a05b5c52a7fc12a786677ff1d5a0dcb429374d | 3db0b9431641620a85bbd27f15add65010af2f6a | gunishmatta/Daily-Programming-Practice | /Basics and Implementations/Linked Lists/SinglyLinkedList/Search_LinkedList.cpp | C++ | cpp | 968 | no_license | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node(int d)
{
data = d;
next = NULL;
}
};
void insertAtHead(Node *&head,int data)
{
if (head==NULL) {
head = new Node(data);
return;
}
Node *node = new Node(data);
node->next = head; //point the next of new node to hea... |
7f79c30ad008600607fd1ebaad287e3f0cb34483 | 2666a27c4acbdbbf352ca530f63061621987e6c7 | dizhenhuoshan/C-plus-plus-template | /segtree.cpp | C++ | cpp | 2,308 | no_license | //SJTU OJ 4117
#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
const int maxn = 100005;
long long sum[maxn<<2];
long long add[maxn<<2];
long long A[maxn];
int N;
void pushup(int rt)
{
sum[rt] = sum[rt<<1] + sum[rt<<1|1];
}
void buildtree(int l ,int r, int rt)
{
... |
c46242a4c30f9888c0f1b888b8ab7c0b50584224 | 7462f38f33a54ec0d6e23883707119197442d217 | AhmedElMetwally/problem-solving | /leetcode/minimum_time_visiting_all_points.cpp | C++ | cpp | 548 | no_license | //
// Link: https://leetcode.com/problems/minimum-time-visiting-all-points
//
//
// Solution 1
//
class Solution
{
public:
int minTimeToVisitAllPoints(vector<vector<int>> &points)
{
int result = 0;
int len = points.size();
for (int i = 0; i < len - 1; i++)
{
int x1 ... |
4e9e323dff9c4507ffb21f7bfa2a1cbaddf30968 | 166559ebf8c70d761bc64b6ca892670d1e5be726 | PygMali0n/CS225_Fall2019 | /lab/lab_dict/fib.cpp | C++ | cpp | 1,072 | no_license | /**
* @file fib.cpp
* Contains Fibonacci-number generating functions both utilizing and not
* utilizing memoization.
*
* @author Matt Joras
* @date Winter 2013
*/
#include "fib.h"
#include <map>
using std::map;
/**
* Calculates the nth Fibonacci number where the zeroth is defined to be
* 0.
* @param n Whi... |
2475be1439c350006d97ce33d7e5bd66e3fe5d5a | 3995891bd27dc2b63e8e08314a74237977e652b5 | mausimus/ags | /Engine/platform/windows/acplwin.cpp | C++ | cpp | 27,816 | permissive | //=============================================================================
//
// Adventure Game Studio (AGS)
//
// Copyright (C) 1999-2011 Chris Jones and 2011-20xx others
// The full list of copyright holders can be found in the Copyright.txt
// file, which is part of this source code distribution.
//
// The AGS ... |
a7a1c3c23f4d05b9606c788bd000c7bbb19576c6 | 580cc10f8d106c5018e0aa45308da141a48bcffc | argrig/ag | /alg/china/china_old_gen.cpp | C++ | cpp | 2,321 | no_license | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <queue>
#include <stack>
#include <cstdio>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b){
if(b == 0){
return (a);
}
return gcd(b, a % b);
}
ll Euclid (ll a,ll b,ll &x,ll &y) {
if (a == 0) {
x... |
985eb05bf8a2ecf233e536c07424d63d2502bc97 | b7b049154eddaacf9a5a6388b553afb778fd2e0a | Hutschi/qlcplus | /qmlui/virtualconsole/vcclock.cpp | C++ | cpp | 14,299 | permissive | /*
Q Light Controller Plus
vcclock.cpp
Copyright (c) Massimo Callegari
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.txt
Unless re... |
2d0cb1d608664d028b5f00072d3ff2a9baf566e6 | 5c9fe604d0757d3d34e0a59cd7358092f51b42ea | ivaibhavjindal/data-structures-and-algorithms | /cses/introductory_problems/palindrome_reorder.cpp | C++ | cpp | 973 | no_license | #include <bits/stdc++.h>
typedef long long ll;
#define endl "\n";
using namespace std;
int main() {
int arr[26] = {0};
string s;
cin >> s;
for(auto x: s)
arr[x-'A']++;
int odd = 0, odd_index = -1;
for(int i = 0; i < 26; i++) {
if(arr[i]) {
if(arr[i] & 1) {
... |
96fe5df2e0be3d605a2fbaa7eb67d87d8a01cacd | 558f11ae06ee7b2e3cb13e15413cfcbc6d1686d0 | Zaplatynskyi/Execution-Manager | /test/mocks/include/server_socket_mock.hpp | C++ | hpp | 841 | no_license | #ifndef SERVER_SOCKET_MOCK_HPP
#define SERVER_SOCKET_MOCK_HPP
#include <i_server_socket.hpp>
#include "gmock/gmock.h"
using namespace api;
class IServerSocketMock : public IServerSocket {
public:
MOCK_METHOD(int, socket, (int domain, int type, int protocol),
(const, override));
MOCK_METHOD(... |
c5cafbf4c5af666addc67b2f411a4def63ed92a3 | 4dd5128356b5eb76e3d6fd871328fbb3b719e6f4 | radtek/QLLanguage | /SQLComponents/SQLVariantOperatorMod.cpp | C++ | cpp | 48,581 | permissive | ////////////////////////////////////////////////////////////////////////
//
// File: SQLVariantOperatorMod.cpp
//
// Copyright (c) 1998-2017 ir. W.E. Huisman
// All rights reserved
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files ... |
4b85ea9091d7ded2b469baeb876fe8a10d59379f | b925d9e3c85bffc27e2f5a1bf397dcda2f0b9442 | wenge8126/MemoryDB | /BaseCommon/NetDll/Net/ServerIPInfo.cpp | C++ | cpp | 2,510 | no_license | #include "ServerIPInfo.h"
#define _USE_SOCKET_API_ 1
#ifdef __LINUX__
# include <netdb.h>
# include <arpa/inet.h>
#else
# include "winsock2.h"
#endif
AString ServerIPInfo::Num2IP(UInt64 scrNum, int &port, int &gsPort)
{
#if _USE_SOCKET_API_
in_addr scr;
scr.S_un.S_addr = (scrNum>>32) & 0xFFFFFFFF;
AString re... |
1ce2e3b74c4a7919d88cfcadb248dc0639982cac | 142ddcefff0bfc6e7679c86793adff19dd70ed32 | 2012ankitkmr/My-works | /Practice Codes/Even Odds.cpp | C++ | cpp | 214 | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,mid,k;
cin>>n>>k;
mid = (n+1)>>1;
if(k<=mid)
printf("%lld\n",1+(k-1)*2);
else
printf("%lld\n",2+(k-mid-1)*2);
return 0;
}
|
b320f13e72876fcca9f9e1fb19262008842075b4 | 9e4bca560ab9db11b09d19dd6643ca2f6c12abfc | zhangf911/neu | /src/lib/core/NThread.cpp | C++ | cpp | 2,334 | permissive | /*
___ ___ ___
/\__\ /\ \ /\__\
/::| | /::\ \ /:/ /
/:|:| | /:/\:\ \ /:/ /
/:/|:| |__ /::\~\:\ \ /:/ / ___
/:/ |:| /\__\ /:/\:\ \:\__\ /:/__/ /\__\
\/__|:|/:/ / \:\~\:\ \/__/ \:\ \ /:/ /
|:/:/ / \:\ \:\__\ \:\ ... |
931b711457bd2d8179f98e40eed1111eec65e109 | 21943adccba33bea9469d95303c4f4e6bd06b493 | Tekh-ops/checkedc-clang | /clang/lib/CodeGen/CGDecl.cpp | C++ | cpp | 100,363 | permissive | //===--- CGDecl.cpp - Emit LLVM Code for declarations ---------------------===//
//
// 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
//
//===---------------------------... |
b3677aebe53595429ecaac25c14b46f4fd7f432b | 12ece8317d9ad90626717bee81b55505838cafb0 | CSE3320/Arlington-Transit-Assignment | /src/Station.cpp | C++ | cpp | 215 | permissive | #include "Station.h"
Station::Station( StationName id ): id_(id)
{
};
std::ostream & operator << ( std::ostream & output, const StationName & station )
{
output << StationToString[station];
return output;
}
|
e12be7cbd2fe67576e14910fc19020de422cccbd | e37f9bf9a8ce09d9f76b48f69d677340e1ea4b87 | ZVasilii/mipt-mips | /simulator/infra/t/unit_test.cpp | C++ | cpp | 7,153 | permissive | /**
* macro_test.cpp - testing of useful inline functions
*
* @author Pavel Kryukov <pavel.kryukov@phystech.edu>
* Copyright 2017-2018 MIPT-MIPS
*/
#include <catch.hpp>
#include <infra/argv.h>
#include <infra/endian.h>
#include <infra/exception.h>
#include <infra/log.h>
#include <infra/macro.h>
#include <infra/t... |
c2a3cc2ad9d26d4e424abdde43e4cf87e44d311e | ca7de71b3e3da336f38f38c3ae7a50922453742e | niuxu18/logTracker-old | /second/download/CMake/CMake-old-new/CMake-old-new/Kitware_CMake_patch_545.cpp | C++ | cpp | 33,990 | no_license | @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as descri... |
b2131091ac195a910d0db4ac29669606b5e860e3 | a2f97b72d9c7473bbe254699f265c592dfb2ddc4 | alreadytaikeune/competitiveprog | /codeforces/1354_B.cc | C++ | cc | 3,693 | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <t... |
31be2f37ae19bc726ab8da55d4d986f1a2f77489 | aa3067d871d653ce891cfd4dad56e2deee7e65e4 | d-pettersson/Principles | /Chapter_4/Exercices/4.19/main.cpp | C++ | cpp | 922 | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
vector<string> names;
vector<string> unsortedNames;
vector<string> ages;
cout << "Please type in a name and an age: ";
// push to vector names and ages at the same time
for (string name, age; cin >> na... |
9ca7246a1f25b79008e4c9712969b4e48f8246da | 785659e22298bf5d996b733bea0505feb662a4f2 | LwandaMagere/Web-Development | /playground/StephenPrata/instr3.cpp | C++ | cpp | 462 | no_license | // instr3.cpp -- reading more than one word with get() & get()
#include <iostream>
int main()
{
using namespace std;
const int ArSize = 20;
char name[ArSize];
char dessert[ArSize];
cout << "Enter your name:\n";
cin.get(name, ArSize).get();
cout << "Enter your favorite dessert:\n";
cin.g... |
14b7fee0d989ad7d7bcdc5857dea47801968c9f1 | fdb30cd7c37d761fa060cb08f518a01d0fa96a83 | alvas/ms_interview_100 | /exec1.cpp | C++ | cpp | 9,897 | no_license | #include <iostream>
#include <stack>
#include <queue>
using namespace std;
struct BSTreeNode
{
int m_nValue;
BSTreeNode *m_pLeft;
BSTreeNode *m_pRight;
};
/* BST
*
* 10
* / \
* 6 14
* / \ / \
* 4 8 12 16
*
*/
static int num[7] ... |
a275ff78286ead6b0669279a923a7e856834cf39 | 8db4b5f0c8f82bc975a90a817ef8a2728f2fdb07 | tlsloves/D3D8Keyol | /D3D8Keyol/hook.cpp | C++ | cpp | 3,603 | no_license | #include<Windows.h>
#include<d3d8.h>
#include"..\minhook\include\MinHook.h"
#pragma comment(lib,"d3d8.lib")
#include"custom_present.h"
typedef HRESULT(WINAPI* PFIDirect3DDevice8_Present)(LPDIRECT3DDEVICE8, LPCRECT, LPCRECT,HWND,const RGNDATA*);
static PFIDirect3DDevice8_Present pfPresent = nullptr, pfOriginalPresent ... |
74a47a18c22cfe2768c6304c501acf9491209d52 | 11a22e827384016209819d4b3cb8a24e2cf3f76a | Jos3f/AI-Labs | /lab1/CLevel.cpp | C++ | cpp | 9,791 | no_license | #include <cstddef>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <iterator>
class Matris {
public:
// constructors
Matris(){
m_rows = 0;
m_cols = 0;
m_capacity = 0;
m_vec = new double[0];
}
Matris(int x, int y){
m_rows = y;
m_cols = x;
m_... |
019eb259ca0ac42451c6cb4b8ce868333a299d62 | 26b98a7926e215248856153f21c78724427fe1aa | novaquark/aws-sdk-cpp | /aws-cpp-sdk-devicefarm/source/model/GetTestResult.cpp | C++ | cpp | 1,346 | permissive | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" fil... |
012b919e010795d95a07ff227c299089d3b2935a | a99b0e411cf8a253bb47554b28470f48448abd1c | WeikangChen/algorithm | /test/inline_b.cpp | C++ | cpp | 464 | no_license | #include "inline_b.hpp"
int b()
{
auto ret1 = static_sum(1, 2);
printf("b() static: sum=%d addr=%p int=%p\n",
ret1, &static_sum, &static_sum);
auto ret2 = constexpr_sum(1, 2);
printf("b() cntexp: sum=%d addr=%p int=%p\n",
ret2, &constexpr_sum, &constexpr_int);
auto ret3 = in... |
cbdd9891bc5a1979cf2c8c122f08857dc0f839c0 | 846a82b39212b774a192dda749e2cacc9dc12d99 | fredwbacon/OpenVSP | /src/vsp_graphic/src/Lighting.cpp | C++ | cpp | 3,936 | permissive | #include <assert.h>
#include "OpenGLHeaders.h"
#include "Lighting.h"
namespace VSPGraphic
{
LightSource::LightSource( unsigned int id )
{
_id = id;
_enabled = false;
_pos[0] = 0;
_pos[1] = 0;
_pos[2] = 1;
_pos[3] = 0;
_amb[0] = 0;
_amb[1] = 0;
_amb[2] = 0;
_amb[3] = 1;
i... |
24c639c0542d30c4ba5bafe9323bc7895012014e | a425ec1f202694f3efdf0cf69dd904503a98b9c2 | namanworld/Codechef-Solutions-Competitive-Programming | /Compilers and parsers (COMPILER).cpp | C++ | cpp | 842 | no_license | #include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;
int validLength(string s){
stack<char> st;
int counter = 0, temp_counter = 0;
for(int i=0; i<s.length(); i++){
if(s[i]=='<') st.push(s[i]);
else{
if(st.empty()) {
break... |
d9743dfba099412eba9bda06025a2bf8de60436f | 4ce6b1cc6dcdddcd5fb8ada7a8b089d688617951 | BerntA/tfo-code | /game/client/c_effects.cpp | C++ | cpp | 65,381 | permissive | //========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//
//=============================================================================//
#include "cbase.h"
#include "c_tracer.h"
#include "view.h"
#include "initializer.h"
#include "particles_simple.h"
#includ... |
741da0a4aae94d82aab91614ac7591286f8e3235 | ca6316e57682af9b2eab78090703ee1db5daa525 | pehlivanian/OrderedPartitions | /graph.cpp | C++ | cpp | 8,556 | no_license | #include <list>
#include <vector>
#include <algorithm>
#include <iterator>
#include <numeric>
#include <limits>
#include <iostream>
#include "graph.hpp"
template<typename T>
class TD;
float
PartitionGraph::compute_weight(int i, int j) {
float weight = -1. * std::pow(std::accumulate(a_.begin()+i, a_.begin()+j, 0.),... |
a7484e2da503d8029a71ce0c97d0bfffe6a329a0 | a6273abd555ab91ae0524522ed03bb78b69872ed | kimdy003/AlgorithmStudy | /Beakjoon/1_Gold/17406_배열_돌리기4_G4.cpp | C++ | cpp | 2,874 | no_license | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int n, m, k, ans = 987654321;
int map[51][51] = {0};
vector<pair<pair<int, int>, int>> cycle;
bool check[6];
pair<int, int> movdir[4] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
void all_print(){
cout << "\n";
for(int i=1; i<=n; i++){
... |
8ee77233e61d88e3e0b18fe907d8825ee8c0dd2b | de2ff6f02bee36d7f77235e7f259188c23fcd28c | meteor-technology/cobalt | /src/starboard/shared/linux/page_internal.cc | C++ | cc | 4,079 | permissive | // Copyright 2016 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by ap... |
0952ccb78fa43c25a3f7f2aab0ab30f0ff2d123e | 80b40f87c3d869fa684421e0bf98f6f2abc5b65c | ssln2014/chromium | /third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge_test.cc | C++ | cc | 56,629 | permissive | /*
* Copyright (C) 2011 Google 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 condition... |
0bffd8978d957a2540daf25a99daacbff26216fc | 88759bb67038bb70a7e18f5d7a59f0acb9662654 | firiexp/contest_log | /yukicoder/72.cpp | C++ | cpp | 490 | no_license | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
static const int MOD = 1000007;
using ll = int64_t;
using u32 = uint32_t;
using namespace std;
template<class T> constexpr T INF = ::numeric_l... |
0850adc7619481a2de4598286930f898d88a6409 | e7ad3a246a90701e1f29ae175fc28d955ca6c0ae | BrendanTurner/University-Projects | /Year 1 Games Programming/Frogger assignment C++/Frogger for vs 15/SFML Template/frog.cpp | C++ | cpp | 4,690 | no_license | #include "frog.h"
#include<iostream>
#include<SFML/Graphics.hpp>
using namespace std;
frog::frog()
{
//load the following 4 sprite sheets into its own frogSprite variable
frogSprite.loadFromFile("assets/texture/frogSprite.png");
frogSprite3Leg.loadFromFile("assets/texture/frogSprite3Legs.png");
frogSprite2Leg.l... |
61254f24a4e82cf419602fad9b1b09290983af8a | e289b72385e53b0b4706b9744cca29b55d175181 | hirasawak1/kotonarinojikan | /EDX/EDX_Input.cpp | C++ | cpp | 556 | no_license | #include "../IEX/iextreme.h"
#include "EDXLIB.h"
int EDX::EDX_Input::Click[2];
int EDX::MouseGet(int butontype){
return EDX::EDX_Input::GetClickModule(butontype);
}
BOOL EDX::EDX_Input::GetState(){
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000)Click[EDX_CLICK_L]++;
else Click[EDX_CLICK_L] = 0;
if (GetAsyncKeyState(... |
b75c1e51b3cefa3f20261807f0fc80d41414690d | ab9b9c52d94c5e100fe2caad138a9d13f99d61a5 | longestline/grandmastercoin | /src/test/checkblock_tests.cpp | C++ | cpp | 1,908 | permissive | // Copyright (c) 2013-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 "clientversion.h"
#include "consensus/validation.h"
#include "validation.h" // For CheckBlock
#include "primitives/b... |
d97006295b651f974cc5496ccc4724a3aa6a1ff8 | e00ebb218f990d53641705328986943f6d1baae7 | zloboglas/Tver-State-University-projects | /random phrase generator/main.cpp | C++ | cpp | 1,084 | no_license | #include <iostream>
#include <ctime>
#include <clocale>
using namespace std;
const int N = 5, M = 6;
int main() {
setlocale(LC_ALL, "rus");
srand(time(0));
char* array[N][M] = { { "метафизическая ", "", "", "мёртвая ", "", ""},
{"русалка ", "кошкотянка ", "мышка норушка ", "соечка ", "картонная невеста ", "принц... |
c74f49947248a2d10c3ba73fb58a7f940e2ff906 | d235ce20940821303d0ea2669806245ffd2a02fe | madingx/leetcode-cpp | /algorithms/cpp/rangeSumQuery-Immutable/rangeSumQuery-Immutable.cpp | C++ | cpp | 1,560 | no_license | // Source : https://leetcode.com/problems/range-sum-query-immutable/
// Author : Calinescu Valentin, Hao Chen
// Date : 2015-11-10
/***************************************************************************************
*
* Given an integer array nums, find the sum of the elements between indices i and j
* (i ≤ ... |
7490739eb648b9b5005ac33f26af180c25b8658b | ccfcfd72a1729f695bb51ed56d7af09e91354e69 | codeAligned/Competitive-Programming-8 | /USACO/Section 3/3.1/inflate.cpp | C++ | cpp | 642 | no_license | /*
ID: liaojh11
PROG: inflate
LANG: C++
*/
//Title: inflate
//Type: DP
//Solution: Knapsack Algorithms for the win.
#include <stdio.h>
FILE *fin, *fout;
int M, N, s, t, dp[10001] = {0};
int main(){
//Instantiation
fin = fopen("inflate.in", "r");
fout = fopen("inflate.out", "w");
fscanf(fin, "%d %d", &M, &N);
//Kna... |
a996040a0ed7b5a195b7f4ce2572ed4513d0df10 | cb8a389168114c25ab4921d7b5846237aa552b2c | skn123/stats | /include/stats_incl/prob/pnorm.hpp | C++ | hpp | 5,958 | permissive | /*################################################################################
##
## Copyright (C) 2011-2023 Keith O'Hara
##
## This file is part of the StatsLib C++ library.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance... |
b91789dfd51f21af2d67514ae5d69cfa1c6a9ed1 | 8e2b56cd57d290cc2b86483f9a055579b034e47b | alexyarikov/SimplePaint | /SimplePaint/SimplePaintViewTest.cpp | C++ | cpp | 9,436 | no_license | #include "stdafx.h"
#include "SimplePaintViewTest.h"
namespace SimplePaint
{
// test drawing rectangle
void SimplePaintViewTest::testDrawRectangle()
{
testDrawShapeFigure<QGraphicsRectItem>(FigureType::Rectangle, Qt::blue, QRect(100, 100, 300, 300));
}
// test drawing ellipse
void Simp... |
4016578a900fc2af6270ac854665f346e9746603 | f5d9d5622087528f32fed825e9b85d79f6e6dd2d | efocht/gen-dnn | /src/vanilla/gemm_convolution.hpp | C++ | hpp | 17,333 | permissive | /*******************************************************************************
* Copyright 2016-2017 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... |
0da613760f225e068c581fa64174e0c832b0912a | e54cd49ea7732815b8bcf163759c6d938ef86346 | ugozapad/deusexmachina | /DEM/Game/src/SI/SIGameServer.cpp | C++ | cpp | 1,785 | permissive | #include <Scripting/ScriptServer.h>
#include <Game/GameServer.h>
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
};
// Script Interface for the game server
namespace SI
{
int CGameServer_SetGlobal(lua_State* l)
{
// Args: Name, Value
int ArgCount = lua_gettop(l);
if (ArgCount < 2 || !... |
d514fb224c225d609c24f318811344cea3ef9fb7 | 46b154770bc009bc105fd919a3e3c4fdc79b4465 | mlange05/atlas | /src/atlas/mesh/Mesh.cc | C++ | cc | 985 | permissive | /*
* (C) Copyright 2013 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 intergo... |
0505784c934b05e294a3faae6c0163e733a5ec99 | b6bb83b2777ca976178ea3d2922a205a50e85ce0 | drewbebrah/gcd-of-two-numbers | /10685703.cc | C++ | cc | 506 | no_license | //
// main.cpp
// Assignment 4
//
// Created by Andrew Debrah on 12/09/2018.
// Copyright © 2018 Andrew Debrah. All rights reserved.
//
#include <iostream>
using namespace std;
int gcd(int n1, int n2);
int main()
{
int n1, n2;
cout <<"Enter two positive integers:";
cin>> n1 >> n2;
cout ... |
6c85fbdc59e6f4d6309215089b97c9c3c05e2f5f | f1a0195fce7f3a0ba7c2ce32c622b3ed2e46bcfe | ejaffe1/CollegeCourseWork | /ObjectOrientedClass/smoothieInheritance.cpp | C++ | cpp | 5,241 | no_license | /*
Base Class: drink
Derived Class: Smoothie
The base class is a general template for any type of drink. The smoothie class
inherits the drink class and then provides a template for any type of smoothie.
This is demonstrating the idea of inheritance because the smoothie class uses all the
essential parts of the drink ... |
46142c100fa71f66520ae3206e9f2fa17bcdb16c | 9c36d508d0d2cb41aceb4ff292d15327e472e4c6 | ytw0728/BOJ | /1076.cpp | C++ | cpp | 942 | no_license | #include <stdio.h>
#include <string>
#include <iostream>
#include <map>
#include <algorithm>
#include <math.h>
using namespace std;
map<string, int > arr;
int main() {
arr.insert(map<string, int >::value_type("black", 0));
arr.insert(map<string, int >::value_type("brown", 1));
arr.insert(map<string, int >::value... |
b88bcefd6a06449d36318ca0d701d7cd51cf9ff3 | 18c5ed5229d14a909dcf9d132210223f97279587 | blockspacer/cmakesl | /source/sema/types_context.hpp | C++ | hpp | 2,357 | permissive | #pragma once
#include "sema/qualified_entries_finder.hpp"
#include <ast/type_representation.hpp>
#include <memory>
namespace cmsl {
namespace errors {
class errors_observer;
}
namespace sema {
class qualified_contexts_dumper;
class sema_type;
struct type_data
{
const sema_type& ty;
};
class types_context
{
publ... |
21ef46f5e2a9de979d936bdd622fab14849d734b | c6ab0f0044a85120c1213c01c51ae8ec38ca64cd | fubyo/osccalibrator | /juce/extras/Jucer (experimental)/Source/Utility/jucer_MiscUtilities.cpp | C++ | cpp | 14,139 | no_license | /*
==============================================================================
This file is part of the JUCE library - "Jules' Utility Class Extensions"
Copyright 2004-10 by Raw Material Software Ltd.
------------------------------------------------------------------------------
JUCE can be redistrib... |
0b19e794d68a7e5764a3def148e15b293b591903 | d2ca3587b8c774e956bf4aaea40ca0e867a02ac6 | viettrungluu-cr/icl | /icl/operators.cc | C++ | cc | 28,002 | permissive | // Copyright (c) 2013 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 "icl/operators.h"
#include <assert.h>
#include <stddef.h>
#include <algorithm>
#include "icl/err.h"
#include "icl/parse_tree.h"
#include "... |
89e3a8de591b3bde0518e64460a3c4364bdcb736 | a2da9eede7f988839161d803930eb7267f3e9ba5 | heon24500/PS | /BOJ/10984.cpp | C++ | cpp | 418 | no_license | #include <iostream>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int T;
scanf("%d", &T);
while (T--) {
int N, total_c = 0;
float total_g = 0;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
int C;
float G;
scanf("%d %f", &C, &G);
... |
6ad73aa6a3ad8a0b6cf66447b8acb9c5a3637e81 | b52ba592e10563c5ef6febe61f461c8da5d50e30 | yuri-sevatz/libminecraft | /src/libminecraft/support/fsm/actionstatemachine.hpp | C++ | hpp | 1,501 | no_license | /*
* actionstatemachine.hpp
* This file is part of LibMinecraft.
*
* Created by Yuri Sevatz on 11/2010.
* Copyright (c) 2010 Yuri Sevatz. All rights reserved
*
* LibMinecraft is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Fre... |
b03ac7d7a642e6ae77c725b235c0c4622faa33ac | 63ecda9c8e0ee264be203d1023d00388d99864d4 | sshjj/note | /leetcode/二叉树/144二叉树的前序遍历.cpp | C++ | cpp | 1,268 | no_license | 给定一个二叉树,返回它的 前序 遍历。
示例:
输入: [1,null,2,3]
1
\
2
/
3
输出: [1,2,3]
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vect... |
b722b9a87810f9aa1b312fe1e25290b8c3290363 | b7dab4f4c2451bc8f4e5a8ad974dde11b1b52adf | igchesnok/AHRUnrealEngine | /Engine/Source/Runtime/Navmesh/Private/Recast/RecastLayers.cpp | C++ | cpp | 37,696 | permissive | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
// Modified version of Recast/Detour's source file
//
// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
... |
155c5d3ee9f1b3f5fa8c83eb396893964551d15a | edaef723ac89ef69bf42d18da0c1bcd2ff063feb | breezy1812/MyCodes | /Algorithm/LCS最长公共子序列-DP/LCS最长公共子序列-DP/main.cpp | C++ | cpp | 1,231 | no_license | #include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <queue>
#pragma warning(disable:4996)
using namespace std;
const int SIZE = 10;
queue<char> qs;
void LCSLength(char *a, char *b,int n,int m,int c[SIZE][SIZE])
{
int i, j;
for (i = 1; i <= n; i++)
c[i][0] = 0;... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.