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 |
|---|---|---|---|---|---|---|---|---|
02386566ff4f23bf69e12c0706d6bd3aa7cb8f74 | e49ff0cbabf1cc1f995d985772980d7c4da839b3 | tsstss123/code | /graph/poj2226_Muddy Fields.cpp | C++ | cpp | 1,587 | no_license | /*
* POJ 2226 Muddy Fields
* 二分图最小点覆盖
* */
#include <cstdio>
#include <cstring>
const int MAXN = 25 * 50, MAXM = MAXN * 50;
struct Edge {
int to;
Edge *next;
};
int nE;
Edge E[MAXM], *V[MAXN];
int mat[51][51];
int match[MAXN];
int nmk;
int mk[MAXN];
void addEdge(int u, int v) {
Edge *e = E + nE++;
e->to = v;... |
edac029528c4ac4e030d430699e9c58831056eee | ebedf4d9930c07187b48254d075fb18403c3b5c2 | DDan1l232/SoT-SDK | /SDK/SoT_BP_EmissaryTable_01_classes.hpp | C++ | hpp | 2,741 | no_license | #pragma once
// Sea of Thieves (2.0.17) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SoT_BP_EmissaryTable_01_structs.hpp"
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//-----------------------------------------------------------------------... |
9a194ed07f5c8ccb39604bbcc4963bb6102e9acc | a5796995f23e833a2cb96314f19b243eb0236e2f | mrparth23/Codes | /CodeForces/mergeit.cpp | C++ | cpp | 404 | permissive | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int ans = 0, temp = 0;
int a = 0, b = 0, c = 0;
while (n--)
{
cin >> temp;
if (temp % 3 == 0)
a++;
else if (temp % 3 == 1)
b++;
else if (temp % 3 == 2)
... |
e2a042cb6a5a71ab7c01694656d9bd616e0babdb | 550ee5285108891d8faa8133af5b284afabee546 | HumanHyeon/Algorithm_Book | /archive/SeHyeon/20.05.25 Coding Practice No.4(Before modification).cpp | C++ | cpp | 2,472 | no_license | #include <iostream>
#include <vector>
#define HORIZONTAL 0
#define VERTICAL 1
#define DIAGONAL 2
#pragma warning(disable : 4018)
using namespace std;
const int pipeType[2][2][2] = {
{{0, 0}, {0, 1}},
{{0, 0}, {1, 0}}
};
const int pipeType2[1][4][2] = {
{ {0, 0}, {0, 1}, {1, 0}, {1, 1} }
};
bool set(vector<vector<i... |
5fa170a0e3da1432e7d31c3c91a37279d971b949 | 9ee0f8fc450691f6840e2a2c1c5c4f86be2cac44 | JabberSnatch/pbr_pathtracer | /RayTracer_PeterShirley/inc/ray.hpp | C++ | hpp | 386 | no_license | #ifndef __YS_RAY_HPP__
#define __YS_RAY_HPP__
#include "vec3.hpp"
struct ray
{
ray() = default;
ray(const vec3& a, const vec3& b, float _time = .0f)
:A{a}, B{b}, time{_time}
{}
vec3 origin() const { return A; }
vec3 direction() const { return B; }
vec3 point_at_parameter(float _t) const { return A + _t * B;... |
55043f6f3e3e142f071d8a892d0c66ab52633c73 | 347ff702f71014560aa8fd7cc781056a827ee3b5 | Sadaku1993/scan_match | /src/position_publisher.cpp | C++ | cpp | 2,731 | no_license | #include <ros/ros.h>
#include <tf/transform_broadcaster.h>
#include <tf/tf.h>
#include <geometry_msgs/Quaternion.h>
#include <geometry_msgs/Point.h>
#include <nav_msgs/Odometry.h>
#include <AMU_data.h>
#include <sensor_msgs/PointCloud.h>
#include <time_util/stopwatch.h>
#include <Eigen/Core>
using namespace std;
floa... |
bde7ad165df2da3790a7f3f4ce8b8b890fd19270 | 7b850e808c9fc96eef75243775b095ee58b5896c | GenKnight/DiLiGrp-eTradeClient | /ETtradeClient/project/ETradeClient/utility/win_http.cpp | C++ | cpp | 10,797 | no_license | #include "stdafx.h"
#include "etradeclient/utility/win_http.h"
#include <memory>
#include <vector>
#include <sstream>
#include <cctype>
#include <regex>
#include <boost/algorithm/string.hpp>
#include "wincrypt.h"
#include "etradeclient/utility/string_converter.h"
namespace
{
typedef std::vector<std::pair<std::wst... |
804577e8bfb5109f099eeb03313112b2ec13c16f | 8b8714dd15295f979ba513b0b1a4f149b61b34ae | johnjohnlin/leetcode | /repeated-dna-sequences.cpp | C++ | cpp | 2,036 | no_license | #include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdint>
using namespace std;
class Solution {
static const size_t REPEAT_LEN;
static const size_t DNA_CHAR_BIT;
static const size_t DNA_CHAR_MASK;
static const size_t... |
de6aced309df36ccab82c7a21c27a7d8bd31ae95 | ef5148817b75749c76ea7d49f11dc78c25bd518e | Vladimir-Novick/WinSQLiteLib | /WinSQLiteLib/DBLib/DB_Interface.cpp | C++ | cpp | 2,494 | permissive | #include "pch.h"
//#include "DB_Interface.h"
/* int DB_Interface::btrb_open(void** fdes, char* fname, int opn_mode, char* owner) { return 0; };
int DB_Interface::btrb_close(void** fdes) { return 0; };
int DB_Interface::btrb_create(void** fdes, char* fname, word* rec_len, char* owner) { return 0; }... |
672ef99214f36224ee737d4cf60ccd0e168fde83 | b17381ef4e1db5b0768c17c104c977effdce5e09 | Stoick001/cartoon | /cartoon.cpp | C++ | cpp | 4,585 | no_license | #include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include "cartoon.h"
using namespace cv;
using namespace std;
Cartoon::Cartoon(Mat src) {
size = src.size();
gray = Mat(size, CV_8U);
mask = Mat(size, CV_8U);
edges = Mat(size, CV_8U);
edges2 = Mat(size, CV_8U);
// Get small image... |
687e44becdfecf40b5fbf8476bb3b970bffbce95 | c981db6677778e44fb9775961a5628280105e3db | Johannyjm/c-pro | /AtCoder/abc/abc089/a.cpp | C++ | cpp | 238 | no_license | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int n;
cin >> n;
cout << n/3 << endl;
} |
c4b498642f30f1761b546e0e9924a24e98433b65 | 36ac060e155fbd832540a47de076136fe1691b4c | uabti/coolfluid3 | /cf3/common/CodeLocation.cpp | C++ | cpp | 2,165 | no_license | // Copyright (C) 2010-2011 von Karman Institute for Fluid Dynamics, Belgium
//
// This software is distributed under the terms of the
// GNU Lesser General Public License version 3 (LGPLv3).
// See doc/lgpl.txt and doc/gpl.txt for the license text.
#include <cstdio>
#include <cstring>
#include <list>
#include "common... |
a6ad01ea21b25d3346166c20b97ff5872de266f1 | 32c21e4aedd5cb5a87440d0de07054dcc62cdce6 | vinnie38170/klImageCore | /ipp-UIC.7.1.1.013/sources/image-processing/application/ippidemo/src/ParmHistoEvenDlg.cpp | C++ | cpp | 7,251 | no_license | /*
//
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright(c) 1999-2012 Intel... |
9952e51e7fc7123937a28bbd3bed00e6f6ca8972 | cba787bc199b1a85cea296221743d9cb15a7f10b | lijx10/opengm | /src/interfaces/python/opengm/inference/param/intersection_based_param.hxx | C++ | hxx | 9,674 | permissive | #ifndef INTERSECTION_BASED_PARAM
#define INTERSECTION_BASED_PARAM
#include "empty_param.hxx"
#include "param_exporter_base.hxx"
//solver specific
#include "opengm/inference/intersection_based_inf.hxx"
using namespace boost::python;
template<class INFERENCE>
class InfParamExporterIntersectionBased{
public:
typed... |
8f4861595ad17bf5023a3bbf84e3b8bfbeee9418 | 18ae5ae2cdef79617d00227f7e2c8ee7bff0dcf1 | murdercdh/PKU_ACM | /code/1363.cpp | C++ | cpp | 657 | no_license | #include <iostream>
using namespace std;
int num,order[1002];
int main()
{
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
while(scanf("%d",&num)!=EOF&&num!=0)
{
while(scanf("%d",&order[0])&&order[0]!=0)
{
bool flag=true;
for(int i=1;i<num;i++)
{
scanf("%d",&order[i]);
}
for(int i... |
d131c4e1706fa8ed71f1fd45266709b9b365bd42 | c57941d8157ee00484c1c87c4eabf43f7546480b | rtohid/blaze | /blazetest/src/mathtest/smatdmatadd/MIaMDa.cpp | C++ | cpp | 3,927 | permissive | //=================================================================================================
/*!
// \file src/mathtest/smatdmatadd/MIaMDa.cpp
// \brief Source file for the MIaMDa sparse matrix/dense matrix addition math test
//
// Copyright (C) 2012-2018 Klaus Iglberger - All Rights Reserved
//
// This file ... |
78fec496b00db1080ce3af0ff523195263171c4a | 9c43e69672e1a94d88e4c1427065e19a22bcb558 | fxvengeance/TrustyCoin | /src/netbase.cpp | C++ | cpp | 31,725 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Trustycoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "netbase.h"
#include "util.h"
#include "sync.h"
#include "hash.h"
#if... |
6ab914ce3f1ee7a09dac817a4a2353b9457d84da | e0164e279f211e5132e4ec8140df070acef2dc76 | hanxin1987216/DTL | /src/common/dtl/net/bcon.cpp | C++ | cpp | 17,343 | no_license | /* bcon.c */
/* Copyright 2009-2012 10gen 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... |
4a0d005ff7ad9ba8dfe5c40cf7cac0dc73a1cb4e | f1fb778935a0d82568a1cc031104c9de9025dcaf | maoxiezhao/Cjing2D | /src/player/pushingState.cpp | C++ | cpp | 3,632 | no_license | #include "pushingState.h"
#include "entity\player.h"
#include "movements\movement.h"
#include "player\playerSprite.h"
#include "player\grabbingState.h"
#include "game\gameCommands.h"
#include "game\game.h"
#include "movements\pathMovement.h"
PushingState::PushingState(Entity & entity):
PlayerState(entity, "Pulling"),... |
73505992264169e6b9dd19838225d46f699281cb | 5c15d6835a662d36522c93b7f4915f80fa87f191 | Sookmyung-Algos/2021algos | /algos_assignment/2nd_grade/김민정_mzeong/week3/2805.cpp | C++ | cpp | 680 | no_license | #include <iostream>
#include <algorithm>
using namespace std;
const int MAX = 1000000;
int N; long long M, tree[MAX];
bool possible(long long height) {
long long len = 0;
for (int i = 0; i < N; i++)
if (tree[i] - height > 0)
len += tree[i] - height;
if (len >= M)
return true;
return false;
}
int main... |
508486122deb7f30947d3dadc4983aa127d61f21 | d0d2d4e5c6107f7965729d9248057f591468efbc | pbhowmic/peloton | /src/tcop/tcop.cpp | C++ | cpp | 14,890 | permissive | //===----------------------------------------------------------------------===//
//
// Peloton
//
// tcop.cpp
//
// Identification: src/tcop/tcop.cpp
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===-------------------------------------------------------------------... |
feb36fe0b6d9db529b7675f6a7d49779f07f24da | 3d9b5815b03e707b3127ae2bf82e5595743ba380 | HaiZeizhouyuan/HZOJ | /181.cpp | C++ | cpp | 547 | no_license | /*************************************************************************
> File Name: 181.cpp
> Author:
> Mail:
> Created Time: Sun May 24 11:04:34 2020
************************************************************************/
#include <stdio.h>
#define max_n 10000
char str[max_n + 5];
void check (char *str)... |
c20ebc88185e868962dfdcecec1449c712172534 | e5785b42a9f62b00b0ea5baa3f69d506c6b9531a | shree-yadam/CPP-Practice | /classes/point3d.cpp | C++ | cpp | 1,313 | no_license | /* Class Point 3d containing:
# Three private member variables of type double named m_x, m_y, and m_z
# A public member function named setValues() that allows you to set values
for m_x, m_y, and m_z,
# A public member function names print() that prints the Point in the
following format:
<m_x,m_y,m_z>
# Add... |
3eae0011cab091c185f061f53b60ff55c872d615 | 6f9f7d3417e82d4b4480dcb54df1080c8b8ad16b | labdogg1003/Snake | /Snake/Classes/Native/Il2CppCompilerCalculateTypeValues_16Table.cpp | C++ | cpp | 51,237 | no_license | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include "class-internals.h"
#include "codegen/il2cpp-codegen.h"
#include "UnityEngine_UI_UnityEngine_U... |
c5a00da3ed17b5118c47d3be434abc3272a2a4c9 | 487349bb69c31a5471179445f734cc86c930afe2 | Nicnry/heig-rrh-labo-3 | /saisieUtilisateur.cpp | C++ | cpp | 1,278 | no_license | /*
-----------------------------------------------------------------------------------
Nom du fichier : saisieUtilisateur.cpp
Auteur(s) : Alexandre Junod, Jarod Streckeisen, Nicolas Henry
Date creation : 10.11.2020
Description : Contient la/les fonctions lié à la saisie utilisateur.
Remarque(s) :
Com... |
827dd983b27db2963229a166edf8d561294e5601 | abf58edb676bb3decb287e5c9609c03d4f5ca8a7 | eysdfgh/platform_development | /vndk/tools/header-checker/header-abi-dumper/src/ast_processing.cpp | C++ | cpp | 7,644 | permissive | // Copyright (C) 2016 The Android Open Source Project
//
// 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 applic... |
62a99f49be66181acc2439126b2f76daf3a49978 | 053343312d03e0585921dd5e38e43d62c884a3d7 | matteosan1/cmssw | /RecoLocalMuon/DTSegment/src/DTCombinatorialPatternReco4D.cc | C++ | cc | 13,106 | no_license | /** \file
*
* $Date: 2009/03/19 17:42:27 $
* $Revision: 1.19 $
* \author Stefano Lacaprara - INFN Legnaro <stefano.lacaprara@pd.infn.it>
* \author Riccardo Bellan - INFN TO <riccardo.bellan@cern.ch>
*/
#include "RecoLocalMuon/DTSegment/src/DTCombinatorialPatternReco4D.h"
#include "FWCore/ParameterSet/interface/P... |
49947b1df88812174e7382c0c659b24e9af2202f | 114b10613be2eadfbbf9b81adec997bb21b487ac | NJNischal/ValgrindRepo | /app/AnalogSensor.cpp | C++ | cpp | 446 | no_license | #include <AnalogSensor.hpp>
#include <memory>
#include <numeric>
#include <vector>
AnalogSensor::AnalogSensor(unsigned int samples)
: mSamples(samples)
{
}
AnalogSensor::~AnalogSensor()
{
}
int AnalogSensor::Read()
{
std::unique_ptr<std::vector<int>> readings = std::make_unique<std::vector<int>>(mSamples, 10... |
690112e33b7dbb0792ecb0852e7bce992052f2ab | d126d035b7c5363d7cb25c98e4f478f4d114d186 | meniossin/src | /device/fido/get_assertion_task_unittest.cc | C++ | cc | 7,714 | permissive | // Copyright 2018 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 "device/fido/get_assertion_task.h"
#include <iterator>
#include <memory>
#include <utility>
#include <vector>
#include "base/bind.h"
#include "... |
beecde175cd2c47e7e47b349dc12c5a4cf7881eb | 933433d8cc736759d7f9b62da440ef6c2abcd8cf | Alipipe/TOP-chain | /src/xtopcom/xdata/src/xemptyblock.cpp | C++ | cpp | 1,008 | no_license | // Copyright (c) 2017-2018 Telos Foundation & contributors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <string>
#include "xvledger/xvblock.h"
#include "xdata/xdata_common.h"
#include "xdata/xdatautil.h"
#include "xd... |
c8d489496d0881b73183cd6e51625f8980f7e39e | 25053a078f6287312c06d2ff6113b0744fb65e25 | samajors/pressio | /packages/containers/src/matrix/meta/containers_native_trilinos_matrix_meta.hpp | C++ | hpp | 4,453 | permissive | /*
//@HEADER
// ************************************************************************
//
// containers_native_trilinos_matrix_meta.hpp
// Pressio
// Copyright 2019
// National Technology & Engineering Solutions of Sandia, LLC (NTESS)
//
// Under the terms of Con... |
410464a7bc13dd6e90d394848f2c1d7b9381e035 | e31e03ee8ecfe8d3422a24ecfd93155e9ed23f7c | zxc123qwe456asd789/library | /verify/verify-aoj-itp/aoj-itp2-11-c.test.cpp | C++ | cpp | 467 | permissive | #define PROBLEM \
"http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP2_11_C"
#include "../../template/template.hpp"
#include "../../set-function/enumerate-set.hpp"
using namespace Nyaan; void Nyaan::solve() {
ini(n);
int b = 0;
ini(k);
rep(i, k) {
ini(x);
b |= 1 << x;
}
auto ss = enumer... |
7b11252ca1e485236e4a0f5b8b1b672ab38a0e75 | bef5f83135b91afbb04460f6823aea9ef86d91ea | thoughtworksarts/Dual_Brains | /drafts/quickSpectrogram_2/libraries/liblsl/external/lslboost/ratio/detail/mpl/sign.hpp | C++ | hpp | 2,275 | permissive | ////////////////////////////////////////////////////////////////////
//
// Copyright Vicente J. Botet Escriba 2010
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.lslboost.org/LICENSE_1_0.txt)
//
// See http://www.lslboost.org... |
a7f97b6bbb82b14e87ab55658dfb7d1407703afd | 9a53057c0eb92aa2b0496e907f9430424eed352a | kokarez/xtensor | /include/xtensor/xhistogram.hpp | C++ | hpp | 16,202 | permissive | /***************************************************************************
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
* Copyright (c) QuantStack *
* *
* Distribute... |
7ab0dbd39f2c38f80811c95814eafe3888172fe8 | 04b1ebdb58abbf55aa6ad25ed9dbc1bdf000b0a6 | Numerical-analysis-team-4/Numerical_analysis_lab_1 | /MyForm.cpp | C++ | cpp | 273 | no_license | #include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Graph::MyForm form;
Application::Run(%form);
}
|
30df9ce4ab2d80ae93985c04ff365431add472e8 | 7bd14caadd9243bbcd8656f63b8baa160fb3c23a | ornladios/ADIOS2 | /source/adios2/engine/bp5/BP5Writer_TwoLevelShm_Async.cpp | C++ | cpp | 12,741 | permissive | /*
* Distributed under the OSI-approved Apache License, Version 2.0. See
* accompanying file Copyright.txt for details.
*
* BP5Writer.cpp
*
*/
#include "BP5Writer.h"
#include "adios2/common/ADIOSMacros.h"
#include "adios2/core/CoreTypes.h"
#include "adios2/core/IO.h"
#include "adios2/helper/adiosFunctions.h" /... |
c7a3793cd5e1895b5918e7866a2b13ad73bd46a5 | 945fd06224652b6ef0b4d9e832680f21a107d80e | revery-ui/esy-skia | /src/core/SkSpriteBlitter_ARGB32.cpp | C++ | cpp | 3,662 | permissive | /*
* Copyright 2006 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkSpriteBlitter.h"
#include "SkArenaAlloc.h"
#include "SkBlitRow.h"
#include "SkColorFilter.h"
#include "SkColorData.h"
#include "SkPaint.h"
#inc... |
ebceebfc120c8692bed2703f98ff0d6f11c50a31 | a1df8dc2a4fcce8f55e83d04f1f38a40910122c4 | nandyorama/Thread- | /PrintEvenAndOdd.cpp | C++ | cpp | 1,039 | no_license | #include "stdio.h"
#include "stdlib.h"
#include "pthread.h"
#include<iostream>
using namespace std;
pthread_mutex_t count_mutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t condition_var = PTHREAD_COND_INITIALIZER;
void *odd(void *p);
void *even(void *p);
// Print odd numbers
void *odd(void *p)
{
for(int j=1;j<10;j+... |
7e95659e148237109535ee181bb514d097ff936e | 2ef8a072c81221a598d38f2a9117f5c43a5464ef | iamrahulchauhan/LearnCpp | /6.12a Quiz/main.cpp | C++ | cpp | 559 | no_license | #include <iostream>
#include <string>
int main() {
std::string nameArray[]{"Alex", "Betty", "Caroline", "Dave", "Emily", "Fred", "Gred", "Holly"};
std::cout << "Enter a name: ";
std::string nameInput;
std::getline(std::cin, nameInput);
bool isFound{false};
for (const auto name : nameArray) {
... |
70f7bd72e1c6a690c643845de50cbdd680701648 | 407a001883fc19e66ee10afc672130f320dbc030 | lexoy/SDL | /sdl_core/src/components/formatters/src/CFormatterJsonSDLRPCv1.cpp | C++ | cpp | 5,997 | no_license | // Copyright (c) 2013, Ford Motor Company
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this
// list of condition... |
a589c5875370c23259cf64e06d9e15cd1721dfd8 | 2148851c9ddd63b89baa386926ecc21a6470d702 | Omanshu840/Competitive-Programming | /LeetCode/Dynamic-Programming/MaximalSqaure.cpp | C++ | cpp | 954 | no_license | class Solution
{
public:
int maximalSquare(vector<vector<char>> &matrix)
{
int n = matrix.size();
if (n == 0)
return 0;
int m = matrix[0].size();
vector<vector<int>> dp(n, vector<int>(m, 0));
if (matrix[0][0] == '1')
dp[0][0] = 1;
int a... |
c0c6e45449b51ee13ea2aabec039e98167767867 | dd9207b2848b91405a4d8831c4e8e94bc1136705 | jessetvogel/NeuralNetwork | /src/NeuralNetwork/NeuralNetwork/network.hpp | C++ | hpp | 1,661 | no_license | #ifndef network_hpp
#define network_hpp
#include "tensor.hpp"
#include <vector>
class Builder;
class Network {
public:
enum ErrorType { QUADRATIC, CROSS_ENTROPY };
private:
Builder* builder;
Variable* input;
Variable* output;
Variable* trainOutput;
scalar learn... |
83a860cc82775a9c6f05d450b8ae79bd9765b996 | c7d31293aef8e053828db8451a56c617d5947f7d | SouthStreet/AlgTrain | /PATB1015/PATB1015/main.cpp | C++ | cpp | 986 | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct Student{
char id[10];
int de, cai, sum;
int flag;
}stu[100010];
bool cmp(Student a, Student b){
if( a.flag != b.flag ) return a.flag < b.flag;
else if(a.sum != b.sum ) return a.sum > b.sum;
else if(a.de != b.de ) return a.de ... |
e19f9946735ec805484cd70cfbdf38b03f1aa7ef | eb65b4af854ad5c4e3de003b1619c32af2a9b9af | MeyerSoundLaboratoriesInc/VTK | /Filters/Modeling/vtkSelectPolyData.cxx | C++ | cxx | 19,685 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSelectPolyData.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This softwar... |
7d3bcc555324669ca34e59f7f2a28554857c2a54 | 96ed98e466197cc5632581da58d7150f6cefee96 | FrankHB/nano-signal-slot | /benchmark/evs_benchmark.hpp | C++ | hpp | 5,470 | permissive | #ifndef EVS_BENCHMARK_HPP
#define EVS_BENCHMARK_HPP
#include "lib/eviltwin/observer_safe.hpp"
#include "chrono_timer.hpp"
#include "benchmark.hpp"
#include <forward_list>
#include <algorithm>
#include <memory>
#include <vector>
namespace Benchmark
{
class Evs
{
std::forward_list<Nano::Safe::UniversalPtr> reg;
... |
d26c135a4cc2581a69591fde59215b58c6643d57 | 863d04b803249ccfb1fcc746a72019781c90f821 | bamtu/TIL-NCS-C-language-basics | /prj0504/prj0504/source07.cpp | C++ | cpp | 426 | no_license | #include <stdio.h>
int main(){
int num1,num2;
int max, min;
int result = 0;
printf("수 입력 : \n");
scanf("%d", &num1);
printf("수 입력 : \n");
scanf("%d", &num2);
if(num1 > num2)
{
max = num1;
min = num2;
}
else if(num1 < num2)
{
max = num2;
min = num1;
}
else printf("Error");
for(int i=max-1 ; i... |
c75ba7260cfa91ce5180c285cd7b72c770a6cb86 | f8f4b1abfb8f288e7e99e9b3ed9744e966640ebf | suchto/ElastosRT | /Sources/Elastos/LibCore/src/elastosx/xml/namespace/CQName.cpp | C++ | cpp | 6,004 | permissive | //=========================================================================
// Copyright (C) 2012 The Elastos Open Source Project
//
// 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
//
// ... |
7517d2c170e4fe50b979a56f9aed143b0a610a1a | 71ffd53f568915be7faab3fd1c1a9d4b743768d7 | zrlu/cs488-opengl-project | /A5/ShaderProgram.cpp | C++ | cpp | 9,373 | no_license | #include "ShaderProgram.hpp"
#include "cs488-framework/ShaderException.hpp"
#include "cs488-framework/GlErrorCheck.hpp"
#include <glm/gtc/type_ptr.hpp>
using glm::value_ptr;
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
//--------------------------------------------... |
2bb031ff25c12fdb4b17a8e1bbfe030c6a43534c | 187f82b473d0e2918e30c0495ef6924c31055730 | Sahil1515/Competitive-Coding | /.history/001_GFG/Company Wise/Microsoft/001_IsIit_BST_20210628191353.cpp | C++ | cpp | 551 | no_license |
class Solution
{
public:
bool isBSTUtil(Node * root, int maxi, int mini)
{
if(root==NULL)
return true;
if ( root->data <mini || root->data > maxi)
return false;
return (isBSTUtil(root->left,root->data-1,mini) && isBSTUtil(root->right,maxi,root... |
6e738dbd436c2d3cc94f2b87f2f0fe3222fa45a3 | fd967eaccc9a93d8eb80a72746856646b9f83a4a | jjzhang166/autoupdate | /autoupdate/common/3rd/boost/mpl/deref.hpp | C++ | hpp | 1,009 | no_license |
#ifndef BOOST_MPL_DEREF_HPP_INCLUDED
#define BOOST_MPL_DEREF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-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)
//
// See http://www.boost.org/libs/mpl for... |
b09024a8b4fd7c900819c61ebeb6929d893be966 | 31e4277b5afeeabb07bda5dfa8b72e68a5dc757d | tomafy/peloton | /test/catalog/constraints_tests_util.cpp | C++ | cpp | 9,479 | permissive | //===----------------------------------------------------------------------===//
//
// Peloton
//
// constraints_tests_util.cpp
//
// Identification: test/catalog/constraints_tests_util.cpp
//
// Copyright (c) 2015-16, Carnegie Mellon University Database Group
//
//===---------------------------... |
987d8e8d5f5529d39bcc666037836bee036216ff | d483fcf9658d1d8b328092bdbc9992f2cc0d43be | erf/serenity | /Userland/Libraries/LibGUI/BoxLayout.cpp | C++ | cpp | 8,542 | permissive | /*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/JsonObject.h>
#include <LibGUI/BoxLayout.h>
#include <LibGUI/Margins.h>
#include <LibGUI/Widget.h>
#include <LibGfx/Orientation.h>
#include <stdio.h>
REGISTER_LAYOUT(GUI, HorizontalBoxLayou... |
8cd24a0642777442be1a8710f85393ed17083d25 | d658881fc8126ca378f10f0d8f40cc128da32eba | chrinide/xtp | /src/libxtp/gwbse/bse.cc | C++ | cc | 22,494 | permissive | /*
* Copyright 2009-2019 The VOTCA Development Team
* (http://www.votca.org)
*
* 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... |
c4fbab93aa738c14fa58e6e5c68720bd20a27e43 | 2488e2ef7f9c737b32193dd49d74a4c53d0c94f5 | rynder/swift | /lib/SILOptimizer/Utils/Local.cpp | C++ | cpp | 91,457 | permissive | //===--- Local.cpp - Functions that perform local SIL transformations. ----===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LI... |
0b4b771b07a66c2ee6d3675b2393ba29600d9945 | 3e6adf551621fddb809b7588cad879c18f5aa89d | lysannschlegel/bsf | /Source/Foundation/bsfUtility/Image/BsColorGradient.cpp | C++ | cpp | 2,225 | permissive | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
#include "Image/BsColorGradient.h"
#include "Private/RTTI/BsColorGradi... |
1658158928b41a0fa0d4d9dbe453daf4e46cc477 | 71cac609e331fb0a1dadf8ccbb7f964b2db27439 | beetledev/Wallet | /src/pow.cpp | C++ | cpp | 5,224 | permissive | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018-2019 The BeetleCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file... |
3401c5181bf938c479588026113160052ab4b9e1 | 34edccf08e63127213d0aeca55de90fe99de44ce | remzert/BraveBrowser | /chrome/browser/ui/ash/vpn_delegate_chromeos.cc | C++ | cc | 6,086 | 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 "chrome/browser/ui/ash/vpn_delegate_chromeos.h"
#include "base/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/threa... |
12472abc2b2d5eaebc17033f67214ba64e07d425 | 83a882f34f588717e4042dbd3595e001eae64c7f | chromium/chromium | /chrome/browser/apps/app_shim/test/app_shim_listener_test_api_mac.cc | C++ | cc | 862 | permissive | // Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/apps/app_shim/test/app_shim_listener_test_api_mac.h"
#include "apps/app_lifetime_monitor_factory.h"
#include "base/files/file_path.h"
#include "chrome... |
777fd186cf73d282edfe13a2562b50b1efb5f373 | 7995d3f22584f67168ffe280ebf658407ba8eb30 | damienlaine/djoro-thermostat | /ThirdPartyLibs/ArduinoJson/src/Internals/IndentedPrint.cpp | C++ | cpp | 558 | permissive | // Copyright Benoit Blanchon 2014
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
#include "../../include/ArduinoJson/Internals/IndentedPrint.hpp"
using namespace ArduinoJson::Internals;
size_t IndentedPrint::write(uint8_t c) {
size_t n = 0;
if (isNewLine) n +=... |
715f137a70d9fdb2b2bb60bb6dc393e96b7a5eec | f5949e4014a56cc48590a6f46550787d0bb29b03 | ngnevan/ydk-cpp | /cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_accounting_cfg.cpp | C++ | cpp | 12,774 | permissive |
#include <sstream>
#include <iostream>
#include <ydk/entity_util.hpp>
#include "bundle_info.hpp"
#include "generated_entity_lookup.hpp"
#include "Cisco_IOS_XR_accounting_cfg.hpp"
using namespace ydk;
namespace cisco_ios_xr {
namespace Cisco_IOS_XR_accounting_cfg {
Accounting::Accounting()
:
enable{YType::em... |
6ac6f2b7d097b03a45edab5776c5ee2bad27aecc | 8d93980bd2363e83014fb64fef414db419d18746 | yzr95924/OptimizationSolver | /src/main.cc | C++ | cc | 2,891 | no_license | #include "solver.h"
#include <sys/time.h>
#include "sparsepp/spp.h"
int main(int argc, char* argv[]) {
int n = 0;
int m = 0;
int totalChunk = 0;
double storageBlow;
storageBlow = atof(argv[1]);
vector<pair<string, int> > input;
struct timeval stime, etime;
/**start to read the fi... |
e6ddde64bf21d09d607de2e02809dca983dee6c0 | 7fafb7b830c8fa2cba0428a91aac7cc9051b298e | Adore68/cplus_all_in | /Part04/0432_Constructor2.cpp | C++ | cpp | 655 | no_license | #include <iostream>
using namespace std;
class SimpleClass
{
private:
int num1;
int num2;
public:
SimpleClass(int n1=0, int n2=0)
{
num1=n1;
num2=n2;
}
void ShowData() const
{
cout<<num1<<' '<<num2<<endl;
}
};
int main(void)
{
SimpleClass sc1();// very confusing for compiler to distinguish this sentenc... |
2178ec7f0db384543b4f4713d5dbe35fd45b8730 | 82e0160d4dc099b079758164238960fe5c07ab2f | qxzcode/Bedrock | /MineCommand.cpp | C++ | cpp | 2,733 | no_license | //
// MineCommand.cpp
// Bedrock
//
// Created by Quinn on 1/19/14.
// Copyright (c) 2014 Hexahedron Games. All rights reserved.
//
#include "MineCommand.h"
MineCommand::MineCommand(util::vec3i c1, util::vec3i c2) {
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
cMin = {min(c1.x,c2.x), min(c1.y,c2.y), min... |
eb4ab055dbab660be3307d2e8fa730ffdd8f0ffd | 36929e17cc92d15d098ee62f35e0de40f0ca37e7 | ericvn/proxy | /source/extensions/common/workload_discovery/api.cc | C++ | cc | 10,825 | permissive | // Copyright Istio 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 l... |
ab43ee2cfd1c1a20dfeebe583b7054c7c43bcc00 | e58d04202f0b864cd3e1bc18bf869d48878a72f0 | yunussid/coding-ninjas-c-DATA-Structure-all-questions-solved | /Queue/Q P3.cpp | C++ | cpp | 1,363 | no_license | #include<iostream>
using namespace std;
template <typename T>
class Node{
public:
T data;
Node<T> *next;
Node(T data){
this->data=data;
next=NULL;
}
};
template <typename T>
class Queue{
Node<T> *head;
Node<T> *tail;
int size;
public:
Queu... |
a83680810fe991c3d0cea38657ab690d7a7c0892 | c24a86b2c657139ab964a76666175282624a251b | chrisr-cs/trafficserver | /lib/ts/TextBuffer.cc | C++ | cc | 6,374 | permissive | /** @file
A brief file description
@section license License
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 und... |
c0f386df944dc25dfec16b855c31f3c7ec3e283a | 3488b73a28a994cbc7436b55002b08079f6cf04e | ViveliDuCh/Estructura-de-datos | /class_code/pointers/example6.cpp | C++ | cpp | 1,075 | no_license | /*************************************************
Ejemplo de uso de apuntadores para enviar una
función como parámetro. En este caso, se realiza
una técnica de integración basada en rectángulos.
La función 'integration' recibe como parámetro
la función que se integra.
*************************************... |
038e667e695f44f3b90d8db47e12f70321e0d8d7 | f3c5bcd8dc60acf1bc2a72d2ccba50710b5b09fa | mattielangford/dog-age-generator | /dogname.cpp | C++ | cpp | 627 | no_license | #include <iostream>
#include <string>
int main(){
double x = 0;
std::string name;
std::cout << "What is your dogs name?\n";
std::cin >> name;
std::cout << "How old is your dog?\n";
std::cin >> x;
int early_years = 21;
int later_years = (x - 2)*4;
int human_years= early_years + later_years;
st... |
4060dc45ac9abc00e4daad3d93e472b3a7ab3d3c | b3e6e41d29d5ebfd438f60586f902c0db553d090 | frankhedecke/sdl_pong | /src/scene_pong.cc | C++ | cc | 5,420 | no_license | #include "cleanup.h"
#include "scene_pong.h"
ball::ball(vector_screen* scr) {
screen = scr;
tex_ball = screen->load_Texture("res/ball.png");
reset();
last_tick = SDL_GetTicks();
}
void ball::reset(float start_side) {
pos_x = 0.5; // 320;
pos_y = 0.375; // 240;
// movement per second
speed_x = 0.1875; ... |
5b0fcd47b7d01463dd2d8c53621e4f2884db4478 | 51e39929aa073f7852c973ee43b27a3544d550ad | dingswork/Code | /UVa Online Judge/volume114/11419 SAM I AM/program2.cpp | C++ | cpp | 2,420 | no_license | // SAM I AM
// UVa ID: 11419
// Verdict: Accepted
// Submission Date: 2017-10-09
// UVa Run Time: 0.030s
//
// 版权所有(C)2017,邱秋。metaphysis # yeah dot net
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
... |
06918db90409938d40752c04eb7f382b984c2666 | 0dfacc46b36c5f4e530b0e4aba63ee0b1406950c | torkos/magnum | /src/Magnum/SceneGraph/Test/DualComplexTransformationTest.cpp | C++ | cpp | 7,298 | permissive | /*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013, 2014, 2015
Vladimír Vondruš <mosra@centrum.cz>
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 Softwar... |
1dec9867dd3b1e47569d87bd4dfa603a1c0bbd99 | 7e99ea69ce2cdc236f28344b782815f041820574 | CodingOfZero/DataStructure | /3.stack_queue/N_Queens.cpp | C++ | cpp | 4,600 | no_license | /*
*N_Quenns
*2018年7月18日 21:57:58
*/
#include<iostream>
#include<stack>
#include<vector>
using std::stack;using std::vector;
struct Queen{
int x,y;
Queen(int xx, int yy){
x=xx;
y=yy;
}
bool operator ==(Queen const &q) const{ //重载相等运算符以此判定是否冲突
return (y==q.y)||(x+y==q.x+q.y)||(x-y==q.x-q.y); //同一列以及对角线; ... |
d5d8e90b69645f9b961143c9a498d5b89f0651b1 | b29340bd22ea360961efe54f7710a5b324e9ca88 | yotam-medini/cj | /2012/qualification/tongues.cc | C++ | cc | 3,300 | no_license | // CodeJam
// Author: Yotam Medini yotam.medini@gmail.com -- Created: 2013/April/20
#include <iostream>
#include <fstream>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <utility>
#include <cstdlib>
#include <cstring>
using namespace std;
static unsigned dbg_flags;
static void learn(c... |
4e4129308b857074c86676e51ac95ee282a3ebcb | 551b0e0e4e08b6b966f696d222e074b267883d7f | masedki/MHBinaryModelSelection | /src/MHLogitRegModelSelection.cpp | C++ | cpp | 5,917 | no_license | //
// MHLogitRegModelSelection.cpp
//
//
// Created by sedki on 03/11/2014.
//
//
#include <RcppArmadillo.h>
#include <Rcpp.h>
#include <RcppEigen.h>
//#include <Rmath.h>
//#include <Rdefines.h>
using namespace std;
using namespace Rcpp;
using namespace arma;
using namespace Eigen;
//#include "LogisticRegression.h... |
75e4075116bb31f5e2b5cc9cb188f116b8ac3d9d | 50744b0c8121571670db2a248573373132a1f351 | JavaMatrix/SHelF | /Shelf/Shelf/Shelf.cpp | C++ | cpp | 1,177 | no_license | /*
* Shelf - Super HELpful Functions library
* Shelf Library by Nathanael Page is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* Contains functions to help with fundamental C++ tasks.
*
* Shelf.cpp - contains definitions for .
*/
#include "Shelf.h"
#include "C... |
7ed4bd62251e5996cffae23d1df750376531ce75 | 0dcba49b5ff4815b86ff7e6450f07318397e54be | francescog/nt2 | /modules/boost_math/bench/scalar/rising_factorial.cpp | C++ | cpp | 1,788 | permissive | //////////////////////////////////////////////////////////////////////////////
/// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand
/// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI
///
/// Distributed under the Boost Software License, Version 1.0
/// ... |
a708bb2f5484ccc0ff6cd8ebefb90dff9a71012b | ea0d542ca875a22034912d1e994bfc2598281618 | 3660628/Meganekko | /library/src/main/jni/MeganekkoActivity_jni.cpp | C++ | cpp | 2,200 | permissive | /*
* Copyright 2015 eje inc.
* Copyright 2015 Samsung Electronics Co., LTD
*
* 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
*
* Unl... |
73946baf96bf01aed677eacd347e1c86ab4eeea8 | c69a20fdb2d8560a781738f2054d227a4de2b6b1 | wolfviking0/webcl-webkit | /Source/WebKit/UIProcess/API/glib/WebKitError.cpp | C++ | cpp | 3,231 | no_license | /*
* Copyright (C) 2011 Igalia S.L.
* Copyright (C) 2008 Luca Bruno <lethalman88@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or... |
1803a4f639c9c837e8034e88cb5569294130b8a8 | def8ff4ddee240d99fd4da6e9f66122fff15f698 | deepakrgala/cpp_programs | /cpp_tutorials/9 AccessClassDataMemberUsingPointer/AccessClassDataMemberUsingPointer.cpp | C++ | cpp | 675 | permissive | #include <cstdlib>
#include <iostream>
using namespace std;
class arthimatic
{
public:
int _arg1;
int _arg2;
void set_data(int v1, int v2)
{
_arg1 = v1;
_arg2 = v2;
}
void arthimatic_operations()
{
cout<<"Arthimatic Calculator\n";
cout<<"(_arg1+_arg2)"<<(_arg1+_arg2)<<endl;
c... |
b8cdda9370bce0d56002129799fae11313569e7b | ad8e62d1335ac169e97d5fae577a2eb791c08bee | Chelsea21/p3 | /src/scene/ray.cpp | C++ | cpp | 797 | no_license | #include "ray.hpp"
namespace _462 {
Vector3 dir;
Vector3 up;
real_t AR;
Vector3 cR;
Vector3 cU;
real_t dist;
Vector3 pos;
Ray::Ray(){}
Ray::Ray(Vector3 e, Vector3 d)
{
this->e = e;
this->d = d;
}
void Ray::init(const Camera& camera)
{
dir = camera.get_direction();
up = camera.get_up();
AR = ca... |
61655d1d7d6f959cf0e4eca6e57f8496ab61bad5 | 2af4a558a65c732e43d59ebdcaf91edf989fc9ae | CMS-TMTT/cmssw | /L1Trigger/DTBti/src/DTBtiChipEquations.cc | C++ | cc | 23,780 | permissive | //-------------------------------------------------
//
// Class: DTBtiChip
//
// Description: Implementation of DTBtiChip
// trigger algorithm
// (Equations' implementation)
//
//
// Author List:
// C. Grandi
// Modifications:
// 22/X/02 S. Vanini: redundant patterns added
/... |
b0eee92a300c5d7bfe3006e20c16455cb06d96c2 | 9e8e88b6cf68c0017ec2921874648f8e7400c47c | TCtobychen/IntrotoAlgorithm | /C++Implementation/LuoguP2059.cpp | C++ | cpp | 1,004 | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
#include <fstream>
#define For(x,y) for(int i=x;i<y;i++)
using namespace std;
int N,M,c[55],cnt[55];
double p[55],temp[55];
void dojob(int k,int n){ // k+1 is the player for the next round
double p0=(double)cnt[k]/M;
//cout << p0 << "!!!" << endl;
if(p... |
87ffa7e35ebdb5e5e93c0252cd0d4a17b522eaff | b59fedd4bcb4fe3ef69002f14eb7f7753246cf8d | cgreczkowski/pandemic | /build_1/pandemic/pandemic_rebuild/RefCard.cpp | C++ | cpp | 2,319 | no_license | //**********************************************
//COMP345 Assignment 2
//Winter 2017
//**********************************************
//
//RefCard.cpp
#include "RefCard.h"
RefCard::RefCard() {
Cards::card_name="ACTIONS";
Cards::card_textfront =
"Drive/Ferry \n "
"Move to a city connected by a white li... |
56038374aaaad3e27105acc2df462b470b00b633 | d3c532e6bca35c011c073f96dafe100b6dfbe42b | gvvynplaine/chrono | /src/demos/cascade/demo_CAS_robot.cpp | C++ | cpp | 20,025 | permissive | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of t... |
6958969c57fa078278b4eb03b7da3b3e5b28f50e | 1d2ad01e972079bcffb45a9d43b4c57892800dbb | mlu11/SerialTestCpp | /GPIB.cpp | C++ | cpp | 1,987 | no_license |
#include "stdafx.h"
#include "comport.h"
#include <iostream>
#include <stdio.h>
#include <string.h>
#include "GPIB.h"
using namespace std;
// set frequency with runCMD
void setFreq(int freq_input, DWORD error, char* port, DWORD timeOut)
{
char freq_cmd[253];
sprintf_s(freq_cmd, ":FREQ %d MHZ", freq_input);
runCm... |
db34cff46aa892801371606441285638fa9a82fb | 70baca5a51caf2784f12d369dac2b2e73f6ac306 | locobrain/possumwood | /src/plugins/opencv/nodes/lightfields/integrate_mosaic.cpp | C++ | cpp | 4,249 | permissive | #include <possumwood_sdk/node_implementation.h>
#include <tbb/parallel_for.h>
#include <opencv2/opencv.hpp>
#include <actions/traits.h>
#include "maths/io/vec2.h"
#include "frame.h"
#include "lightfield_pattern.h"
#include "tools.h"
namespace {
dependency_graph::InAttr<possumwood::opencv::Frame> a_in;
dependency_... |
638fcbca6f7d21efa3bbfda2fee6990b79faee28 | 2fcaf8bf406e3d939e8c7aed36bd64f6cdb69969 | Amoghtech/Codeforces-List | /A. Next Round.cpp | C++ | cpp | 1,762 | no_license | #define nbits(n) __builtin_popcount(n)
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define mod 1000000007
#define up(a, x) upper_bound(a.begin(), a.end(), x) - a.begin()
#define lp(a, x) lower_bound(a.begin(), a.end(), x) - a.begin()
#define maxv(a) max_element(a.begi... |
53db89c4d28cd8c9bc7695fb25c7c93bb7c5aec7 | e146a604affdfe96b73e85db4391e81c7f471bd2 | tqchen/tvm | /src/relax/op/tensor/manipulate.cc | C++ | cc | 40,197 | 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 ... |
936a921016fb36fabb1956ada45ebeb18dc4767a | 95b720d2148cd2b5a8fdb1986f5a28cc289c9f08 | chenhowa/rdbms | /src/headers/imp/stream/file_input_stream.hpp | C++ | hpp | 1,368 | no_license |
#ifndef FILE_INPUT_STREAM_HPP
#define FILE_INPUT_STREAM_HPP
#include "i_file_input_stream.hpp"
#include <fstream>
#include <fruit/fruit.h>
class FileInputStream : public IFileInputStream {
private:
std::fstream input;
std::string name;
public:
INJECT(FileInputStream() );
virtual void open(const ... |
e122bcc2db2dcbaf889942eac28212a153e3792b | c7de51ec7220e665c6b2ba6c9eee9c674fcc5643 | clangen/musikcube | /src/musikcube/app/window/TransportWindow.cpp | C++ | cpp | 27,147 | permissive | //////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004-2023 musikcube team
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redist... |
6be571f2afbc5d2e8314fc068b69e476d28065ee | a0b655b17e370f4588c28a111fb89523d2baf854 | DarkShadowM/InterviewBit-Topicwise-Solutions | /Two Pointers/RemoveElementFromArray.cpp | C++ | cpp | 972 | no_license | // https://www.interviewbit.com/problems/remove-element-from-array/
// void swap(int &a, int &b){
// int temp = a;
// a = b;
// b = temp;
// }
int Solution::removeElement(vector<int> &A, int B) {
// Do not write main() function.
// Do not read input, instead use the arguments to the func... |
cfc30a61cdb5ae69615f7c1d4fe46c552ec47e00 | ecc08d39ca1bc09a45a55936fc3307eeaf3959e0 | movsb/gvim_fullscreen | /gvim_fullscreen.cpp | C++ | cpp | 3,798 | no_license | #ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0502
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <cstdio>
static BOOL CALLBACK EnumThreadWndProc(HWND hwnd, LPARAM lParam) {
char ClassName[128];
ClassName[GetClassNameA(hwnd, &ClassName[0], sizeof(ClassName)/sizeof(*ClassName))] = '\0';
i... |
7109384d65a93bff0097e50c0a60f58af312e286 | 313ed556feb44b0df905d7dc8d34ebedd32b8647 | jaybatra26/datastructures | /linkedList/doubly.cpp | C++ | cpp | 1,282 | no_license | #include<bits/stdc++.h>
using namespace std ;
struct node{
int data ;
node *next ;
node *prev ;
} ;
node * insert(node* head1,int data,int pos){
node* new_node = new node() ;
new_node->data = data ;
new_node->next = NULL ;
new_node->prev = NULL ;
if(pos == 0){
head1 = new_node... |
a90fc2fd57275af0fe0117d4c15c22b4534e824a | 3ed0c841ce679a465cd6b77d394dfbc4e448289e | h-sinha/CP-codes | /Codeforces/353B.cpp | C++ | cpp | 2,310 | no_license | #include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
cerr << name << " : " ... |
c84b12dddf717122be7b6439d4be1238f01ebcf3 | 00e4ef0e13f7f112a12298d01fa500e536696e26 | sanyaade-teachings/fawkes | /src/plugins/laser-filter/filters/circle_sector.cpp | C++ | cpp | 2,466 | no_license |
/***************************************************************************
* circle_sector.cpp - Filter laser data for circle sector
*
* Created: Sat Feb 19 00:28:41 2011
* Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
*
****************************************************************************... |
7cdcb16a894dce5ca8af53985c5b6281c9043c49 | 161d7417584650dacc977b16328cdeb41e133e5a | Dotolie/tavi | /Task/AudioPlayer/MusicDBPL.cpp | C++ | cpp | 9,537 | no_license | #include <time.h>
#include <rmbasic.h>
#include <fatfs.h>
#include <Component/Stack.h>
#include <Component/String.h>
#include <Component/FileUtil.h>
#include <Task/tavi_global.h>
#include "MusicDBPL.h"
CMusicDBPL::CMusicDBPL( CDeviceMusicDB* db, int type, int sort, progresspfn pfn ) :
CPlaylist( CString(""), sort, ... |
a75d51542d9660dcb4e789f6d23f0033d405055b | d512afa0e888a7009f87814f345487d6e4c06cb4 | Markfrancisrogers/BooleanNetwork | /booleannetwork-code-66-trunk/booleannetwork-code-66-trunk/include/BnSimulator/util/algorithm/fold_cartesian_product.hpp | C++ | hpp | 1,918 | permissive | /*
* fold_cartesian_product.hpp
*
* Created on: Aug 28, 2009
* Author: stewie
*/
#ifndef FOLD_CARTESIAN_PRODUCT_HPP_
#define FOLD_CARTESIAN_PRODUCT_HPP_
#include <functional>
namespace bn {
namespace util {
/**
* Applies binary functions @a s and @a p to the sequence of elements in the
* cartesian pro... |
199e2c053aca5f3ebd80efb517c3484ba2e49707 | b5883904465506ea67637dfbc3220c5e25ff5189 | benniaobufei/HaiZeiOJ | /HZOJ/204.cpp | C++ | cpp | 587 | no_license | /*************************************************************************
> File Name: 204.cpp
> Author:
> Mail:
> Created Time: 2020年08月16日 星期日 20时40分16秒
************************************************************************/
#include<iostream>
using namespace std;
int arr[35][35],num[1000];
int main(){
... |
46086d067c7ce97dc6e5d9a9a6428e79916ff33a | 2eb126c9b1e3e2c1dc3d2035eacae01276487dfd | zzhao58/Zoey_Repos | /OOP345/WS02/at_home/Text.cpp | C++ | cpp | 1,621 | no_license | //ZHi Zhao (109079178)
#include <iostream>
#include <string>
#include <fstream>
#include "Text.h"
namespace sict {
Text::Text() {
stringlines = nullptr;
string_Num = 0;
}
Text::Text(char* fileName) {
string_Num = 0;
std::ifstream fin(fileName);
std::string line; //each line put in the line(temper),th... |
bb06d00578b9086cd145497c0e8249431e40b741 | 22d332e9138ca9d761b6ad98972b454766f8c558 | newmen/qt_solarSystem | /timecounter.cpp | C++ | cpp | 340 | no_license | #include "timecounter.h"
TimeCounter::TimeCounter(QWidget *parent) : _parent(parent), _counter(0) {
_timer = new QTimer(this);
connect(_timer, SIGNAL(timeout()), this, SLOT(tick()));
_timer->start(50);
}
TimeCounter::~TimeCounter() {
delete _timer;
}
void TimeCounter::tick() {
++_counter;
_p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.