blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
4aeee868256cae8c31f5a6d16039eec8374c1ac7 | C++ | deeptadevkota/Compiler-Design-lab | /Week_7/Q3/p1.cpp | UTF-8 | 3,239 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
struct equation
{
char lf;
string rt;
};
int main()
{
int n;
cin >> n;
equation inp[n];
for (int i = 0; i < n; i++)
{
cout << "\nEquation: " << i + 1 << endl
<< endl;
cout << "LHS:";
cin >> inp[i].lf;
co... | true |
58249c12929ce9236dc41de6d2e6d261f53c92a6 | C++ | RedaBoumediene/dp | /countNumberOfPalindromeSubstring.cpp | UTF-8 | 738 | 3.015625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int countSubstrings(string s) {
int n=s.size() , ans=0 ;
bool dp[n][n]={false};
for(int i=0;i<n;i++)
dp[i][i]=true , ans++;
for(int taille=2;taille<=n;taille++){
for(int i=0;i<=n-taille;i++){
int j=taille+i-1;
if(s[i]==s[... | true |
4b6183929b144776a807a8c2d300af7026968400 | C++ | tstr/TSEngine | /tools/rcschema/test/test.cpp | WINDOWS-1252 | 7,064 | 2.6875 | 3 | [
"MIT"
] | permissive | /*
Resource Schema Generator conformance tester
*/
#include <tscore/types.h>
#include <tscore/strings.h>
#include <sstream>
#include <iostream>
using namespace std;
using namespace ts;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Generated h... | true |
bbceac191c5f522aab99d9b8ca29ff74fd191166 | C++ | OliverGeisel/Matrix | /SQR_Matrix.cpp | UTF-8 | 472 | 2.9375 | 3 | [] | no_license |
#include "SQR_Matrix.h"
SQR_Matrix::SQR_Matrix(unsigned int n = 1) : Matrix(n, n, 0.0) {
}
SQR_Matrix::SQR_Matrix(unsigned int n, bool random = false) : Matrix(n, n, random) {
}
SQR_Matrix::SQR_Matrix(unsigned int n, double value = 0.0) : Matrix(n, n, value) {}
Matrix SQR_Matrix::Union_Matrix(unsigned int size)... | true |
073b79875da1448ed3e53f52e60a6f0f86d8183b | C++ | ifknot/rpp | /rpp/data_frame.h | UTF-8 | 631 | 2.65625 | 3 | [
"MIT"
] | permissive |
#pragma once
#include <unordered_map>
#include "data_types.h"
#include "variant_vector.h"
namespace R {
/**
* @brief As per R language definition the following are the characteristics of an R-ish data frame:
*
* + The column names should be non-empty.
* + The row names should be unique.
* + The data sto... | true |
0ca5b2803ff4e5ee0e1e650a525cf243242944c0 | C++ | Pinming/NOJ_201909 | /t002.cpp | UTF-8 | 414 | 2.78125 | 3 | [] | no_license | # include <iostream>
# include <iomanip>
using namespace std;
# define PI 3.1415926
int main()
{
double r, h, l, s, sq, vq, vz;
cin >> r >> h;
l = 2 * PI * r;
s = PI * r * r;
sq = 4 * PI * r * r;
vq = 4.0 / 3 * PI * r * r * r;
vz = s * h;
cout << setiosflags(ios::fixed) << setprecision(2);
cout << l << endl;
... | true |
90639aa8fb9f2656ad73506c135b810d5586f6c8 | C++ | enderdaniil/OOP_labs | /lab_4/3.cpp | UTF-8 | 326 | 3.46875 | 3 | [] | no_license | #include <iostream>
using namespace std;
void zeroSmaller(int &a, int &b)
{
if (a < b)
{
a = 0;
}
else
{
b = 0;
}
}
int main()
{
setlocale(LC_ALL, "Russian");
cout << "Введите числа(a и b): ";
int a, b;
cin >> a >> b;
zeroSmaller(a, b);
cout << "a = " << a << ", b = " << b;
return 0;
}
| true |
808e747ff32ef20401d2cd85cbc5dd610b044565 | C++ | avast/retdec | /deps/eigen/Eigen/src/Core/Dot.h | UTF-8 | 11,484 | 2.71875 | 3 | [
"MPL-2.0",
"MIT",
"Zlib",
"JSON",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"GPL-2.0-only",
"NCSA",
"WTFPL",
"BSL-1.0",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | // This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2006-2008, 2010 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, Yo... | true |
6eed45211ebb393f57a4e29d0dd9b8486c576a41 | C++ | de-passage/basics.cpp | /tests/balanced_binary_tree.cpp | UTF-8 | 1,643 | 3.4375 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <stdexcept>
#include "balanced_binary_tree.hpp"
#include "utility.hpp"
using BBT = BalancedBinaryTree<int>;
TEST(BalancedBinaryTree, DefaultCtor) {
BBT b{};
ASSERT_EQ(b.size(), 0_z);
ASSERT_EQ(b.begin(), b.end());
}
TEST(BalancedBinaryTree, ListCtor) {
BBT b{1, 2, 3, 4, 5, ... | true |
bb5cf39f653f3b04a251bc9944e658e08eac4a1a | C++ | leobelmontLu/DesignPattern | /FilterPattern/FilterPattern.cpp | UTF-8 | 4,186 | 3.171875 | 3 | [] | no_license | // FilterPattern.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "FilterPattern.h"
static void printPersons(std::vector<Person> persons);
int main()
{
std::vector<Person> m_VecPerson;
m_VecPerson.push_back( Person("Robert", "Male", "Single") );
m_VecPerson.push_back( Person("John", "Male", "Married") );
m_Vec... | true |
e4b86e3075424e109e5bcdabe7fac4e03f5ae994 | C++ | Manan007224/street-coding | /Leetcode/unique_paths.cpp | UTF-8 | 474 | 3.015625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vii;
class Solution {
public:
int uniquePaths(int m, int n) {
vii dp(m,vi(n));
for(int i=0; i<m; i++) dp[i][0] = 1;
for(int j=0; j<n; j++) dp[0][j] = 1;
for(int i=1; i<m; i++) {
for(int j=1; j<n; j++) {
dp[i... | true |
25a8957526b8a089994dfe02579e11c7beadc400 | C++ | lis0517/BOJ_ | /apr.2020after/20200505/n_2752/n_2752.cpp | UTF-8 | 1,478 | 2.90625 | 3 | [
"MIT"
] | permissive | // n_2752.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
//
#include <iostream>
using namespace std;
int main()
{
int a[3];
cin >> a[0] >> a[1] >> a[2];
//sort를 쓰면 쉽게 할수있지만..
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 2; ++j)
{
if (a[j + 1] < a[j])... | true |
19c52b0b0138758b5cf3181f2e206a6d8b89e3f0 | C++ | mikecancilla/CPlusPlusPlayground | /CPPPlayground/Tuple.cpp | UTF-8 | 331 | 3.09375 | 3 | [] | no_license | #include <string>
#include <tuple>
#include <iostream>
std::tuple<std::string, std::string> GetTuple()
{
return std::make_tuple("hello", "There");
}
void DoTupleStuff()
{
std::tuple<std::string, std::string> strings = GetTuple();
std::string s1 = std::get<0>(strings);
std::string s2 = std::get<1>(s... | true |
dbc5941339c31dd92c1809353a488bc05d2ed67e | C++ | westlicht/teensy-template | /src/TextWidget.h | UTF-8 | 1,219 | 2.984375 | 3 | [] | no_license | #pragma once
#include "Print.h"
#include "Painter.h"
class TextWidget : public Print {
public:
TextWidget(const Point &pos, const Size &size,
Painter::HAlignment hAlignment, Painter::VAlignment vAlignment,
Painter::Font font,
uint16_t foreground, uint16_t background) :... | true |
c7637873a6a450b8d48fbdf21ada042eec8a8107 | C++ | denis-gubar/Leetcode | /Hash Table/0325. Maximum Size Subarray Sum Equals k.cpp | UTF-8 | 449 | 2.578125 | 3 | [] | no_license | class Solution {
public:
int maxSubArrayLen(vector<int>& nums, int k) {
int result = 0;
int N = nums.size();
vector<int> cum(N + 1);
unordered_map<int, int> M;
M[cum[0]] = 0;
for (int i = 0; i < N; ++i)
{
cum[i + 1] = cum[i] + nums[i];
M[cum[i + 1]] = i + 1;
}
for (int i = 0; i <= N; ++i)
{
... | true |
38fba2860d71c64cbd02798bf6271b72e6afc701 | C++ | hoseogame/20121705 | /mini/Tetris/tetris.cpp | UHC | 8,696 | 2.75 | 3 | [] | no_license | #include "tetris.h"
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
//
void Tetris::Update()
{
int key = KeyInput();
switch( stage )
{
case INIT :
press_any_key( key );
break;
case READY :
level_select( key );
break;
case RUNNING :
m_block->Move( key );
// ٴ̳ ٸ Ҵٸ ħ
if( m_block->G... | true |
dcbbb74416c375c77fde190226dd660c03e0f8dc | C++ | yechang1897/algorithm | /Array/leetcode_15_3sum.cpp | UTF-8 | 7,281 | 3.15625 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
#include<set>
// #include<map>
using namespace std;
//先排序,然后遍历
// vector<vector<int>> threeSum(vector<int>& nums) {
// sort(nums.begin(), nums.end());
// int len = (int)nums.size();
// int l = 0, r = len - 1;
// int mid... | true |
31dcb31d65d9e03a91732324aac6b78b27ff3c9f | C++ | shriyam26/Data-Structures-and-Algortihms | /Tree/Inorder successor of BST.cpp | UTF-8 | 2,315 | 4.1875 | 4 | [] | no_license | // C program for above approach
#include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* minValue(struct node* node);
/*
If right subtree of node is not NULL, then succ lies in right subtree. Do the following.
Go to right subtree and return ... | true |
eb3d63fc0dc2390b9605dbdb89d94d81206f493e | C++ | bedjovski/iptool | /iptool/iptools/utility/utility.h | UTF-8 | 832 | 2.546875 | 3 | [] | no_license | #ifndef UTILITY_H
#define UTILITY_H
#include "../image/image.h"
#include <sstream>
#include <math.h>
class utility
{
public:
utility();
virtual ~utility();
static std::string intToString(int number);
static int checkValue(int value);
static void gamp(image &src, image &tgt, int ROI[3][6], int n); // gradie... | true |
bf56f5f89b286994a8f577b73ae7a046f8b076c9 | C++ | syo0e/Algorithm | /cpp/baekjoon/1003 fibonacci/main.cpp | UTF-8 | 540 | 2.953125 | 3 | [] | no_license | /*
피보나치 수에서 0이 나타나는 개수와 1이 나타나는 개수 또한 피보나치 수임을 수학적 귀납법으로 증명할 수 있다.
*/
#include <iostream>
using namespace std;
int main() {
int a[41],b[41];
int N,num;
a[0]=1, a[1]=0;
b[0]=0, b[1]=1;
for(int i=2; i<=40; i++)
{
a[i]=a[i-1]+a[i-2];
b[i]=b[i-1]+b[i-2];
}
scanf("%d... | true |
d32a021350bac77251bf26e5a19d5f2859feaaa3 | C++ | CSUF-CPSC121-2021S01/siligame-05-HRB-NO1 | /game.h | UTF-8 | 6,052 | 2.625 | 3 | [] | no_license | #ifndef GAME_H
#define GAME_H
#include <vector>
#include "cpputils/graphics/image.h"
#include "cpputils/graphics/image_event.h"
#include "game_element.h"
#include "opponent.h"
#include "player.h"
class Game : public graphics::AnimationEventListener,
public graphics::MouseEventListener {
publ... | true |
818d5114916ae806c403063b073f3e40d501d738 | C++ | TyRoXx/lua-cpp | /luacpp/sink_from_lua.hpp | UTF-8 | 969 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifndef LUACPP_SINK_FROM_LUA_HPP
#define LUACPP_SINK_FROM_LUA_HPP
#include <silicium/sink/sink.hpp>
#include "luacpp/stack.hpp"
namespace lua
{
template <class Sink>
struct sink_from_lua
{
explicit sink_from_lua(Sink original)
: m_original(std::move(original))
{
}
void append(lua::any_local elements, l... | true |
8a0dd253fb7c7ed7900d8a332098d4b586009f98 | C++ | 2quarius/SE347-DS | /lab1/rdt/rdt_receiver.cc | UTF-8 | 4,019 | 2.875 | 3 | [] | no_license | /*
* FILE: rdt_receiver.cc
* DESCRIPTION: Reliable data transfer receiver.
* NOTE: This implementation assumes there is no packet loss, corruption, or
* reordering. You will need to enhance it to deal with all these
* situations. In this implementation, the packet format is laid out as
* th... | true |
be480444f541389e14400a9a28cf87a969f41432 | C++ | calsaviour/sdc-term3 | /PVTPlanner_beta/PVTP/include/PVTP/PVT_S.hpp | UTF-8 | 2,983 | 3.046875 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef PVTP_S_H
#define PVTP_S_H
#include <iostream>
#include <PVTP/Interval.hpp>
#include <PVTP/TrajectorySegment.hpp>
namespace PVTP {
/**
* Interval set class. Objects of this class are used by the Forward
* algorithm to track and merge goal-reachable velocity intervals at PT
* points. The reachable inte... | true |
f8845a6c7003e6c2d552c7c0e90c1a4063bbc8e5 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/boost/multiprecision/concepts/mp_number_archetypes.hpp | UTF-8 | 8,262 | 2.921875 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"BSL-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | ///////////////////////////////////////////////////////////////
// Copyright 2012 John Maddock. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
#ifndef BOOST_MATH_CONCEPTS_ER_HPP
#define BOOST_MATH_CONCEPTS_ER_H... | true |
acc73d0eb4707e59cb646afcf7fd74068ec9c633 | C++ | mayank-tripathik/Geeksforgeeks | /Array/binary_search.cpp | UTF-8 | 854 | 3.453125 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int binary_search_recursive(vector<int> &arr, int low, int high, int k){
if(high<low)
return -1;
int mid=(high+low)/2;
if(k==arr[mid])
return mid;
if(k<arr[mid])
return binary_search_recursive(arr,low,mid-1,k);
else
return binary_search_recursive(ar... | true |
0cf6a22bac1e9ed8f7d9a0fcce400b0976c2849d | C++ | Ursus14/TeraVTK | /BrokenLine.cpp | UTF-8 | 792 | 2.59375 | 3 | [] | no_license | #include "BrokenLine.h"
BrokenLine::BrokenLine() {};
vtkPoints* BrokenLine::GetPoints() {
return this->points;
}
void BrokenLine::SetPoints(vtkPoints* points) {
this->points = points;
}
void BrokenLine::build(vtkPoints* points, vtkSmartPointer<vtkRenderer> renderer) {
vtkSmartPointer<vtkLineSource> lineSource =
... | true |
392724a21403fe61bfc36cde39313d4802ae1520 | C++ | neuenablingengineering/LIS-Eyetracking | /src/3D-Eye-Tracker/main/Subscriber.cpp | UTF-8 | 573 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "Subscriber.h"
Subscriber::Subscriber(PubSubHandler* p) {
psh = p;
}
void Subscriber::receiveMessage(EventMessage e) {
receivedMessageQueue.push(e);
readMessages();
}
void Subscriber::SubscribeToTopic(EventTopic t) {
psh->AddSubscriber(this, t);
}
void Subscriber::UnSubscribeToTopic... | true |
6a653c0a53982e571dfe982c2ee35382017aa90d | C++ | maayan92/experis_C_basicCpp | /cpp/tms/tokenizer.cpp | UTF-8 | 1,204 | 2.953125 | 3 | [] | no_license | #include "tokenizer.hpp"
#include <algorithm>
#include <ctype.h>
namespace experis {
static bool isDelimiter(const char a_element) {
return isspace(a_element) || (0 == isalnum(a_element));
}
Tokenizer::Tokens& Tokenizer::DivideIntoTokens(std::istream& a_inputFile) {
std::string wordFromFile;
while(getline(a_in... | true |
21dd67df7057813d2f1418a560aec1d3ecf4f706 | C++ | StefanKubsch/lwmf | /example/DemoSources/TextureRotationTest.hpp | UTF-8 | 1,099 | 2.875 | 3 | [
"LicenseRef-scancode-public-domain",
"Unlicense"
] | permissive | #pragma once
#include <cstdint>
#include <array>
#include <charconv>
namespace TextureRotationTest
{
inline lwmf::TextureStruct SourceTexture{};
inline void Init()
{
lwmf::LoadPNG(SourceTexture, "./DemoGFX/Head.png");
lwmf::ResizeTexture(SourceTexture, SourceTexture.Width * 3, SourceTexture.Height * 3, lwmf... | true |
f66b1de73fbc32e760b14bac1f9e1be8af87fe7f | C++ | NeverStopMata/MTRT | /MTRT/checker_texture.h | UTF-8 | 492 | 3.171875 | 3 | [] | no_license | #pragma once
#include "texture.h"
class CheckerTexture :public Texture {
public:
CheckerTexture() {}
CheckerTexture(Texture const * t0, Texture const * t1) : odd_tex_(t0), even_tex_(t1) {}
virtual Vec3 Sample(float u, float v, const Vec3& p) const {
float sin = std::sin(10 * p.x()) * std::sin(10 * p.y()) * std::si... | true |
9387e2b45d5271a3b90d6519661d2aab79c154ed | C++ | SSPKUZX/cpp-comm | /enum.h | UTF-8 | 2,195 | 3.078125 | 3 | [] | no_license | #include "ptr.h"
#include "traits.h"
#include "variadic.h"
#include "demangle.h"
namespace utl
{
template<class... Labels>
class Enum
{
static_assert( !has_duplicate<Labels...>::value, "no duplicate label classes allowed in Enum's template class arguments");
public:
// similar to equal
template<class T>... | true |
d2079b75565c980045b7472f92a40dd79c0b9d2f | C++ | DavidGoldMatejka/Black-Jack | /BlackJack/Card.h | UTF-8 | 528 | 3.5625 | 4 | [] | no_license | #pragma once
#include <iostream>
class Card{
public:
int value; // point value of the card (NOT THE ID!)
std::string name; // like Ace, One, Two, Three, ... Queen, King
std::string suit; // like Spades, Hearts, Diamonds, Clubs
Card(int ID = -1); // valid ID values go from 0 to ... | true |
20985f448eb2fa1113e3ff087c7120389f8f58bb | C++ | GaneshTambat/G-11_Project | /G11_Project/LightParticle.h | SHIFT_JIS | 3,280 | 2.625 | 3 | [] | no_license | //===========================================================
// Cgp[eBN
//Creater:Arai Yuhki
//===========================================================
#ifndef _LIGHT_PARTICLE_H_
#define _LIGHT_PARTICLE_H_
//===========================================================
//CN[h
//=======================================... | true |
0cea0d780dc0379b8c36d9c90756d9c6cb4c21a8 | C++ | ammitra/Grafana-Monitor | /src/main.cc | UTF-8 | 5,758 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include <net_helpers.hh>
#include <Sensor.hh>
#include <TimeSensor.hh>
#include <IpmiTemperatureSensor.hh>
#include <IpmiFanSpeedSensor.hh>
#include <ApolloBlade.hh>
#include <unistd.h>
#include <string>
#include <fstream>
#include <iostream>
#include <boost/program_options.hpp>
#include <stdexcept... | true |
71d8684099fc7c5a40d7e6326df5b206f83ec9af | C++ | shnoh171/problem-solving | /backjoon-online-judge/10972-next-permutation/next_permutation.cpp | UTF-8 | 1,414 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
bool NextPermutation(int list[], int n);
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
int list[n];
for (int i = 0; i < n; ++i) cin >> list[i];
if (NextPermutation(list, n))
for (int i = 0; i ... | true |
68d65af37bfe4955195c0f922ae6ef700f7924f7 | C++ | henfredemars/Fork-Lang | /parContextManager.cpp | UTF-8 | 8,849 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive |
//Implementation of the parallel statement execution manager
#include "parContextManager.h"
StatementContext::StatementContext() {
//Do nothing
}
StatementContext::StatementContext(StatementContext&& sc) {
this->int_future_id_map = std::move(sc.int_future_id_map);
this->float_future_id_map = std::move(sc.floa... | true |
a6ecc931ee6db2fa7240a5fa7709c2d31e6ec44b | C++ | AleixFerre/Advent-of-Code-2020 | /Day08/Day08-1/main.cpp | UTF-8 | 828 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int accumulator = 0, index = 0;
int len = 638;
vector<bool> visited (len, false);
vector<pair<string,int>> commands;
for (int i = 0; i < len; i++) {
string com;
int param;
cin >> com >> param;
... | true |
ac4dc6acf6270f9782d173810be189548222320e | C++ | arnabgho/competitive_programming | /lib/longest_increasing_path_matrix.cpp | UTF-8 | 1,067 | 2.6875 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> DP;
int n,m;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
bool isValid(int i,int j){
return 0<=i && i<n && 0<=j && j<m;
}
int dfs(int u,int v,vector<vector<int>>& matrix){
if(DP[u][v]!=-1)
return DP[u][v];
i... | true |
d64ff128d0e2b2a1cd80d6f9b4014519a1e52cf2 | C++ | c-Lris-xmu/bp | /main.cpp | GB18030 | 2,397 | 2.984375 | 3 | [] | no_license | //BP Neural Network
#include<iostream>
#include<fstream>
#include"headers/Matrix.hpp"
#include"headers/BP_net.h"
#include"headers/data_loader.h"
#include<Python.h>
#include<string>
using namespace std;
template<class T>
string creat_arr(T* arr, int n)
{
//c++תpythonlist
string str = "[";
for (int i = 0; i < n; i++)
... | true |
4233942bbd0b8a9fc5cbdc166f3c26c3f5a01402 | C++ | snate/memoco_ex | /ex2_heur/src_GA/TSPSelector.cpp | UTF-8 | 962 | 3.4375 | 3 | [] | no_license | /**
* @file TSPSelector.cpp
* @brief Provides a couple of parents for the GA
*
*/
#include "TSPSelector.h"
#include <iostream>
#include <algorithm>
using namespace std;
vector<TSPSolution*> TSPSelector::
takeTwoParents(const TSPPopulation& pop) {
vector<TSPSolution*> result;
result.resize... | true |
dc6f084b68f5b8a944a6e596cd10db05fe992364 | C++ | choyunhae/Online-Ticket-Exchange-System | /src/소프트웨어공학_3조/LogIn.cpp | UTF-8 | 505 | 2.5625 | 3 | [] | no_license | #include "LogIn.h"
//function : bool showLogIn(string inputID, string inputPassword)
//description : �α����� ���� �Լ�
//parameter : string inputID-�Է¹��� ���̵�, string inputPassword-�Է¹��� �н�����
bool LogIn::showLogIn(string inputID, string inputPassword){
bool logInMember=false;
MemberManager *memberManager = Mem... | true |
1108791e1d1717e986cd7e504c3679f709ab909f | C++ | patcain34/smallchess | /testingGit/main.cpp | UTF-8 | 439 | 2.5625 | 3 | [] | no_license | //
// main.cpp
// testingGit
//
// Created by Ibrahim Saeed on 10/8/14.
// Copyright (c) 2014 Ibrahim Saeed. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[])
{
// insert code here...
cout << "Hello, World!\n";
cout << "More changes!\n";
... | true |
2583b7429daf4218749dc193957fce1227c3d8c8 | C++ | alexandraback/datacollection | /solutions_1595491_0/C++/feigao/B.cpp | UTF-8 | 1,193 | 2.59375 | 3 | [] | no_license | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define For(i, a, b) for (int i = (a); i != b;... | true |
d3ad5e68f7ac3e2b0fdbe147e79de748769dc10b | C++ | cyrille42/2dGame | /src/SDL/Image.cpp | UTF-8 | 1,663 | 3 | 3 | [] | no_license | #include "Image.hpp"
Image::Image(SDL_Renderer* gRenderer, std::string str, int red, int green , int blue)
{
//The final texture
SDL_Texture* newTexture = NULL;
//Load image at specified path
SDL_Surface* loadedSurface = SDL_LoadBMP( str.c_str() );//IMG_LoadTexture
SDL_SetColorKey(loadedSurface, SDL_TRUE, SDL_Ma... | true |
7bff662c31b10b30889eb38b35324b22a73fbb8a | C++ | hfchong/fold | /tensorflow_fold/llgtm/examples/parsetree.h | UTF-8 | 3,734 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | /* Copyright 2017 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | true |
29864e4470f8e9a62bc0ebdc243033b3e6b72398 | C++ | alex-zinin/coursera_cpp_projects | /red_belt/week4/text_editor/main.cpp | UTF-8 | 7,145 | 3.359375 | 3 | [] | no_license | #include <string>
#include "test_runner.h"
#include<string_view>
#include"profile.h"
#include<list>
#include<deque>
#include<algorithm>
#include<iterator>
using namespace std;
class Editor {
public:
// Реализуйте конструктор по умолчанию и объявленные методы
Editor(): text(), buffer_size(0)
{
text... | true |
ac687b0dc28ac680d5c19bd8076c02e21bfe1403 | C++ | Quinny/Online-Judge | /euler/034 Digit factorials.cpp | UTF-8 | 420 | 3.546875 | 4 | [] | no_license | #include <iostream>
int fact(int);
int factDigits(int);
int main(){
int ans = 0;
for(int i = 3; i <= 40585; i++){
if(i == factDigits(i)) ans += i;
}
std::cout << ans << std::endl;
return 0;
}
int fact(int n){
if(n == 0)
return 1;
int ans = n;
for(int i = n - 1; i >= 2; i--)
ans *= i;
return ans;
}
in... | true |
4acaf05cd3a62fedf1f19e7ee0da12cfb3ca2000 | C++ | Siriayanur/DSA | /DP/421PaintingFence.cpp | UTF-8 | 591 | 2.84375 | 3 | [] | no_license | #include<iostream>
using namespace std;
long long paintFence(int n,int k){
int mod = 1000000007;
if(n == 0 || k == 0){
return 0;
}
if(n == 1){
return k;
}
long long same = (k * 1) % mod;
long long diff = (k * (k - 1)) % mod;
long long total = (same + diff) % mod;
... | true |
1071871bf863d7424004738f5c87202980c75c61 | C++ | joses97/SanchezJose_CSC5_41202 | /Class/Savitch__8thEd_Chapt2_Prob12_V2/main.cpp | UTF-8 | 1,202 | 3.484375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Jose Sanchez
* Purpose: Uses loop to end calculation
* Created on January 14, 2016, 10:29
*/
//System Libraries
#include <iostream>
#include <cmath>
using namespace std;
//User Libraries
//Global Constants
//Function prototypes
//Execution Begins Here
int main(int argc, char**... | true |
99facb61ef312a2c54c4882598239ccd765eb68d | C++ | SaberDa/LeetCode | /C++/246-strobogrammaticNumber.cpp | UTF-8 | 407 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <unordered_map>
using namespace std;
bool isStrobogrammatic(string num) {
string s = "";
if (num.empty()) return false;
unordered_map<char, char> mp{{'1', '1'}, {'6', '9'}, {'8', '8'}, {'9', '6'}, {'0', '0'}};
for (auto c : num) {
if (!mp.count(c)) return false;
... | true |
6eabbb41d2266c28551997454808bdf01833378c | C++ | marco-chen4u/sort | /main.cpp | UTF-8 | 6,428 | 3.8125 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
void printArr(int *arr, int len) {
for (int i = 0; i < len; ++i) {
cout << setw(5) << arr[i];
}
cout << endl;
}
// 1.直接插入排序
void insertSort(int *arr, int len) {
for (int i = 1; i < len; ++i) { // 从第2个元素开始插入,原始单个元... | true |
9271353501287bcd05f6cda4e51c11ea4175674b | C++ | namane88/3d | /src/math/mat4.h | UTF-8 | 679 | 3.0625 | 3 | [] | no_license | #ifndef MAT4_H
#define MAT4_H
#include <iostream>
#include <assert.h>
#include <cstring>
#include <math.h>
namespace math
{
class Mat4
{
private:
float values[16];
public:
Mat4();
Mat4(float value);
float *ref();
float& operator[](const int index) {
assert( index >= 0 && index <= 16);
... | true |
6ee46f6c5aea354152071504c92faf1ddf2222ef | C++ | luzhlon/cpp | /relayer/Tcp.h | GB18030 | 1,647 | 2.578125 | 3 | [] | no_license | #ifndef __TCP_H_
#define __TCP_H_
#include "stdlib.h"
#include "string.h"
#define __WINDOWS__ 1
#ifdef __WINDOWS__
#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#include "WinSock2.h"
#endif
#endif
class TcpConnect
{
public:
static void InitSocketLib();
public:
TcpConnect(SOCKET sock = NULL)... | true |
7fb7b31a4af2fc59a49116bf5cb32f961fbeecd1 | C++ | Daedalus1400/Crypto_Nightmare | /src/main.cpp | UTF-8 | 686 | 2.765625 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Daedalus
*
* Created on May 5, 2015
*/
#include <cstdlib>
#include <iostream>
#include <vector>
#include <thread>
#include "ThreadedEnigma.h"
#include "Timer.h"
#include "FileHandler.h"
using namespace std;
void PrintfromVector(vector<byte>);
int main() {
Timer * time = new Timer()... | true |
187bda373954375e38c9cf57f3345693b325ff23 | C++ | lasagnaphil/altmath | /tests/vec_simd_test.cpp | UTF-8 | 3,749 | 3.046875 | 3 | [
"MIT"
] | permissive | //
// Created by lasagnaphil on 19. 8. 22..
//
#include "simd/vec2dx4.h"
#include "simd/vec3dx4.h"
#include "doctest.h"
TEST_CASE("vec2dx4 works") {
SUBCASE("Is POD") {
CHECK(std::is_pod<vec2dx4>());
}
SUBCASE("Arithmetic") {
vec2d a[4], b[4];
for (int i = 0; i < 4; i++) {
... | true |
c4d727b7c3af68017c2b6869085c1111b7658c00 | C++ | Fedor-Sharygin/GAM550TechDemo | /Objects/Components/ParticleEmitter.h | UTF-8 | 1,303 | 2.703125 | 3 | [] | no_license | #pragma once
#ifndef _PARTICLE_H_
#define _PARTICLE_H_
#include "..//Component.h"
struct Particle
{
glm::vec3 position;
glm::vec3 velocity;
glm::vec4 color;
float lifeTime;
Particle()
:
position(glm::vec3(0.0f)), velocity(glm::vec3(0.0f)),
color(glm::vec4(0.0f)), lifeTime(-1.0f) /// negative, so that ... | true |
11b0eda70b98cbd0aaf4bec6a39ee2e5de1ab6bb | C++ | hudovisk/Allegro | /Allegro/include/Vector.h | IBM852 | 644 | 3.09375 | 3 | [] | no_license | /*
* Vector.h
*
* Created on: 04/08/2013
* Author: Hudo Cim Asseno
* Author: Felipe Ukan Pereira
*/
#ifndef VECTOR_H_
#define VECTOR_H_
#include <cmath>
class Vector
{
public:
Vector(float xx, float yy) : x(xx), y(yy) { }
Vector() : x(0), y(0) { }
float getX() { return x; }
fl... | true |
79d1d21d987e816b3e98562457e94220eba26214 | C++ | kapoorkhushal/CPP-Programs-Basic | /q10.cpp | UTF-8 | 828 | 3.796875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class student
{
char* name;
int rollno;
int age;
float marks;
public:
student(){
name = NULL;
rollno = 0;
age = 0;
marks = 0;
}
void input();
void display();
};
void student :: input(){
name = new char[25];
cout<<"Enter Name : ";
fgets(name,25,stdin);
cout<... | true |
1773b5b241483239e0de574dc7504e33a45edc6b | C++ | cup2of2tea/contests | /codeforces/355 Codeforces Round #206 (Div. 2)/355B.cpp | UTF-8 | 745 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int tot_cost(int cseul,int cmono,vector<int> &v)
{
int res=0;
for(int c=0;c<v.size();c++)
{
res+=min(cseul*v[c],cmono);
}
return res;
}
int main()
{
int s1=0;
int s2=0;
int N,M;
int c1,c2,c3,c4;
ci... | true |
7ccfbfd2df55f02576c6665e0635e4d89d0a392a | C++ | attatrol/made_2019_2_algorithms | /5_6/main.cpp | UTF-8 | 8,137 | 3.578125 | 4 | [] | no_license | /**
* F. RMQ наоборот
*
* ввод rmq.in
* вывод rmq.out
*
* Рассмотрим массив a[1..n].
* Пусть Q(i, j) — ответ на запрос о нахождении минимума среди чисел a[i], ..., a[j].
* Вам даны несколько запросов и ответы на них.
* Восстановите исходный массив.
*
* Входные данные
* Первая строка входного файла содержит ... | true |
d46fd003ad165cf7bf1927dc4bac6518d224db11 | C++ | TLMSONANA/CUGSECourses | /剑指offer/数组中只出现一次的数字.cpp | UTF-8 | 679 | 3.015625 | 3 | [] | no_license | class Solution {
public:
void FindNumsAppearOnce(vector<int> data,int* num1,int *num2) {
int n=0;
for(int i=0;i<data.size();i++){
n=n^data[i];
}
int index=findFirst1(n);
*num1=*num2=0;
for(int i=0;i<data.size();i++){
if(((data[i])>>index)&1){*n... | true |
aaa7c0a9baa97c446b49ff423a04f3f0f753df4c | C++ | Teolink/Cpp_L-Calculus_Compiler | /Compiler.cpp | UTF-8 | 3,746 | 3.234375 | 3 | [] | no_license | // Name: Theodoros Gatsos
// Record Number: 1115200200013
// Semester: 5th
// University of Athens
// Department of Informatics and Telecommunications
// Subject: Principles of Programming Languages
// February 2005
// Project: Implementation of a lambda calculus compiler
// File: Compiler.cpp
#include "Compil... | true |
2c65b1051b3b82c00afe7130ba0500e72744db33 | C++ | KwokShing/POJ | /1088.cpp | UTF-8 | 1,403 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int search(int x, int y, int **matrix, int **dp, const int &row, const int &col) {
if(dp[x][y] > 0)
return dp[x][y];
int val = 1;
if(x-1 >= 0 && matrix[x-1][y] < matrix[x][y])
val = max( search... | true |
79cf7c3d7851bae963e4b59a55075fc2151d765e | C++ | scratchingmycranium/programmingLangTranslators | /hw3.cpp | UTF-8 | 3,153 | 2.5625 | 3 | [] | no_license | //Adapted from: Hello.cpp - Example code from "Writing an LLVM Pass"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Function.h"
#include "llvm/Pass.h"
#include "llvm/IR/CallSite.h"
#include "llvm/Support/raw_ostream.h"
#include <iostream>
#include "llvm/IR/Module.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Argu... | true |
92762e574366435539908eea89ae7e9ea57f7ebf | C++ | pallas/liboco | /socket_address.h | UTF-8 | 1,092 | 3.140625 | 3 | [
"Zlib"
] | permissive | #ifndef SOCKET_ADDRESS_H
#define SOCKET_ADDRESS_H
#include <cstring>
#include <sys/socket.h>
class socket_address {
public:
virtual sockaddr & cast() = 0;
virtual const sockaddr & cast() const = 0;
virtual socklen_t length() const = 0;
int protocol() const;
int family() const;
bool is_inet() const;
... | true |
3dc2f465e589570c69bab321ff1b0f9fa4a2f003 | C++ | Schwaigs/Planning_optimisation | /src/Population.cpp | UTF-8 | 3,975 | 2.90625 | 3 | [] | no_license | #include "Population.h"
using namespace std;
// initialisation d'une population de solutions
Population::Population(int tp, int tc)
{
taille_pop = tp;
individus = new Chromosome*[taille_pop];
for (int i=0; i<taille_pop; i++)
individus[i] = new Chromosome(tc);
ordre = new int[taille_pop];
}
// de... | true |
e6870963590c52093a12005eb5e6634645ba6a6b | C++ | xiaogang00/Leetcode | /C++/Word_Ladder.cpp | UTF-8 | 1,637 | 3.03125 | 3 | [] | no_license | //
// Created by Theo on 2017/9/20.
//
class Solution {
public:
int ladderLength(string beginWord, string endWord, vector<string>& wordList) {
int dis=1;
int len=wordList.size();
int *visit=new int[len];
memset(visit,0,len*sizeof(int));
queue<string> q;
for (int i=0... | true |
0a37678ad2b89d00b5ea0216a753d75937608fe5 | C++ | edd3173/BOJ | /BOJ15651.cpp | UTF-8 | 545 | 2.671875 | 3 | [] | no_license | #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
using namespace std;
int N, M;
bool visited[10] = { false, };
int arr[10] = { 0,1,2,3,4,5,6,7,8,9 };
void Solve(int cnt) {
if (cnt == M) {
for (int i = 0; i < M; i++)
prin... | true |
4fb328d8892835762d76f9b733c36f63758e82cf | C++ | victorursan/Contest_CPP | /Contest_CPP/Controller.cpp | UTF-8 | 3,727 | 3.3125 | 3 | [] | no_license | //
// Controller.cpp
// Contest_CPP
//
// Created by Victor Ursan on 4/2/15.
// Copyright (c) 2015 Victor Ursan. All rights reserved.
//
#include "Controller.h"
Controller::Controller(AbstractRepository<Participant>* repo) {
/* Initializes Controller
*/
this->repository = repo;
}
Controller::~Controller()... | true |
c50f8d6c2e88d5b1e6ecb035cdd84c2bcdcaffd5 | C++ | pemayfes2020/drone-pc | /testsuite/main/thread_test.cpp | UTF-8 | 1,351 | 3.296875 | 3 | [] | no_license | #include "safe_exit.hpp"
#include <chrono>
#include <iostream>
#include <thread>
// コンストラクタとデストラクタが呼ばれることを確認するだけのクラス
class A
{
public:
A()
{
std::cout << "constructor" << std::endl;
}
~A()
{
std::cout << "destructor" << std::endl;
}
};
void work()
{
// スレッド内でenterする
T... | true |
260d76870904c47051001ae38f25833151d0ddf6 | C++ | chenchukun/UNP | /muduo/net/eventLoop.cpp | UTF-8 | 2,092 | 2.859375 | 3 | [] | no_license | //
// Created by chenchukun on 18/3/28.
//
#include <muduo/net/EventLoopThread.h>
#include <muduo/net/EventLoopThreadPool.h>
#include <muduo/net/EventLoop.h>
#include <muduo/base/ThreadLocal.h>
#include <muduo/net/TcpServer.h>
#include <muduo/net/InetAddress.h>
#include <iostream>
#include <string>
using namespace mudu... | true |
712be8752ef7be8ef499971b80b07b8250fb5f14 | C++ | bakkiraju/sharpenskills | /Dynamic Programming/LCS.cpp | UTF-8 | 848 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
int LCSHelper(string X, string Y, int m, int n, unordered_map<string, int> &cache)
{
if (m == 0 || n == 0) return 0;
string key = to_string(m)+'|'+to_string(n);
if (cache.find(key) != cache.end())
{
return c... | true |
f3f51569532c6905e1f289766e29f50e0685b4dd | C++ | lmalano/informaticaC | /suma y multiplicacion de matrices.cpp | UTF-8 | 2,467 | 3.453125 | 3 | [] | no_license | #include <iostream>
using namespace std;
const int dim=20;
void cargar_matriz (int [dim][dim], int, int);
void mostrar_matriz (int [dim][dim], int, int);
void sumar (int [dim][dim], int [dim][dim], int, int);
void multiplicar (int [dim][dim], int [dim][dim], int , int, int );
void ordenar (int [dim][dim], int, int);
vo... | true |
36d5678fb7bf6ef87139a69f376b3bf9c681f289 | C++ | AlexWuDDD/TDDCPP | /src/c5/1/PlaceDescriptionServiceTest.cpp | UTF-8 | 1,602 | 2.875 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "Http.h"
#include "PlaceDescriptionService.h"
using namespace testing;
class APlaceDescriptionServiceTest : public Test
{
public:
static std::string ValidLatitude;
static std::string ValidLongtitude;
};
std::string APlaceDescriptionServiceTest::Valid... | true |
1e203eb5d7a7e2bc7e1278ac92c03b6d62dd42d4 | C++ | apreak/CharSetTool | /ICharSet.h | GB18030 | 703 | 3.25 | 3 | [] | no_license | #pragma once
#include <string>
class ICharSet
{
public:
// ȡַַָ
virtual void Read(const char *pstr) = 0;
// ַַָ
virtual void Write(char *pstr) = 0;
// ĬϸʽָǰC++ʹõĸʽ
// ȡĬϸʽַ
void ReadNative(const std::wstring &wstr);
// Ĭϸʽַ
void WriteNative(std::wstring &wstr);
// խַת
static std::string ... | true |
a6d9711f9c6e0c2c67a4a36b091aa2745790baea | C++ | sujeet05/CLRS-Algorithms | /Graphs/StronglyConnectedComponent.cpp | UTF-8 | 10,912 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<list>
#include<vector>
#include<queue>
#include<algorithm>
#define PARENT 99999
using namespace std;
enum color
{
W=0,
G,
B
};
class vertix
{
private:
int m_name;
vertix* m_parent;
color m_clr;
int m_stime;
int m_etime;
public:
vertix(int _name,vertix* _p... | true |
6401dece1e68c3514b13a81d25945a4e3c7ea828 | C++ | Akaflieg/startkladde | /src/util/environment.cpp | UTF-8 | 755 | 2.625 | 3 | [] | no_license | /*
* environment.cpp
*
* Created on: 14.07.2010
* Author: Martin Herrmann
*/
#include "environment.h"
#include <cstdlib>
#include "src/i18n/notr.h"
/**
* Gets the contents of an environment variable
*
* @param name the name of the environment variable
* @return the contents of the environment variabl... | true |
421c5163e0b50070659420647bc1319ac0edbbb9 | C++ | waveform/leetcode | /algo/cpp/reverse_integer.cc | UTF-8 | 1,162 | 2.984375 | 3 | [] | no_license | class Solution {
public:
// handle as string
/*
int reverse(int x) {
string in = to_string(x);
string minimal = to_string(INT_MIN).substr(1), maximal = to_string(INT_MAX);
bool negative = false;
if (in[0]=='-') {
negative = true;
in = in.substr(1);
... | true |
b193d149630643e3d7653d3e10a956f43b759225 | C++ | MilaBits/Direct2D-Game-Engine-Framework | /SimpleGame/Utils.cpp | UTF-8 | 2,024 | 3.015625 | 3 | [] | no_license | #include "Utils.h"
#include <cstdio>
#include <corecrt_malloc.h>
#include <cmath>
#include <iostream>
#define DATA_OFFSET_OFFSET 0x000A
#define WIDTH_OFFSET 0x0012
#define HEIGHT_OFFSET 0x0016
#define BITS_PER_PIXEL_OFFSET 0x001C
#define HEADER_SIZE 14
#define INFO_HEADER_SIZE 40
#define NO_COMPRESION 0
#define MAX_NUM... | true |
d1d073248981b6fee2276ce2c87e2f57b6ad1833 | C++ | samanseifi/Tahoe | /toolbox/src/C1functions/ErrorFunc.cpp | UTF-8 | 4,924 | 2.953125 | 3 | [
"BSD-3-Clause"
] | permissive | /* $Id: ErrorFunc.cpp,v 1.8 2011/12/01 20:25:15 bcyansfn Exp $ */
#include "ErrorFunc.h"
#include <cmath>
#include <iostream>
#include "ExceptionT.h"
#include "dArrayT.h"
#include "Gamma.h"
using namespace Tahoe;
const int ITMAX = 100;
const double EPS = 3.0e-7;
const double FPMIN = 1.0e-30;
/*
* constructors
*/
E... | true |
b96b1fb4019ee88faf2d94491dc71d1d9b0b5430 | C++ | DanielRourke/DataStructure | /DataStructure/Assignment1-mapBased/SmartPlayer.h | UTF-8 | 924 | 2.921875 | 3 | [] | no_license | #pragma once
#include "Player.h"
class SmartPlayer :
public Player
{
public:
SmartPlayer() : Player() {};
SmartPlayer(int i, string name = "Smart Player") : Player(i, name) {};
~SmartPlayer() {};
Move getMove(Board & board)
{
priority_queue<Move, vector<Move>, less<vector<Move>::value_type>> bestMove;
list<Mo... | true |
7ef06bbc57f5aecf8998b792a84f986cd77b642c | C++ | DeepikaNarayanaswamy/cg | /timer.cpp | UTF-8 | 1,282 | 2.515625 | 3 | [] | no_license | #include<GL/glut.h>
#include<iostream>
using namespace std;
int x[4]= {100,200,100,200};
int y[4]= {100,200,200,100};
float trans[3][3]= {{0.5,0,0},{0,1,0},{0,0,1}};
int x1=100,x2=100,y1=100,y2=200,count=0;
void myinit()
{
glClearColor(1.0,1.0,1.0,1.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glPointSize(1... | true |
6e8546978a8619f70b265f29193e12a09460f9a2 | C++ | arjkashyap/competitive-coding | /code arena/rgb.cpp | UTF-8 | 1,410 | 2.875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void Display(int *a, int n){
for( int i = 0; i < n; i++ ) printf("%d ", a[i]);
printf("\n");
}
void InputRGB(int *a, int interval, int time){
for(int i = interval; i < time; i+= interval){
int index = 0;
while(index < interval){
a[i]... | true |
9d2aed111b6760a5b0f5360f7295585c75066e3d | C++ | etremel/pddm | /src/messaging/AggregationMessage.h | UTF-8 | 7,804 | 2.71875 | 3 | [] | no_license | /*
* AggregationMessage.h
*
* Created on: May 18, 2016
* Author: edward
*/
#pragma once
#include <cstddef>
#include <memory>
#include <iterator>
#include <ostream>
#include <unordered_map>
#include <vector>
#include <mutils-serialization/SerializationSupport.hpp>
#include "../FixedPoint_t.h"
#include "../... | true |
86657dd674190d0f485c7f0f105f5376569f3aaf | C++ | sjzlyl406/Practice | /test81.cpp | UTF-8 | 1,342 | 3.34375 | 3 | [
"LicenseRef-scancode-boost-original"
] | permissive | /*************************************************************************
> File Name: test81.cpp
> Author: leon
> Mail: sjzlyl406@163.com
> Created Time: 2015年07月16日 星期四 20时43分10秒
************************************************************************/
/********************************************************... | true |
7db644a5f477ddfb11e50f88e122aa939fe9e2ab | C++ | tick7tock7/Object-oriented-C-- | /ContactList/Contact.h | WINDOWS-1251 | 656 | 3.109375 | 3 | [] | no_license | /*
* Contact.h
*/
#ifndef CONTACT_H
#define CONTACT_H
#include <iostream> // << >>
using namespace std;
class Contact
{
friend istream& operator >> (istream& a, Contact& e);
friend ostream& operator << (ostream& a, const Contact& e);
public:
//
Contact();
//
const char* getName() co... | true |
b223682d00bdbeb7165da90667ef16f66fcd67ab | C++ | denthos/heliocentric | /Heliocentric/Client/orbital_camera.cpp | UTF-8 | 2,466 | 2.78125 | 3 | [] | no_license | #include "orbital_camera.h"
#include <glm\gtc\matrix_transform.hpp>
#define RESET_KEY "ResetKey"
inline int toLower(int c) {
return c >= 97 && c <= 122 ? c - 32 : c;
}
OrbitalCamera::OrbitalCamera(KeyboardHandler & keyboardHandler, MouseHandler & mouseHandler, const std::vector<GameObject *> & selection) : selecti... | true |
6bf108096224e8b1a57389bf19faa69e26fcb84e | C++ | nazirdilshad/CodingProblems | /codeforces/1353/C.cpp | UTF-8 | 456 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void solve()
{
long long n;
cin >> n;
long long sum = 1, i = 1, cnt = 0;
if (n == 1)
{
cout << 0 << endl;
return;
}
else
{
while (sum != n * n)
{
cnt += (i * i) * 8;
sum += (8 * i);
... | true |
b1fe5f23a79c5dc320400f327b5dd250e50830a8 | C++ | shuanglengyunji/Mp3Player | /Interface/Mp3Player/mainwindow.cpp | UTF-8 | 2,009 | 2.75 | 3 | [] | no_license | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); //窗口总在最前+取消关闭按钮
setWindowFlags(windowFlags() | Qt::CustomizeWindowHint); ... | true |
cf840e0e075bba0d25d22f56b5a96b07081f0734 | C++ | wenyi214/Qusetion-bank | /Trie .cpp | GB18030 | 3,098 | 4.03125 | 4 | [] | no_license | ֻDZǰַͬǰͬγһµķ֧
ʼmapͷڵ
ǰ
ַ
Ҫõңmap棬keyΪַvalueΪ㡣keyַvalueͬһַַ
ַʱͬǰõͬĽ㡣
ҪһisEndǷߵַβ
㣺
ȱ浱ǰĽ㣬mapжӦַsecondΪգ˵ûиַ½ڵ㣬ӣߵһ㡣
isEndΪtrue
void insert(string word) {
//浱ǰ
Trie *head = this;
for (auto ch : word){
//Ϊգ˵ûйַ
if (head->m[ch] == nullptr){
//һַһµmapheadָһ㣬mapֻһַ
//Կظġ
head->m[ch] = new Trie();
}
//ߵһ
... | true |
a3186de12545ee752811a635c028c851aae38065 | C++ | NarenMadham/Problem-Solving-Using-Data-Structures-and-Algorithms | /ARRAYS/Kadane's_algorithm.cpp | UTF-8 | 652 | 2.578125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b){
if( a > b ){
return a;
}else{
return b;
}
}
int main()
{
int t;
cin>>t;
while(t--){
int n;
cin>>n;
long long int arr[n];
for(int i=0;i<n;i++){
... | true |
6c1c10284b30ca47379ff48111ae050603c0e1d7 | C++ | stevecarren/framework-arduinolinkit7697 | /libraries/LBLE/examples/ScanPeripherals/ScanPeripherals.ino | UTF-8 | 2,187 | 2.65625 | 3 | [] | no_license | /*
This example scans nearby BLE peripherals and prints the peripherals found.
created Mar 2017 by MediaTek Labs
*/
#include <LBLE.h>
#include <LBLECentral.h>
void setup() {
//Initialize serial
Serial.begin(9600);
// Initialize BLE subsystem
Serial.println("BLE begin");
LBLE.begin();
... | true |
24de10101fc3876fc35380d48257f7e6b1176739 | C++ | xiazhiyiyun/C-Primer | /Unit15/Exercise15.6/Bulk_quote.h | UTF-8 | 551 | 3 | 3 | [] | no_license | #ifndef _BULK_QUOTE
#define _BULK_QUOTE
#include <string>
#include <iostream>
#include "Quote.h"
class Bulk_quote:public Quote
{
public:
Bulk_quote():min_qty(0),discount(0.0)
{}
Bulk_quote(const std::string & _isbn,double _price,std::size_t _qty,double _discount):
Quote(_isbn,_price),min_qty(_qty),discount(_d... | true |
bd8ee4aa928bcfee055f237cb235880d55c57508 | C++ | guinao/LeetCode | /Convert Sorted List to Binary Search Tree.cpp | UTF-8 | 758 | 3.578125 | 4 | [] | no_license | #include <cstdio>
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
private:
TreeNode* covert(ListNode* begin, List... | true |
5741a2ef9c45fd2fc7eefdf37c59b4cc9e87f211 | C++ | NewBornSun/Energia | /NewTempSensor/NewTempSensor.ino | UTF-8 | 434 | 2.53125 | 3 | [] | no_license | void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop()
{
// put your main code here, to run repeatedly:
int temperature_counts = analogRead(A19);
float val = temperature_counts*1.821/2304;
float temperature_Celsius = (10.888-sqrt(118.548544+0.01388*(1777.3-val*1000.0))... | true |
8a1adf3dfd5d3839d7834dffc2eb6e5e0db955ad | C++ | DVRodri8/Competitive-programs | /OnlineJudgeUVa/C++/100-9999/893 - Y3K Problem/main.cpp | UTF-8 | 881 | 3 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main(){
int remaining, day, month, year, passed;
while(cin >> remaining >> day >> month >> year && month != 0 && day != 0){
while(remaining > 0){
switch (month) {
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
... | true |
7e98043a4d99059c64953aa9b263fe6875bf3010 | C++ | hahahu91/oop | /lab6/StudentTest/tests.cpp | WINDOWS-1251 | 1,793 | 3.59375 | 4 | [] | no_license | #include "pch.h"
#include "lab6/CStudent.h"
TEST_CASE("CStudent can return yourself name, surname, patronymic and age")
{
CStudent student("Ivanov", "Ivan", "Ivanovich", 25);
CHECK(student.GetName() == "Ivanov");
CHECK(student.GetSurname() == "Ivan");
CHECK(student.GetPatronymic() == "Ivanovich");
CHECK(student.G... | true |
6c66b9a167ac1f25eca8bcdc991187254128a3fb | C++ | benjaminhuanghuang/ben-leetcode | /1011_Capacity_To_Ship_Packages_Within_D_Days/solution.cpp | UTF-8 | 995 | 3.3125 | 3 | [] | no_license | /*
1011. Capacity To Ship Packages Within D Days [Medium]
https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/
*/
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
/*
https://blog.csdn.net/fuxuemingzhu/article/details/88769103
https://www.youtube.com/watch?v=t2eQB9-... | true |
457306f28178cd618dc86fe795b80bddb8300105 | C++ | feynard/mesh | /list.hpp | UTF-8 | 5,081 | 3.734375 | 4 | [] | no_license | #ifndef LIST_HPP
#define LIST_HPP
// Generic, oredered, doubly linked list
using namespace std;
template <class D>
class List {
private:
// Inner data container
struct Node {
D var;
Node* next;
Node* prev;
Node(const D & x): var(x), next(0), prev(0) {}
};
Node* root... | true |