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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ca0f78147b5ca64696346c1e944d8f3924b315ea | C++ | madhavsarpal100/CPP-Practice | /graph/bfs.cpp | UTF-8 | 1,183 | 3.21875 | 3 | [] | no_license | //traverse a graph in bfs order
//input in the form of no of vertices v and edges e
//followed by e pairs of links bw vertces ..stored in adjacency matrix
#include <iostream>
#include <queue>
using namespace std;
void traverse(int **arr,int v,int sv,bool* pushed)
{
queue<int> q;
q.push(sv);pushed[sv]=true;
//cou... | true |
6cc7ff5ee7fe99f7987ea98da167a3edea843ff9 | C++ | xenowits/cp | /practice/XXXXX_codeforces1.cpp | UTF-8 | 1,383 | 2.59375 | 3 | [
"MIT"
] | permissive | //xenowitz -- Jai Shree Ram
#include<bits/stdc++.h>
using namespace std;
#define fori(i,a,b) for (int i = a; i <= b ; ++i)
#define ford(i,a,b) for(int i = a;i >= b ; --i)
#define mk make_pair
#define mod 998244353
#define pb push_back
#define ll long long
#define ld long double
#define MAXN (ll)1e6+5
#define rnd mt199... | true |
51a8b02b4453ba587abd3857358152646898e932 | C++ | turingcompl33t/epic | /include/epic/bag.hpp | UTF-8 | 1,260 | 3.03125 | 3 | [] | no_license | // bag.hpp
#ifndef EPIC_BAG_H
#define EPIC_BAG_H
#include <cstddef>
#include <optional>
#include "epoch.hpp"
#include "deferred.hpp"
namespace epic
{
// the maxmimum number of objects a bag may contain
// TODO: make 64 in non-debug build
constexpr static size_t const MAX_OBJECTS = 4;
// A bag of de... | true |
3829011e14ac630b26bdf004e4e2f62326875f62 | C++ | Darkhunter9/24-780_CPP_OpenGL | /new.cpp | UTF-8 | 301 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
void swapInt(int a[2])
{
int c;
c=a[0];
a[0]=a[1];
a[1]=c;
}
int main(void)
{
int n[2] = { 1, 2 };
// n[0]=1;
// n[1]=2;
printf("Before: n[0]=%d n[1]=%d\n",n[0],n[1]);
swapInt(n);
printf("After: n[0]=%d n[1]=%d\n",n[0],n[1]);
return 0;
}
| true |
e39ea5aca56a61a322f9f32d60aaf72a42272890 | C++ | mayankwadhawan/ray-tracing-computer-graphics | /src/librt/Sphere.cpp | UTF-8 | 3,300 | 3.1875 | 3 | [] | no_license | //----------------------------------------------------------------
// Sphere.cpp
//----------------------------------------------------------------
#include "Sphere.h"
#include <assert.h>
#include <stdio.h>
#include <string>
#include "defs.h"
#include <cmath>
// constructor
Sphere::Sphere(void)
: m_radius(0.5) {
... | true |
86e98e15740ad39dc8d1ba0120e9ccff5ce58c58 | C++ | JackLovel/excuise- | /PrimerCppV5/chapter1/ex.1.11.cpp | UTF-8 | 423 | 3.8125 | 4 | [] | no_license | // 比较两数大小使用递归
#include <iostream>
using std::cout;
using std::cin;
void printResult(int lo, int hi)
{
if(lo > hi)
{
printResult(hi, lo);
return;
}
for(int i = lo; i != hi; ++i)
cout << i << " ";
}
int main()
{
int low = 0, high = 0;
cout << "Enter two nu... | true |
6eead1cbbeb95b15aeb0b7a1d076b59c31de60c3 | C++ | akilvein/hr | /nearlyIntegerRockGarden.cpp | UTF-8 | 6,432 | 3.171875 | 3 | [] | no_license |
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <cassert>
#include <sstream>
#include <iterator>
using namespace std;
map<double, vector<pair<int, int> > > pointsByDistance() {
map<double, vector<pair<int, int> > > result;
for (int x =... | true |
979d973b7de20783be506cd14ce525fb67f0ba07 | C++ | NoahScanlon/COMP201-2014 | /lab1.cpp | UTF-8 | 597 | 2.875 | 3 | [] | no_license | #include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char* argv[]) {
ifstream wrong;
ofstream right;
wrong.open(argv[1]);
if (wrong.fail())
{
cout << "Unable to open " << argv[1] << endl;
return 1;
}
right.open("output.txt");
if (right.fail())
{
cout << "Unable to open " << "o... | true |
5088e02ecd888cfc07ad205036b9fd02605e8657 | C++ | fhnstephen/Leetcode | /160-intersection-of-two-linked-lists/160-intersection-of-two-linked-lists.cc | UTF-8 | 926 | 3.328125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
int len1 = 0, len2 = 0, delta = 0;
for (auto temp ... | true |
91befe74941a018cec1b39fa8556d8bdb52eab19 | C++ | liuhello/snet | /snet/connection.cc | UTF-8 | 1,731 | 2.703125 | 3 | [] | no_license |
#include "connection.h"
#include <cstdio>
namespace snet
{
#define MAX_BUF_SIZE 1024*4
/////////////////////////////////////////////
//Connection
/////////////////////////////////////////////
Connection::Connection(Socket* s):SocketEvent(s)
{
m_read = new ByteBuffer(512);
... | true |
aa08d5b11dadac45017a90d00e84ba6cbff4273b | C++ | Angela-Oo/MasterThesis | /src/algo/registration/evaluation/error_evaluation.cpp | UTF-8 | 3,251 | 2.71875 | 3 | [] | no_license | #include "error_evaluation.h"
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
#include "barycentric_coordinates.h"
namespace Registration {
std::vector<double> evaluate_distance_error(std::vector<std::pair<Point, Point>> nearest_points)
{
std::vector<double> distances;
for (auto p : nearest_points) {
au... | true |
90b0c83e1637d53d6099fb9a873916dc52bd25d2 | C++ | hkhl/cplusplus | /设计模式/dm19命令模式.cpp | GB18030 | 1,025 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
//ҽ
class Doctor
{
public:
void treat_eye()
{
cout << "ۿ" << endl;
}
void treat_nose()
{
cout << "ǿ" << endl;
}
};
class CommandTreatEye
{
public:
CommandTreatEye(Doctor *doctor)
{
m_doctor = doctor;
}
void treat()
{
m_doctor->treat_eye();
}
private:
Do... | true |
899ab233bb40bf743bf0e35ffbd430a2634b551c | C++ | k96payne/linked_list_implementations | /CBL.h | UTF-8 | 18,080 | 3.171875 | 3 | [] | no_license | //===============================================//
// Circular Buffer List Template class //
// Kyle Payne //
// Project 1 //
//===============================================//
#ifndef CBL_H_
#define CBL_H_
#define DEFAULT_ARRAY_SIZE 50
#include <iostream>
#include <stdexcept>
#incl... | true |
fb6110b9eaaa000216fde210eab8f1bc98a6d5ae | C++ | tylerku/Interpreter | /Interpreter/DatalogProgram.h | UTF-8 | 1,768 | 2.515625 | 3 | [] | no_license | //
// DatalogProgram.h
// lab2
//
// Created by Tyler Udy on 7/5/16.
// Copyright © 2016 Tyler Udy. All rights reserved.
//
#ifndef DatalogProgram_h
#define DatalogProgram_h
#include "Rule.h"
#include "Predicate.h"
#include "Parameter.h"
#include "Scanner.h"
#include <vector>
#include <set>
//vector<rule> Rule
... | true |
4e3a503d704a30bc2af5414e158fd6f14c7dc65a | C++ | zoharith/Reviyot | /include/Card.h | UTF-8 | 1,278 | 3.265625 | 3 | [] | no_license | #ifndef CARD_H_
#define CARD_H_
#include <iostream>
using namespace std;
enum Shape {
Club= 0,
Diamond ,
Heart,
Spade
};
enum Figure {
Jack=-4,
Queen=-3,
King=-2,
Ace=-1
};
class Card {
private:
Shape shape;
protected:
string shapeName;
public:
Card(Shape s);
virtual string toString() = 0; //... | true |
eca9561be942542e951aeaecd4a19b04f61dbf44 | C++ | cristobalramos93/EDA | /Excursionistas atrapados eda 2/Excursionistas atrapados eda 2/Source.cpp | UTF-8 | 683 | 3.015625 | 3 | [] | no_license | #include<iostream>
#include"bintree_eda.h"
using namespace std;
int resuelve(bintree<int> arbol, int & maxi);
//excursionistas entrada/salida
int main() {
int casos;
cin >> casos;
for (int i = 0; i < casos; i++) {
bintree<int> arbol = leerArbol(-1);
int numeros = 0;
int num;
num = resuelve(arbol, numeros);
... | true |
b885335f56ab6242461aa97fd4acf467579d0c55 | C++ | zhunicole/CS148 | /RayTracer/raytracer/Src/ImagePlane.h | UTF-8 | 2,379 | 2.75 | 3 | [] | no_license | //#####################################################################
// Stanford CS148 Ray Tracer Example Code
// Copyright 2012, Ben Mildenhall
//#####################################################################
#ifndef RayTracer_ImagePlane_h
#define RayTracer_ImagePlane_h
#include "Camera.h"
#include "Jitter... | true |
32a242fdb61bf57ba30d6283523fe15ed927da6a | C++ | ClxS/NovelRT | /tests/NovelRT.Tests/Maths/GeoVector3Test.cpp | UTF-8 | 6,044 | 2.953125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"LicenseRef-scancode-other-permissive"
] | permissive | // Copyright © Matt Jones and Contributors. Licensed under the MIT License (MIT). See LICENCE.md in the repository root
// for more information.
#include <NovelRT.h>
#include <gtest/gtest.h>
using namespace NovelRT;
using namespace NovelRT::Maths;
TEST(GeoVector3Test, equalityOperatorEvaluatesCorrectly)
{
EXPECT... | true |
5861bd5e4c0f94e4eab948530063390d66ca02c8 | C++ | hdh9494/BOJ | /Algo/17135_캐슬디펜스(4.6 A형).cpp | UHC | 2,773 | 3.046875 | 3 | [] | no_license | #pragma warning(disable : 4996)
#include <cstdio>
#include <vector>
#include <algorithm>
#include <memory.h>
#define MAX 17
using namespace std;
struct enemy {
int x;
int y;
int dist;
};
int sol = 0;
int N, M, D;
int map[MAX][MAX];
bool Selected[MAX]; // ʿ
vector <int> bow;
void copy_map(int(*a)[MAX], int... | true |
f9cc48f69789035e1e00b016db4076771706e7c5 | C++ | orz2pick/SNNU | /ACM/SNNU2017年头次比赛/H/8002277_41612164_H.cpp | UTF-8 | 505 | 2.515625 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int m,i,j,n,k,line;
int a[510],b[510];
scanf("%d",&m);
for (i=0;i<m;i++)
{
scanf("%d",&n);
for(j=0;j<n;j++)
{
scanf("%d",&a[j]);
}
for (k=0;k<n;k++)
{
b[k]=0;
for (j=0;j<n;j++)
{
... | true |
b174e0b7190539c6c2171f7150d24a5f5c71223c | C++ | Eildars91/l6 | /bird.h | WINDOWS-1251 | 688 | 3.15625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#ifndef BIRD_H
#define BIRD_H
using namespace std;
class bird : public alive
{
public:
int year,a;
void AllBird(int year, int a)
{
cout << " : ";
cin >> name;
cout << " : ";
cin >> opp;
cout << " : ";
cin >> mesto;
cout << "... | true |
14421662b50f69538bc5b6fe02ca716941647c93 | C++ | phuang/test | /boost/bind/bind.cpp | UTF-8 | 405 | 3.109375 | 3 | [] | no_license | #include <boost/bind.hpp>
#include <iostream>
typedef int (*Func)(int);
template <class Function>
void test_func(Function func) {
int ret = func(100);
std::cout << "ret = " << ret << std::endl;
}
int inc(int i) { return i + 1; }
int add(int i, int b) { return i + b; }
int main(int argc, char **argv) {
test_f... | true |
22ff5a18d738c7c98bebd9aa13cb0c9ff777a928 | C++ | luciandinu93/CPlusPlusLearning | /Chapter5/Lab5-9.cpp | UTF-8 | 2,130 | 4.21875 | 4 | [] | no_license | /* Modelling fractions: part 1 */
#include <iostream>
#include <string>
#include <stdexcept>
#include <cmath>
class Fraction
{
public:
Fraction(int numerator, int denominator);
std::string toString();
double toDouble();
private:
int numerator;
int denominator;
};
Fraction::Fraction(int numerator, int denominato... | true |
a029996854749283d5a63405132becb94f349a5b | C++ | zy4kamu/Coda | /src/nlp-stack/Dictionary/Core/DictionaryTrie/DictionaryTrieIterator.cpp | UTF-8 | 2,620 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* DictionaryTrieIterator.cpp
*/
#include "DictionaryTrieIterator.h"
#include <stack>
/**
* Constructor of DictionaryTrieIterator
*/
DictionaryTrieIterator::DictionaryTrieIterator(Dictionary* _dic, string dictionaryFile) : DictionaryTrieBinaryFileReader(_dic, dictionaryFile)
{
setLemmaOnly(true);
result = v... | true |
0492b5ae1bd7da719d99e7bb482372d87c27d103 | C++ | jjccero/FFT | /FFT/test.cpp | UTF-8 | 1,622 | 2.75 | 3 | [] | no_license | #include<iostream>
#include"fft.h"
using namespace std;
void show(complex** X, int u, int v) {
for (int i = 0; i < u; i++) {
for (int j = 0; j < v; j++) {
printf("%8.4f", X[i][j].r);
if (X[i][j].i >= 0)
printf("+%-6.4fj ", X[i][j].i);
else
printf("%-7.4fj ", X[i][j].i);
}
cout << endl;
}
}
vo... | true |
b7ee8564c388af3b42ada66fbf278b941a8862d5 | C++ | shermnonic/wmute | /source/projectme/editor/Geometry.h | UTF-8 | 2,793 | 2.875 | 3 | [] | no_license | #ifndef GEOMETRY_H
#define GEOMETRY_H
#include <vector>
#include <cmath> // for sqrt()
/// Geometry utilities for \a RenderArea
namespace Geometry {
/// Polygon with texture coordinates
template <typename T, int DIM, int TC>
class TPolygon
{
public:
void clear() { m_verts.clear(); m_texcoords.clear()... | true |
8b0505fc539224eee05de38f1f0f84f5314d2a9f | C++ | slesarev-hub/MM-tasks | /Multithreading-logger/logger_1.cpp | UTF-8 | 1,593 | 2.6875 | 3 | [] | no_license | #include "logger_1.hpp"
Consumer_1::Consumer_1()
: Consumer(){}
Consumer_1::~Consumer_1(){}
void Consumer_1::notify_one() const
{
this->log_condition.notify_one();
}
void Consumer_1::log_source(int producers_count, std::ostream& out)
{
this->producers_count = producers_count;
for(;;)
{
... | true |
d3d83dc74b481de0640c8aa9c0ac53e64fcb8c01 | C++ | mannyzhou5/scbuildorder | /GAPopulation.h | UTF-8 | 8,128 | 2.640625 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include "Vector.h"
#include "GAConfiguration.h"
#include "GAChromosome.h"
template<typename TGene, typename TFitnessCalc, typename TFitness>
class CGAPopulation
{
public:
CGAPopulation(const CGAConfiguration<TGene, TFitnessCalc, TFitness> &config, size_t maxPopulation);
... | true |
e9a742520e76601662df116cffa97a1698560960 | C++ | TIove/Algorithms_and_data_structures | /9_laba/C.cpp | UTF-8 | 1,214 | 2.96875 | 3 | [] | no_license | #include <fstream>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
ll Prim(vector <bool> isPath, vector <pair <ll, ll>> graph[1000000]) {
ll result = 0;
priority_queue< pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>> > pQueue;
pQueue.push({0, 0});
while (!pQueu... | true |
721e3c587a1465f3d30e3199ed680cb3f1b98167 | C++ | pugakn/ProyectoGraficas | /Example/Example/Matrix4D.cpp | UTF-8 | 11,355 | 2.9375 | 3 | [] | no_license | #include "Matrix4D.h"
#include <memory>
#include <math.h>
Matrix4D::Matrix4D()
{
memset(this, 0, sizeof(Matrix4D));
this->m[0][0] = 1.f;
this->m[1][1] = 1.f;
this->m[2][2] = 1.f;
this->m[3][3] = 1.f;
}
Matrix4D::Matrix4D(float * pMatrix)
{
for (int i = 0; i < 16; i++)
{
v[i] = pMatrix[i];
}
}
Matrix4D::Matri... | true |
f6837ca356cf90e03deb49e043a9a9f55da5ddec | C++ | ToR-0/RATel | /client/src/Connexion.cpp | UTF-8 | 10,158 | 2.640625 | 3 | [
"MIT"
] | permissive | //#define WIN32_LEAN_AND_MEAN
#include "../inc/Connexion.h"
#include "../inc/common.h"
#include "../inc/Persistence.h"
#include "../inc/other.h"
#include "../inc/Exec.h"
#include "../inc/Destruction.h"
using namespace std;
Connexion::Connexion()
{
;
} //Constructor
int Connexion::openConnexion()
{
S... | true |
baf16480d7c8eaa5858d33f8881fd2ea4482abc5 | C++ | ryandcyu/openpower-occ-control | /test/utest.cpp | UTF-8 | 1,037 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include <gtest/gtest.h>
#include <occ_events.hpp>
#include <occ_manager.hpp>
#include "powercap.hpp"
using namespace open_power::occ;
class VerifyOccInput : public ::testing::Test
{
public:
VerifyOccInput() :
bus(sdbusplus::bus::new_default()),
rc(sd_event_default(&event)),
... | true |
e463d1a439ccb024abd901d6d6341539f59b516a | C++ | PetarZecevic97/Paint-the-town-crimson | /Engine/src/Render/Renderer.cpp | UTF-8 | 5,258 | 2.5625 | 3 | [] | no_license | #include "precomp.h"
#include "Renderer.h"
#include "Render/Window.h"
#include "Render/Texture.h"
#include "ECS/Entity.h"
#include <SDL.h>
namespace Engine
{
bool Renderer::Init(const WindowData& windowData_)
{
LOG_INFO("Initializing Renderer");
m_Window = std::make_unique<Window>();
... | true |
83da837a06448f4a16a54ea90f4cdd78b7008433 | C++ | electro1rage/OJProblemsCodes | /Problem Storage/Greedy/Medium/KMP/RunningLetters.cpp | UTF-8 | 2,721 | 3.28125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class RunningLetters {
public:
vector<int> getLongestPrefixarr(string &message) {
int m = message.size();
vector<int> longestprefix(m);
for (int i = 1, k = 0; i < m; ++i) {
while (k > 0 && message[k] != message[i])
k = longestprefix[k - 1];
if (message[k... | true |
8e58e27ecb6f72f4abeb21dc6488caa7ea835755 | C++ | mrzacharycook/TwitterColors | /lib/ArduinoColorSetter.ino | UTF-8 | 2,221 | 3.3125 | 3 | [] | no_license | // include the neo pixel library
#include <Adafruit_NeoPixel.h>
// The number of LEDs being driven.
static const int NUM_LEDS = 8;
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RG... | true |
2d67c33cb1a1ff8dcdc7ec973ef812a3e5643e2c | C++ | candyguo/code_learning | /code.cpp | UTF-8 | 145,447 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <map>
#include <set>
#include <queue>
#include <tuple>
#include <chrono>
#include <thread>
#include <mutex>
#include <algorithm>
#include <list>
#include <cmath>
#include <c... | true |
5c75529deb5605e525b6374c5e30061af1058d56 | C++ | zhanlutuzi/cppoop | /Dictionary.cpp | UTF-8 | 1,073 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include<cstdlib>
using namespace std;
int main()
{
string words[8000];
string chinese[8000];
string w_class[8000];
int num = 0;
ifstream infile;
ifstream in("Dictionary.txt");
if (!infile) //测试是否成功打开
{
cerr << "open error!" ... | true |
81409e99fc8ed10b4eca98d1ba4d4a715b5dc287 | C++ | huebel/ObjectBroker | /xmlbroker/xmlbroker.h | UTF-8 | 1,747 | 2.53125 | 3 | [
"CC0-1.0"
] | permissive | #ifndef __XMLBROKER_H
#define __XMLBROKER_H
#include "broker_impl.h"
#include "broker.h"
#include <ostream>
#include <vector>
#include <strxtrs/stack.h>
template <typename Range>
class XMLBuffer;
template <typename Range>
class XMLBroker : private std::string, public Broker {
public:
XMLBroker(st... | true |
e3e70c7254bf6b4a428e22cbb8a15c9622efcd9e | C++ | muhammedsaidkaya/hw-java-c-python-verilog | /Basic C codes/Basic C codes/Pointer içindeki adresi değiştirerek gösterdiği değeri değiştirme kodu.cpp | ISO-8859-13 | 410 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
void function(int *p,int *q){
int temp=NULL;
printf("p nin adresi %u deeri %d ",p,*p);
printf("q nun adresi %u degeri %d\n",q,*q);
temp = *p; *p=*q; *q=temp;
printf("p nin adresi %u deeri %d ",p,*p);
printf("q nin adresi %u d... | true |
70bef8e6d868a6e4ddf0be8d14a5b870860ac429 | C++ | eversonhs/basic-raytracer | /basic raytracer/Sphere.h | UTF-8 | 349 | 2.578125 | 3 | [] | no_license | #pragma once
#include"Vector3.h"
#include<SDL2/SDL.h>
class Sphere {
public:
Sphere(Vector3& c, double rd, SDL_Color col);
Sphere(Vector3&& c, double rd, SDL_Color col);
//TODO: Refactor
SDL_Color getColor();
Vector3 getCenter();
double getRadius();
private:
Vector3 center;
double radi... | true |
e5c0d9e6fb9b7f26decd852430c676a129bf3d84 | C++ | sahle123/Personal-References | /C++ Codeblocks/CSCI 2270/assignment3/template_prac.cxx | UTF-8 | 3,058 | 3.796875 | 4 | [] | no_license | /*
* template_prac.cxx
*
*
* Created on: Apr 3, 2012
* Author: Sahle A. Alturaigi
*
*
* google: stl lists, bool main()
*
* variable.clear() will clear this list of all objects.
* the += should add another list. i.e. l = [1,2,3]; l += 4; l = [1,2,3,4].
*/
/*
#include<iostream>
#include<list>
//#incl... | true |
b44867bbcd5188cfc721a5c9d978c6bc98fa0bc1 | C++ | Ziyadelbanna/HTTP-Client-Server | /HTTP_Client/main.cpp | UTF-8 | 857 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "input_reader.h"
#include "sender.h"
#include "sockets_manager.h"
using namespace std;
void process_request(vector<request> requests);
int main() {
cout << "Enter Input File Path!" << endl;
string file_path = "input.txt";
//cin >> file_path;
while(1){
... | true |
a238dd93e600aa05a781eb5ca0bd8d4fb6561657 | C++ | Zhangddy/cpp-HttpServer | /HttpStart.cc | UTF-8 | 1,012 | 2.796875 | 3 | [] | no_license | #include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
pid_t pid;
if ((pid = fork()) < 0)
{
perror("fork error");
return EXIT_FAILURE;
}
else if (0 == pid)
{
printf("first child is running..\n");
/**在第一个子进程中再次fork***/
if ((pid = fork()) < 0... | true |
7874cb5e778823158c245ee21ee2c424f6f2bfac | C++ | we0091234/Myleetcode | /5.最长回文子串.cpp | UTF-8 | 2,483 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <string.h>
using namespace std;
bool isHuiWen(string s,int left,int right)
{
int length =(right-left+1) ;
for(int i = left; i<left+length/2;i++)
{
if(s[i] != s[right+left-i])
return false;
}
return true;
}
string longestHuiWen(string... | true |
995bb6d9eff1fa846dec0e4123d1922f8963443e | C++ | verdande2/CST136-Spring-12 | /inLab 7 pt III/Publication.cpp | UTF-8 | 496 | 3.203125 | 3 | [] | no_license | #include "Publication.h"
char* Publication::Title(){
return m_title;
}
void Publication::Title(char* title){
m_title = new char[strlen(title)+1];
strcpy(m_title, title);
}
double Publication::Price(){
return m_price;
}
void Publication::Price(double price){
m_price = price;
}
Publication::Publication() : m_title(... | true |
e2fd3db4ee2dabc5b065d03aeb925bb28f18d4b4 | C++ | kumarmadhukar/2ls | /src/ssa/assignments.cpp | UTF-8 | 5,203 | 2.703125 | 3 | [
"BSD-2-Clause"
] | permissive | /*******************************************************************\
Module: A map of program locations to the assignments made there
Author: Daniel Kroening, kroening@kroening.com
\*******************************************************************/
#include <util/byte_operators.h>
#include "assignments.h"
#incl... | true |
c5ea84963e117e4098a3f07c902c3b47ada2cc30 | C++ | rutuja-patil923/Data-Structures-and-Algorithms | /Stack/mergeIntervals.cpp | UTF-8 | 569 | 3.296875 | 3 | [] | no_license |
void mergeIntervals(vector<vector<int>> intervals)
{
stack<vector<int>> st;
int first = intervals[0][0];
int second = intervals[0][1];
st.push({first,second});
for(int i=1; i<intervals.size();i++)
{
vector<int> temp=st.top();
first=temp[0];
second=temp[1];
if(second>=intervals[i][0])
{
first=min... | true |
ca0f9d050887d4272dd599eb04fe203587cbb853 | C++ | wesExpress/GameEngine2D | /Engine/src/Platform/GLFW/InputGLFW.cpp | UTF-8 | 1,164 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #include "InputGLFW.h"
#include "Engine/EngineApp.h"
#include <GLFW/glfw3.h>
namespace Engine
{
Input* Input::m_instance = new InputGLFW();
bool InputGLFW::IsKeyPressedImpl(int keycode) const
{
auto window = static_cast<GLFWwindow*>(Engine::EngineApp::Get().GetWindow().GetWindow());
auto s... | true |
98a81a40d47c795eda9c8b9f1a751f282a52548a | C++ | AkbarKarshiev/SmartCarProject | /codes/shape/Object.h | UTF-8 | 315 | 2.703125 | 3 | [] | no_license | #ifndef OBJECT_H
#define OBJECT_H
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
class Object{
public:
Object(string name, string color, Point position);
string getName();
string getColor();
Point getPosition();
private:
string name;
string color;
Point position;
};
#endif | true |
da4b7b4b7a1f395644e350242a35987804a14c20 | C++ | paladini/UFSC-so1 | /trabalhos/atividadePratica2/final/lib/Queue.cc | UTF-8 | 3,531 | 3.375 | 3 | [
"MIT"
] | permissive | /* Emmanuel Podestá Junior, Fernando Paladini.
* BOOOS.h
*
* Created on: Aug 14, 2014
*/
#ifndef QUEUE_CC_
#define QUEUE_CC_
#include "Queue.h"
#include <iostream>
#include <cstdlib>
namespace BOOOS {
Queue::Queue() {
_head.next(0);
_head.prev(0);
_length = 0;
}
Queue::~Queue... | true |
6ec19132dfc54c8b2c0c6e6518a8a57dde9b53ed | C++ | sandbox-3/entidy | /examples/SpaceInvaders/src/Systems/SRendering.cpp | UTF-8 | 6,175 | 2.75 | 3 | [
"MIT"
] | permissive | #include "Systems/SRendering.h"
using namespace entidy;
using namespace entidy::spaceinvaders;
void SRendering::Init(Engine engine) { }
void SRendering::Update(Engine engine)
{
if(engine->Renderer()->Cols() < VIEWPORT_W || engine->Renderer()->Cols() < VIEWPORT_H)
{
RenderInvalidSize(engine);
return;
}
Rende... | true |
de64ad9507e4f734dbaaa3b909d59ebf525f2793 | C++ | ahmedelgendyfci/Assingment-3-Data-Structure | /A3P4/A3P4/Source.cpp | UTF-8 | 1,283 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include<string>
#include<stack>
using namespace std;
bool Stack(string str)
{
stack<char> s1;
bool b = true;
for (int i = 0; i < sizeof(str); i++)
{
if (str[i] == '(' || str[i] == '[' || str[i] == '{')
{
s1.push(str[i]);
}
else if (str[i] == ')' || str[i] == ']' || str[i] == '}')
... | true |
8565bd6200df70d7ee7b93cf1fd9a160b19495f0 | C++ | Coldiep/ezop | /web/ezop_widget.h | UTF-8 | 1,061 | 2.625 | 3 | [] | no_license |
#pragma once
#include <string>
#include <Wt/WContainerWidget>
#include <Wt/WMenu>
#include <Wt/WString>
#include <Wt/WStackedWidget>
#include <web/menu_element.h>
#include <web/session.h>
namespace ezop { namespace web {
/// Абстрактный класс для всех элементов главного меню.
/// Главный класс Web приложения.
cl... | true |
7aa05f4f20d6179e01ca9e57fca7de42b848a52c | C++ | andrembarreto/2020-2-exercicio-revisao-refatoracao | /EncomendaRelampago.hpp | UTF-8 | 983 | 3.078125 | 3 | [] | no_license | #ifndef EncomendaRelampago_H
#define EncomendaRelampago_H
#include "Encomenda.hpp"
#include "Cliente.hpp"
using namespace std;
class EncomendaRelampago: public Encomenda{
private:
static constexpr double taxaRelampago = 0.25; // taxa adicional pela entrega mais rapida
public:
EncomendaRelampago(double weig... | true |
69a900b3956075236bdb3049166365b2c75b0f58 | C++ | songzhenglian/song_zhenglian | /chap08ex_08/main.cpp | GB18030 | 644 | 2.515625 | 3 | [] | no_license | a) unsigned int values[5]={2,4,6,8,10};
b) unsigned int *vPtr;
c) cout<<fixed<<showpoint<<setprecision(1);
for(size_t i=0;i<size;++i)
cout<<values[i]<<' ';
d) vPtr=values;
*vPtr=&values[0];
e) cout<<fixed<<showpoint<<setprecision(1);
for(size_t j=0;j<size;++j)
cout<<*(vPtr+j)<<' ';
f) cout<<fixed<<show... | true |
f68b9c10916076e1ce1f70217a6186aa03fa4867 | C++ | Zaela/ZEQClient | /src/file_stream.h | UTF-8 | 1,312 | 3.171875 | 3 | [] | no_license |
#ifndef _ZEQ_FILE_STREAM_H
#define _ZEQ_FILE_STREAM_H
#include <cstdio>
#include "types.h"
#include "exception.h"
#include "memory_stream.h"
class FileStream : public MemoryStream
{
private:
static void readFile(FILE* fp, byte*& data, uint32& len)
{
//not completely portable (good enough for Windows and Linux, ... | true |
5846bf9d0fc8b6d129f4acad8de5b3c771fdab0d | C++ | mufengdaozhang/Function-Plotter | /math_expressions/math_expression_symbol.h | UTF-8 | 1,714 | 3.28125 | 3 | [
"MIT"
] | permissive | #ifndef MATH_EXPRESSION_SYMBOL_H
#define MATH_EXPRESSION_SYMBOL_H
#include <string>
#include <ostream>
namespace math_expression {
struct TerminalSymbol;
struct Symbol;
enum NonTerminalSymbol {
A = 65, B, C, D, E, F, G, H, I, J, K, L, M, N,
O, P, Q, R, S, T, U, V, W, X, Y, Z
};
std::ostream& operato... | true |
a986f30f4ac83c61514ef42b8109cbcb2bb5d3ed | C++ | ribinmathew/personal_project | /arduino/ultrasonic .ino | UTF-8 | 825 | 2.765625 | 3 | [] | no_license | const int trigpin = 37;
const int echopin = 35;
const int trigpin1 = 31;
const int echopin1 = 33;
long duration;
int distance;
long duration1;
int distance1;
void setup() {
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
pinMode(trigpin1,OUTPUT);
pinMode(echopin1,INPUT);
Serial.begin(9600);
}
void loop() {
digita... | true |
3cddc68291ae6fb035422c93057f312e5d5a8dc1 | C++ | cosmolattice/cosmolattice | /src/include/TempLat/lattice/algebra/operators/squareroot_test.h | UTF-8 | 892 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef TEMPLAT_LATTICE_ALGEBRA_OPERATORS_SQUAREROOT_TEST_H
#define TEMPLAT_LATTICE_ALGEBRA_OPERATORS_SQUAREROOT_TEST_H
/* This file is part of CosmoLattice, available at www.cosmolattice.net .
Copyright Daniel G. Figueroa, Adrien Florio, Francisco Torrenti and Wessel Valkenburg.
Released under the MIT license, ... | true |
06b972ec4fb78225c3d838b4886fc498d9c679fb | C++ | kzw5309/DataStructureCpp | /Assignment1/A1q2a.h | UTF-8 | 3,322 | 3.921875 | 4 | [] | no_license | /*COMP272 Assignment1 Question 2a
*Swap two adjacent elements in a list by adjusting only the links
*Use a singly-linked list
*
*Arthor:
*Date:
*/
#ifndef _A1Q2A_H_ //if not defined
#define _A1Q2A_H_
#include <iostream>
#include "Node.h"
using namespace std;
template <typename T>
class SinglyLinkedList {
pr... | true |
3c61be284c7e173f28b04bc0345550b60c73fc5d | C++ | MODU-FTNC/google-language-resources | /festus/math-util.h | UTF-8 | 2,669 | 2.875 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | // festus/math-util.h
//
// 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 writing,... | true |
e1ea7fa529ec34da33ee36c89b1e3f6feda6bd68 | C++ | giszmr/mytest | /cpp.test/derive.test/test_derive.cpp | UTF-8 | 814 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include "test_derive.hpp"
typedef void (*VFunc)(void);
int main(int argc, char* argv[])
{
/* Base base(1000);
VFunc func = (VFunc)*(int*)*(int*)(&base);
func(); //it works.
func = (VFunc)*((int*)*(int*)(&base) + 2);
func();*/
printf("******************\n");
Derive der... | true |
274bfd038364793edb0300eab06b95b9e9b417e9 | C++ | kobyyoshida/Syntax-Checker | /fileio.cpp | UTF-8 | 320 | 2.546875 | 3 | [] | no_license | //koby yoshida
#include <iostream>
#include <fstream>
#include "fileio.h"
using namespace std;
fileio::fileio(){
}
fileio::~fileio(){
}
void fileio::openFile(string filePath){
in.open(filePath);
if(!in){
cerr << "File not found. " << endl;
exit(EXIT_FAILURE);
}
}
void fileio::closeFile(){
in.close... | true |
a4786667175ed00f214c57f3ec4967d0b8787ddc | C++ | stulepbergen/Cinema | /Cinema/Film.cpp | UTF-8 | 2,036 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include <windows.h>
#include "Film.h"
using namespace std;
Film::Film(int &f): film(static_cast<Films>(f)){}
void Film::getInfoFilm()
{
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, 14);
switch(film)
{
case PASSENGERS:
cout << "\nPa... | true |
e4b3261bd8add9326a2d9b2b12a285266007a914 | C++ | cvora23/CodingInterviewQ | /Puzzles/Test5.cpp | UTF-8 | 678 | 2.90625 | 3 | [] | no_license | /*
* Test5.cpp
*
* Created on: Feb 15, 2016
* Author: chintan
*/
/*
* Policeman decided to punish the Prisoner and asked him to make a statement.
* The Prisoner should make such a statement so that he would be alive.
* If the statement is held true by Policeman, the Prisoner will be hanged to death
* and... | true |
8c04e5b59bbe74e8515df4d3fc47246d4a36f66c | C++ | hinike/ofxPDSP | /src/DSP/interpolators/InterpolatorShell.cpp | UTF-8 | 1,452 | 2.671875 | 3 | [
"MIT"
] | permissive |
#include "InterpolatorShell.h"
pdsp::InterpolatorShell::InterpolatorShell(){
interpolator = reinterpret_cast<Interpolator*> ( &LinearInterpolator::linearInterpolator );
type = Linear;
}
pdsp::InterpolatorShell::InterpolatorShell(const InterpolatorShell& other) : InterpolatorShell(){
changeInte... | true |
7bea9d7ae534e4010e666a7ce8cfab75263f21bf | C++ | EmceeEscher/Roy-the-Traffic-Cop | /src/placard.hpp | UTF-8 | 2,164 | 2.890625 | 3 | [] | no_license | #pragma once
#include "common.hpp"
#include "turn_direction.hpp"
#include <math.h>
#include <map>
class Placard : public Renderable
{
static Texture placard_texture;
public:
Placard(vec2 parent_position, float parent_rotation);
~Placard();
// Creates all the associated render resources and default transfor... | true |
832c0b15b440baab490ff95aa12bf8fc3269d705 | C++ | ServePeak/cs1124 | /hw06/Warrior.h | UTF-8 | 470 | 2.796875 | 3 | [] | no_license | #ifndef WARRIOR_H
#define WARRIOR_H
#include <string>
namespace WarriorCraft {
class Noble;
class Warrior {
public:
~Warrior();
Warrior( const std::string& warName, double warStr ) : name(warName), strength(warStr) {}
std::string getName() const;
double getStr() const;
void setStr( double... | true |
fe8efcad0bb3c77dceed7b2fac8b369eecdd668e | C++ | yehyun3459/algorithm | /Baekjoon/DP/P1103 (게임)/yhyh.cpp | UTF-8 | 1,164 | 2.859375 | 3 | [] | no_license | //메모이제이션 dp(BFS로 하려다가 계~~~속 틀림) 정석대로 풀자
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#define MAX_SIZE 50
#define MAX(a,b)(a>b?a:b)
int N, M;
int arr[MAX_SIZE][MAX_SIZE];
int dp[MAX_SIZE][MAX_SIZE];
int visited[MAX_SIZE][MAX_SIZE];
int dx[4] = { -1,1,0,0 };
int dy[4] = { 0,0,-1,1 };
int Sol... | true |
59d8f1168ac8d148cc6de4341aa60001013eccfc | C++ | Angelsufeiya/sword_offer | /Task_12.cpp | UTF-8 | 1,370 | 3.171875 | 3 | [] | no_license | #include <iostream>
using namespace std;
// 回溯法:矩阵中的路径
int main(){
return 0;
}
class Solution {
vector<vector<bool>> flag;
int direct[4][2] = {{-1,0}, {1,0}, {0,1}, {0,-1}}; // 左、右、上、下
public:
bool dfs(char * matrix, int i, int j, char * str, int pathLength){
if(str[pathLength] == '\0') ... | true |
ab44e69e4e982730fc21b89fd3c172f96b55b74a | C++ | minhthang294/battleShip | /src/Board.cpp | UTF-8 | 2,476 | 3.015625 | 3 | [] | no_license | #include "Board.h"
#include "Location.h"
#include <iostream>
#include <stdlib.h>
#include <ctime>
Board::Board()
{
_hits = 0;
for (int y = 0; y< 8; y++)
{
for (int x = 0; x < 8; x++)
{
_grid[x][y] = 0;
}
}
}
void Board::show()
{
int coor = 0;
cout << " 0 ... | true |
4d5e51e0a796360156536ca15f834eddc392cf4d | C++ | virttuall/ProgrammingContests | /ProgrammingContests/src/uva/Uva_12529_FixThePond.cpp | UTF-8 | 2,776 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define fora(i, s) for( int i = 0; i < s; i++ )
using namespace std;
const int maxN = 300;
char barriers[maxN*maxN-1][maxN];
bool visited[2*maxN][2*maxN+1];
bool canV[4]; // up, right, down, left
int iis[4] = {-1, 0, 1, 0};
int jjs[4] = {0, 1, 0, -1};
int up1 = 0;
int right1 = 1;
int down1 ... | true |
c6a40a51ca4f2f19535098f0d401112ce57bb9f8 | C++ | matthewepler/The-Nature-of-Code-Examples | /Cinder/chp3_oscillation/NOC_03_03_pointing_velocity_trail/xcode/Mover.cpp | UTF-8 | 1,756 | 2.875 | 3 | [] | no_license | //
// Mover.cpp
// NOC_03_03_pointing_velocity_trail
//
// Created by Matthew Epler on 2/24/13.
//
//
#include "cinder/app/AppBasic.h"
#include "Mover.h"
using namespace ci;
using namespace ci::app;
using namespace std;
Mover::Mover ()
{
mLocation = Vec2f( getWindowWidth() / 2, getWindowHeight() / 2);
mV... | true |
010a31296934f216049cdbd1ced81d21d2939b3c | C++ | virusinlinux/dataStructures | /A-pratice problem 8.cpp | UTF-8 | 710 | 3.453125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int a[10],min=1,max=0,avg=0,g;
cout<<"Enter elements of Array\n";
for(int i=0;i<10;i++)
{
cin>>a[i];
}
cout<<"Traverse elements of Array\n";
for(int i=0;i<10;i++)
{
if(a[i]>max){
... | true |
d66dcdc6b620b694c742ac3864a48916b1c835de | C++ | mockingbirdnest/Principia | /geometry/instant.cpp | UTF-8 | 2,240 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "geometry/instant.hpp"
#include <limits>
#include <string>
#include <string_view>
#include "absl/strings/str_format.h"
#include "astronomy/epoch.hpp"
#include "astronomy/time_scales.hpp"
#include "quantities/quantities.hpp"
#include "quantities/si.hpp"
namespace principia {
namespace geometry {
namespace _p... | true |
f4567b53a757ef914674dc3802ceae71eb8865fd | C++ | henrywarhurst/design-patterns | /Observer/concrete_subject.cpp | UTF-8 | 537 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "concrete_subject.h"
ConcreteSubject::ConcreteSubject()
: subject_state_(0)
{
std::cout << "ConcreteSubject constructed!" << std::endl;
}
ConcreteSubject::~ConcreteSubject()
{
std::cout << "ConcreteSubject destructed!" << std::endl;
}
int ConcreteSubject::getState()
{
std::cout << "C... | true |
f11833a4dd0f5175c8268359a60839c4825b983d | C++ | Balajanovski/tron-clone | /Controller.cpp | UTF-8 | 653 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | //
// Created by JULIA BALAJAN on 30/12/2016.
//
#include "Controller.h"
#include "Model.h"
Controller::Controller(Model *model) : model(model) {}
void Controller::handleEvents() {
SDL_Event ev;
while(SDL_PollEvent(&ev))
if (ev.type == SDL_KEYDOWN) {
switch(ev.key.keysym.sym) {
... | true |
c323a35e1097d27aec4ed7a221e671029005ff53 | C++ | cpope9141/vulkanRT | /Image.cpp | UTF-8 | 15,364 | 2.78125 | 3 | [] | no_license | #include "Image.h"
#include "CommandBuffer.h"
#include "MemoryUtilities.h"
#include <cmath>
#include <iostream>
const uint8_t BYTES_8_BITS_PER_CHANNEL = 4;
const uint8_t BYTES_32_BITS_PER_CHANNEL = 16;
//public
Image::Image()
{
arrayLayers = 1;
format = VK_FORMAT_UNDEFINED;
image = VK_NULL_HANDLE;
imageMemory =... | true |
ba586793c5d43a7cc2d2b3312d982452803cb2d7 | C++ | luizfernandolfn/ruler | /mrta_archs/alliance/include/alliance/sensor.h | UTF-8 | 682 | 2.609375 | 3 | [] | no_license | #ifndef _ALLIANCE_SENSOR_H_
#define _ALLIANCE_SENSOR_H_
#include <ros/time.h>
#include <utilities/functions/unary_sample_holder.h>
#include <utilities/has_id.h>
namespace alliance
{
class Sensor : public utilities::HasId<std::string>
{
public:
Sensor(const std::string& id);
virtual ~Sensor();
bool isUpToDate(co... | true |
d026c155c384647fa742f431aae1dddade553d79 | C++ | RoshaniPatel10994/c-quizzes- | /quiz 1/quiz/quiz/quiz.cpp | UTF-8 | 428 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
using namespace std;
// Variable
int main()
{
string person1;
string person2;
string person3;
cout << "Please enter a famouse trio: ";
cin >> person1 >> person2 >> person3;
string s1 = "1) ";
string s2 = "2) ";
string s3 = "3) ";
cout ... | true |
5e21636630c1fe9f1ffc2423b69c432e37dc4738 | C++ | diesarrollador/University-1st-2nd-3rd-Years | /Semestre2-CodeTest/ejemplo void.cpp | IBM852 | 1,116 | 3.765625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
void suma (int a, int b); /*Declaracion de la funcion*/
void mayor (int a, int b); /*Tipo de dato, nombre de la funcin y el tipo y nombre de los argumentos*/
int main()
{
int a, b;
cout<<"Ingrese el valor de a: ";
... | true |
a3054d173a1ca11a575320d30dbd6a7484bd1bde | C++ | liuzixing/scut | /POJ/poj/poj2750-Rotted Flower.cpp | GB18030 | 2,388 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn = 100010;
struct node
{
int sum,mins,maxs;//ܺͣСӶΣӶ
int lmin,lmax;//СӶΣӶΣ
int rmin,rmax;//СӶΣСӶ
}tree[maxn * 4];
int data[maxn];
int n,m;
int Min(int a,int b,int c,int d,i... | true |
59cc8c24307eb707e188ac684c674f49c91aec06 | C++ | Forener01/Drone_thesis_2017_old2 | /ucl_drone_2016/src/ucl_drone/include/ucl_drone/computer_vision/target.h | UTF-8 | 3,196 | 2.640625 | 3 | [] | no_license | /*!
* \file target.h
* \brief Header file for the Target class which wraps all procedures to detect a predfined target
* \author Arnaud Jacques & Alexandre Leclere
* \date 2016
*
* Part of ucl_drone.
*/
#ifndef UCL_DRONE_TARGET_H
#define UCL_DRONE_TARGET_H
// #define DEBUG_TARGET // if defined a window wi... | true |
f9874066683277c929f9bc087643c81ced544f4d | C++ | mehulthakral/logic_detector | /backend/CDataset/strStr/strStr_55.cpp | UTF-8 | 418 | 2.796875 | 3 | [] | no_license | class Solution
{
public:
int strStr(std::string haystack, std::string needle)
{
const auto dim1 = haystack.size();
const auto dim2 = needle.size();
int pos = 0;
while(true)
{
const auto tmp = haystack.substr(pos, dim2);
if(tmp == needle) return pos;
... | true |
90fb245cffd8c2220bb44529aaf4a2db5b4aff35 | C++ | starmap0312/leetcode | /burst_balloons2.cpp | UTF-8 | 1,824 | 3.71875 | 4 | [] | no_license | /* - use dynamic programming to solve the problem:
* ex. nums[0...n - 1] ==> input array
* nums[0...n + 1] ==> add two ballons of value 1 to the two ends
* the answer of the problem is ans[0][n + 1]
* - the recursion:
* let ans[i][j] denote the maximum sum that can be obtained by bursting balloons wi... | true |
dba6e1ae5f2c439c158d2e49aea0581cb1efb14c | C++ | WULEI7/WULEI7 | /洛谷/专题/递归专题/洛谷P1706(下一个排列).cpp | GB18030 | 278 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,i,p[9];
scanf("%d",&n);
for(i=0;i<n;i++)
p[i]=i+1;
do
{
for(i=0;i<n;i++)
printf("%5d",p[i]);
printf("\n");
}while(next_permutation(p,p+n));//do-whileԭʼ
return 0;
}
| true |
1bb7fa4559e8be47a3d15919b2480cf244565c50 | C++ | Okrio/ecmedia | /servicecore/source/Http/http.h | UTF-8 | 2,514 | 2.78125 | 3 | [] | no_license | #ifndef _HTTP_H_
#define _HTTP_H_
#include <string>
#include <map>
#define HTTP_METHOD_UNKNOWN -1
#define HTTP_METHOD_GET 0
#define HTTP_METHOD_PUT 1
#define HTTP_METHOD_DELETE 2
#define HTTP_METHOD_POST 3
void SplitString(const std::string& src , std::map<std::string,std::string> &... | true |
e40a58989f1178a355e22f55bd91d24269db6634 | C++ | t2kasa/aoj | /alds/alds1_9_a.cpp | UTF-8 | 1,125 | 2.578125 | 3 | [] | no_license | // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_9_A
// Heaps - Complete Binary Tree
#define SUBMIT
#include <utility>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <limits>
#include <numeric>
#include <functional>
#include <set>
#include <cmath>
#include <cst... | true |
664bc4e9beaa5ac6e766be6f08b3c8d7c78ced6e | C++ | aligang/coursera_cpp | /017.homework.biggest_common_devider/biggest_common_devider.cpp | UTF-8 | 388 | 2.921875 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a, b;
cin >> a >> b;
// a = abs(a);
// b = abs(b);
// if (a == 0 || b == 0 ){
// a = max(a, b);
// } else {
// while ( a != b){
// if (a > b){
// a -= b;
// } else {
// b -= a;
// }
// }
// }
while (a > 0 and b > 0){
if (... | true |
e38ccddf108cedfce99161b841db13868a56ea8f | C++ | buhpc/bfs500 | /simd/bfs_simd.cpp | UTF-8 | 2,954 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h> /* printf, NULL */
#include <stdlib.h> /* srand, rand */
#include <time.h>
#include <vector>
#include <queue>
#include <veclib.h>
#define VERTICES 1000
#define EDGES 10
#define GIG 1000000000
#define CPG 2.90 // Cycles per GHz -- Adjust to your computer
#in... | true |
6cb3b9b440318ceb49e6dfc80acf463eb82648b3 | C++ | hibax/toto | /test/EvaluationTest.cpp | UTF-8 | 5,319 | 2.75 | 3 | [] | no_license | #include <limits.h>
#include "gtest/gtest.h"
#include "Evaluation.h"
#include "Unit.h"
#include "Grid.h"
#include "Algo.h"
#include "Board.h"
#include "Action.h"
using namespace std;
TEST(Evaluation, firstTest){
int size = 5;
int unitsPerPlayer = 1;
vector<string> rows;
rows.push_back("00000");
rows.push_back(... | true |
60577e6d00cdb4d4ff3d65bde9456e1958cb3eb7 | C++ | Khallimero/myrt_tuple | /primitives/ShapeCollection.h | UTF-8 | 902 | 2.53125 | 3 | [] | no_license | #pragma once
#include "Collection.h"
#include "Shape.h"
#include "SmartPointer.h"
class ShapeCollection:public ObjCollection< SmartPointer<Shape> >
{
public:
ShapeCollection(SmartPointer<Shape> b=SmartPointer<Shape>(NULL));
virtual ~ShapeCollection();
public:
virtual Hit getHit(const Ray& r)const;
Ob... | true |
970fdbe933af1ee5262e133d9779fa55a6c43540 | C++ | MoltenMoustache/AIE-Y1-Maths-For-Games | /molten_maths/molten_maths/Vector4.cpp | UTF-8 | 4,661 | 3.296875 | 3 | [] | no_license | #include "Vector4.h"
// static variables
Vector4 Vector4::one = Vector4(1, 1, 1, 1);
Vector4 Vector4::zero = Vector4(0, 0, 0, 0);
float& Vector4::operator[] (const int a_index) {
assert((a_index >= 0) && (a_index < 4) && "Vector4 index out of range!");
return m_data[a_index];
}
// Vector Cast Operator
Vector4::ope... | true |
b34c512f1beedb6e90ae05f916e61a1ef8983eda | C++ | oEliteo/Fractal_Project | /src/JuliaSet.h | UTF-8 | 984 | 2.65625 | 3 | [] | no_license | #ifndef _JULIASET_H_
#define _JULIASET_H_
#include "ComplexFractal.h"
#include "NumberGrid.h"
class JuliaSet: public ComplexFractal{
public:
JuliaSet();
JuliaSet(const int& height, const int& width, const double& mine_x, const double& max_x, const double& min_y, const double& max_y, const double& a, const double&... | true |
d3203d3eae79f9b2c0b4158126b0f8eddc8812c9 | C++ | alvls/parprog-2018-1 | /groups/1506-3/levkin_aa/3-tbb/solution3.cpp | UTF-8 | 5,056 | 2.625 | 3 | [] | no_license | #include "stdafx.h"
#include "solution3.h"
#include "solution.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include "tbb/parallel_for_each.h"
#include "tbb/task_scheduler_init.h"
using namespace std;
struct comparator
{
int id1;
int id2;
int realLvl;
comparator(int id1, int i... | true |
61fb8f8a18e52c94925f4dad7d872601fb423a61 | C++ | platelk/project | /bomberman/inc/Daemon/ClientBuffer.hpp | UTF-8 | 1,327 | 2.59375 | 3 | [] | no_license | //
// ClientBuffer.hpp for ClientBuffer in /home/guiho_r/depot/bomberman/inc/Daemon
//
// Made by ronan guiho
// Login <guiho_r@epitech.net>
//
// Started on Tue May 14 10:21:02 2013 ronan guiho
// Last update Thu May 16 14:35:50 2013 vink
//
#ifndef __CLIENT_BUFFER_HPP__
#define __CLIENT_BUFFER_HPP__
#include <ti... | true |
52201cc99463610f7cedfeabd03552a6510f7092 | C++ | plosslaw/CS3203-SPA-TEAM-07 | /Team07/Code07/src/spa/src/ActionsExecutor.cpp | UTF-8 | 37,051 | 2.796875 | 3 | [] | no_license | #include "ActionsExecutor.h"
using namespace std;
/**
* Constructors
*/
ActionsExecutor::ActionsExecutor() {}
ActionsExecutor::ActionsExecutor(PKBQueryController pkb_query_controller) {
this->pkb_query_controller = pkb_query_controller;
this->consts = pkb_query_controller.getAllConstants();
this->proc... | true |
467d5ea5535d44c589d92d474252c131fe73cb79 | C++ | vksssd/100daysofDSA | /LinkedList/ListOperations.cpp | UTF-8 | 5,092 | 4.0625 | 4 | [] | no_license | //Traversal, Insertion, Deletion, ###Searching, Sorting and Merging
#include <iostream>
using namespace std;
// Making a node struct containing a data int and a pointer to another node
struct Node {
int data; // variable to store the data of the node
Node *next; // variable to store the address of the ne... | true |
445638192f30ef13d1945664734dab11415e7f5c | C++ | Alifikrii/Data_Structure | /AVL_Tree.cpp | UTF-8 | 4,088 | 3.484375 | 3 | [] | no_license | // Andi Muhammadd Alifikri
// G64190005
# include <iostream>
# include <cstdlib>
#include <stdio.h>
using namespace std;
// Kode 1
struct avl_node
{ // deklarasi node pada AVL
int data;
struct avl_node *left;
struct avl_node *right;
}*root;
class avlTree
{ // Deklarasi Class node AVL Tree
public:
int heigh... | true |
e500a6901a87be8485795a37e9a3f5317975637d | C++ | maximilianfuller/sphere | /src/engine/particle/ParticleTube.cpp | UTF-8 | 3,442 | 2.703125 | 3 | [] | no_license | #include "ParticleTube.h"
#include "engine/particle/Particle.h"
#include "engine/graphics/Graphics.h"
#include "engine/entity/Entity.h"
#include "platformer/entity/GameEntity.h"
ParticleTube::ParticleTube(QString textureKey,
glm::vec3 source, glm::vec3 target, glm::vec3 color,
... | true |