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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6f019723c914bd24063d6b4911339c206a6dc829 | C++ | kamalsirsa/vtp | /TerrainSDK/vtlib/core/Contours.h | UTF-8 | 2,192 | 2.625 | 3 | [
"MIT"
] | permissive | //
// Contours.h
//
// Copyright (c) 2004-2009 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//
#ifndef CONTOURSH
#define CONTOURSH
#if SUPPORT_QUIKGRID
#include "Terrain.h"
class SurfaceGrid;
/** \defgroup utility Utility classes
*/
/*@{*/
/**
* This class provides the ability to ea... | true |
458bbf46f6c53f59e33db55036972e12a2a59157 | C++ | StetsonMathCS/SPAMM | /room.cpp | UTF-8 | 3,461 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include "room.h"
#include "common.h"
#include "database.h"
using namespace std;
Room::Room(string t, string d){
title = t;
desc = d;
roomId = -1;
requirement == "No Req";
startingRoom = false;
}
Room::Room(string t, string d, string r){
title = t;
de... | true |
efe9c0dfbb196556d6a3c789c861de4d038ad5f0 | C++ | andrinux/miniCppSTL | /ExtString.h | UTF-8 | 181 | 2.515625 | 3 | [] | no_license | //Implementation of String
#ifndef _EXT_STRING_H
#define _EXT_STRING_H
#include <cstring>
class ExtString{
public:
typedef char value_type;
typedef char * iterator;
};
#endif | true |
26e216b4c9bd5a3086f0a9b44f0f5f9be8fe962f | C++ | FranekStark/monocular-visual-odometry | /mvo/src/operations/FeatureOperations.h | UTF-8 | 2,985 | 2.515625 | 3 | [
"MIT"
] | permissive | //
// Created by franek on 24.09.19.
//
#ifndef MVO_SRC_SLIDING_WINDOW_FEATUREOPERATIONS_H_
#define MVO_SRC_SLIDING_WINDOW_FEATUREOPERATIONS_H_
#include <opencv2/core.hpp>
#include <image_geometry/pinhole_camera_model.h>
#include <math.h>
class FeatureOperations {
public:
/**
* Calculates the procentualdiparit... | true |
448e3be1465a951012770c25267f617196285183 | C++ | sshedbalkar/DigiPen_Backup | /Team_Alien/GAM 550/AlienEngine/source/depthshaderclass.cpp | UTF-8 | 10,431 | 2.5625 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////
// Filename: depthshaderclass.cpp
////////////////////////////////////////////////////////////////////////////////
#include "Precompiled.h"
#include "depthshaderclass.h"
#include "lightclass.h"
namespace Framework {
DepthShaderC... | true |
333ed65e66afbdf7ade941d620a875943782ce5b | C++ | wangyu9/MDGCNN | /ShapeAnalysis/noise.h | UTF-8 | 1,766 | 2.75 | 3 | [] | no_license | #pragma once
#ifndef NOISE_H
#define NOISE_H
#include "utils.h"
template <typename num_t>
void snow_noise(double intensity, std::vector<num_t>& f) {
for (int i = 0; i < f.size(); i++) {
f[i] += 2.0*intensity*(random_real() - 0.5);
}
}
template <typename num_t>
void salt_noise(double t, std::vector<... | true |
add20d4930641856507bd0e1c64baefcc2b26c4f | C++ | Bloodclot24/crap | /tp2/lib/ComandoCambiarTextura.cpp | UTF-8 | 1,302 | 2.640625 | 3 | [] | no_license | #include "ComandoCambiarTextura.h"
#include "MundoTP2.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
ComandoCambiarTextura::ComandoCambiarTextura(const char * filename){
cargarTextura(filename);
}
void ComandoCambiarTextura::ejecutar(){
MundoTP2::get_instance()->obtenerCuerpo(... | true |
6b97eec992203e2e6d6caa7b94f02a7059d0aece | C++ | SharpSnake/CPP_Primer_5th_Edition | /CppPrimer5th/TestHelper.h | GB18030 | 3,935 | 3.328125 | 3 | [
"MIT"
] | permissive | // =============================================================================
//
// Some helper functions or structs.
// - WuYu, 2018.06.
// =============================================================================
#ifndef TESTHELPER_H // Ԥʵͷļ
#define TESTHELPER_H // ijcppдhļֱܱӻӰ
// ĿǷֹ... | true |
346d1968cd69cb1c3b68eeb6ea706f8db8e52065 | C++ | tahiat/UVA-Solutions | /10664_luggage.cpp | UTF-8 | 997 | 2.625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#define size 25
using namespace std;
int T;
char input[4*size];
int A[size];
void readcase()
{
gets(input);
}
int N;
void formatting()
{
N = 0;
A[0] = 0;
for (int i = 0; input[i]; i++)
{
if (input[i] >= '0'&&input[i] <= '9')
... | true |
1577efc192db2272d3a912763d478cc6ae14c5ce | C++ | jdlouhy/Piezas | /Piezas.cpp | UTF-8 | 4,487 | 3.78125 | 4 | [
"MIT"
] | permissive | #include "Piezas.h"
#include <vector>
/** CLASS Piezas
* Class for representing a Piezas vertical board, which is roughly based
* on the game "Connect Four" where pieces are placed in a column and
* fall to the bottom of the column, or on top of other pieces already in
* that column. For an illustration of the boa... | true |
b16a8adfd28a60f483ace70bb4ebd808af2103f9 | C++ | raghavdotcom/chamber-crawler | /game/subjects/characters/enemies/enemy.h | UTF-8 | 1,479 | 3.234375 | 3 | [] | no_license | #ifndef __ENEMY__
#define __ENEMY__
#include "../character.h"
#include "../../items/treasures/treasure.h"
#include "../../items/treasures/normalHoard.h"
#include "../../items/treasures/smallHoard.h"
#include <memory>
using namespace std;
class Enemy : public Character
{
private:
/* data */
public:
Enemy(int h... | true |
c57c78197ceec98fca9cf117d6f7438d99dbeafd | C++ | vrsys/lamure | /apps/rendering/MatrixInterpolation.cpp | UTF-8 | 946 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2014-2018 Bauhaus-Universitaet Weimar
// This Software is distributed under the Modified BSD License, see license.txt.
//
// Virtual Reality and Visualization Research Group
// Faculty of Media, Bauhaus-Universitaet Weimar
// http://www.uni-weimar.de/medien/vr
#include "MatrixInterpolation.hpp"
g... | true |
702ec2a8a9b2faa89a113a5bc075a07f4505ac8a | C++ | myu404/HuntTheWumpus | /HuntTheWumpusLib/UserNotification.cpp | UTF-8 | 3,734 | 3.140625 | 3 | [] | no_license | /*
* Author: Michael Yu
* C++ Programming, Spring 2021
* Hunt The Wumpus: Assignment 05
* 6/20/2021
*/
#include "UserNotification.h"
#include <iostream>
#include <stdexcept>
namespace HuntTheWumpus
{
std::ostream& operator<<(std::ostream& out, const UserNotification::Notification& value)
{
static std:... | true |
3ceb62b3fc27d65372faf312d6af430384068e03 | C++ | petuzk/Warcaby | /inc/game/board/BoardConst.hpp | UTF-8 | 420 | 2.65625 | 3 | [
"MIT"
] | permissive | #pragma once
/* Przechowuje podstawowe stałe dotyczące plansy.
* Ma to na celu ułatwienie zmiany zasad gry, ackolwiek
* w implementacji często są pewne założenia co do tych wartości.
*/
class BoardConst {
public:
static constexpr int SIZE = 8;
static constexpr int START_ROWS = 3;
static_assert(START_ROWS * 2 <=... | true |
fd6875e139753b5e98934e807e619f4f1b2e9e77 | C++ | patmosxx-v2/reed-solomon | /rs.cc | UTF-8 | 4,573 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "rs.hh"
#include <stdexcept>
#include <string.h>
#include <iostream>
extern "C" {
#include <fec.h>
}
using namespace std;
RSCodec::RSCodec(const std::vector<unsigned int>& roots, unsigned int fcr, unsigned int prim, unsigned int nroots, unsigned int pad, unsigned int bits)
: d_N((1<< (bits)) - pad -1),
... | true |
1567c28f588ca3cb0c15c3f008f64d8262ae10c0 | C++ | syedbilal07/cplusplus | /C++ Basics/Chapter 5 - Modifier Types/ModifierTypes/main.cpp | UTF-8 | 335 | 3.203125 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
short unsigned int x; // value always positive
short signed int y; // value can be positive or negative
x = 50000;
y = 50000;
cout << x << endl; // 50000
cout << y << endl; // -15536
... | true |
3e539976cd497623efd986d21c264d02f8678fd6 | C++ | TimPhoeniX/MyUJ | /AiSD2/1/main.cpp | UTF-8 | 472 | 3.15625 | 3 | [] | no_license | #include "ctl_set.hpp"
template class Set<int>;
int main()
{
AbstractSet<int>* A = new Set<int>();
AbstractSet<int>* B = new Set<int>();
A->Insert(1);
A->Insert(2);
A->Insert(3);
B->Insert(3);
B->Insert(4);
B->Insert(5);
A->Print();
B->Print();
auto C = A->Sum(B);
C->Print();
auto D = A->Difference(B);
... | true |
71890644995ca73438f5eb87f6a9873d087dca86 | C++ | FinancialEngineerLab/XPricer | /VanillaOption.h | UTF-8 | 932 | 2.65625 | 3 | [] | no_license | #ifndef VANILLAOPTION_H
#define VANILLAOPTION_H
#include "VanillaPayoff.h"
#include "PricingEngine.h"
#include "Option.h"
#include <memory>
using std::shared_ptr;
class VanillaOption : public Option
{
public:
class Arguments;
class Engine;
VanillaOption(){}
VanillaOption(const shared_ptr<VanillaP... | true |
2561c49c43d8acb2a3afb544b5ff7118fe1406b2 | C++ | kermado/Suborbital | /source/suborbital/component/ComponentRegistry.cpp | UTF-8 | 2,484 | 2.84375 | 3 | [
"MIT"
] | permissive | #include <suborbital/component/ComponentRegistry.hpp>
#include <suborbital/component/AttributeFactory.hpp>
#include <suborbital/component/PythonBehaviourFactory.hpp>
#include <suborbital/component/PythonAttributeFactory.hpp>
namespace suborbital
{
ComponentRegistry::ComponentRegistry()
: m_factory_registry()
... | true |
5d89ce1035b9affe9a83fbc6c21ff2fcac543e0c | C++ | Demix361/Algorithm-Analysis | /lab_5/code/processing.cpp | UTF-8 | 1,363 | 3.09375 | 3 | [] | no_license | #include "processing.h"
Processing::Processing(int count, QTime *timer, PostProcessing *p, QMutex *mutex2, QMutex *mutex3)
{
this->_count = count;
this->_timer = timer;
this->_proc = p;
this->_mutex2 = mutex2;
this->_mutex3 = mutex3;
}
void Processing::addToQueue(MyObject obj)
{
_queue.push(... | true |
5b300421f7c8e83c76c14f0812fa217bb7a166cf | C++ | comp413-2017/RDFS | /utility/config-reader/ConfigReader.cc | UTF-8 | 1,621 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <unordered_map>
#include "ConfigReader.h"
#include <pugixml.hpp>
#include <easylogging++.h>
namespace config_reader {
using namespace pugi;
const char *ConfigReader::HDFS_DEFAULTS_CONFIG = "hdfs-default.xml";
ConfigReader::ConfigReader() {
InitHDFSDefaults();
}
int ConfigReader::get... | true |
db04bf4ca76d673ba793e9bb7d3966c86a6db816 | C++ | BinhNMT/Code_Metric | /CodeMetric_Lib/CommentMetric.h | UTF-8 | 1,599 | 2.578125 | 3 | [] | no_license | /*
* CommentMetric.h
*
* Created on: Apr 11, 2020
* Author: BinhNMT
* Email: binhmainguyen193@gmail.com
*/
#ifndef COMMENTMETRIC_H
#define COMMENTMETRIC_H
#include <string>
using namespace std;
namespace C_M
{
class CommentMetric
{
private:
// @brief : a flag that used to notice in a block comm... | true |
9f40a2d5598c34804ae6a8805e5590ddd3ba1960 | C++ | willjie/LeetCode | /Binary Tree Level Order Traversal II.cpp | GB18030 | 1,575 | 3.859375 | 4 | [] | no_license | /*
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
return its bottom-up level order traversal as:
[
[15,7],
[9,20],
[3]... | true |
edba44a0ba7f8df46387c1f39a3ed1fd7cf62e02 | C++ | alexandraback/datacollection | /solutions_5640146288377856_1/C++/Mastojun/main.cpp | UTF-8 | 509 | 2.5625 | 3 | [] | no_license | #include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
#include <string>
#include <unordered_map>
#include <queue>
#include <algorithm>
using namespace std;
int T;
int R, C, W;
int solve() {
if(C % W == 0) return C / W + W - 1 + C / W * (R - 1);
return C / W + W + C / W * (R - 1)... | true |
44de6ab05c8a85a3b9bf9597a75ef8e2f2d5288d | C++ | A-Day-in-the-Woods/A-Day-in-the-Woods | /ARGO/ARGO/MenuScreen.h | UTF-8 | 1,607 | 2.609375 | 3 | [] | no_license | #ifndef MENU
#define MENU
#include <SDL.h>
#include <SDL_image.h>
#include <iostream>
#include <Game.h>
#include <Player.h>
#include <InputSystem.h>
#include "CharacterFactory.h"
#include"AudioManager.h"
class Game;
class MenuScreen
{
public:
MenuScreen(Game& game, SDL_Renderer* t_renderer, SDL_Event &event, Gam... | true |
4f5262af977d32d3fa5fb31280ea6b537f54e0bc | C++ | avovana/tasks | /olympiad_tasks/1313.cpp | UTF-8 | 2,096 | 3.1875 | 3 | [] | no_license | // Task - http://acm.timus.ru/problem.aspx?space=1&num=1313&locale=en
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <limits>
using Raw = std::vector<unsigned int>;
struct Node
{
size_t index{0};
Raw raw;
};
using Matrix = std::vector<Node>;
auto getMatrix()
{
size_... | true |
ea407132742fa6e2903ae48eb372439459a22f91 | C++ | Coutinho020/Apontamentos-ISEC | /2ºAno/1ºSemestre/POO/TP/TP_POO/TP_POO/imperio.cpp | ISO-8859-1 | 8,693 | 2.703125 | 3 | [] | no_license | #include "imperio.h"
Imperio::Imperio()
{
territorios.push_back(new TerrInic());
}
Imperio::Imperio(const Imperio& imp) {
*this = imp;
}
Imperio& Imperio::operator=(const Imperio& imp) {
cofre = imp.cofre;
armazem = imp.armazem;
forca_militar = imp.forca_militar;
pontos_vitoria = imp.pontos_vitoria;
sorte ... | true |
8b12c46499166a3a9780d09c8476e9421dcaa33b | C++ | krishna-mathuria/competitive | /dsasheet432.cpp | UTF-8 | 1,847 | 3.109375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int MAX = 100;
bool sumZero(int temp[], int* starti,int* endj, int n)
{
map<int, int> presum;
int sum = 0; // Initialize sum of elements
int max_length = 0;
for (int i = 0; i < n; i++)
{
sum += temp[i];
if (temp[i] == 0 && max_length == 0)
{
*star... | true |
66ab3135666480007478a919b58452d57f72e497 | C++ | Carson13331145/TALK_ROBOT | /Robot/robot_v2.0/algorithm.h | UTF-8 | 2,928 | 3.0625 | 3 | [] | no_license | #ifndef ALGORITHM_H
#define ALGORITHM_H
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
using namespace std;
char* string_to_char(string src) {
char *ch = new char[src.length()+1];
for (int i = 0; i < src.length(); i++) {
ch[i] = src[i];
}
ch[src.length()] = '\0';
ret... | true |
f5ea144b1e8675dfa94de3a863fc6bb35945eb73 | C++ | jiwon4178/practice | /2020-09-02-1.cpp | UTF-8 | 1,538 | 3.25 | 3 | [] | no_license | #include <string>
#include <vector>
#include <algorithm>
#include <queue>
//https://programmers.co.kr/learn/courses/30/lessons/49189
int solution(int n, std::vector<std::vector<int>> edge) {
int answer = 0;
std::vector<int> dv(n,0); // 거리에 따른 개수 기록용
// 반대 간선도 넣기
int s = edge.size();
for(int i... | true |
0fa83348be723b732b797d08ad268ebdd44bb350 | C++ | SnigdhaD/MorphIO | /src/mitochondria.cpp | UTF-8 | 962 | 2.71875 | 3 | [] | no_license | #include <morphio/mito_section.h>
#include <morphio/mitochondria.h>
namespace morphio {
const MitoSection Mitochondria::section(const uint32_t& id) const
{
return MitoSection(id, _properties);
}
const std::vector<MitoSection> Mitochondria::sections() const
{
std::vector<MitoSection> sections_;
for (unsign... | true |
c3ace4616f32025d6c3d9efc5e6b4426788d2cfd | C++ | chenna1199/Data-Structures-Algorithms-Handbook | /Trees/Left-View-of-Binary-Tree.cpp | UTF-8 | 2,073 | 3.703125 | 4 | [
"MIT"
] | permissive | // Given a Binary Tree, print Left view of it. Left view of a Binary Tree is set of nodes visible when tree is visited from Left side. The task is to complete the function leftView(), which accepts root of the tree as argument.
// Left view of following tree is 1 2 4 8.
// 1
// / \
// ... | true |
e4dfd2c1e40c426df08478cb2ae217fda5848faa | C++ | MoeMod/Thanatos-Launcher | /Interface/IGameUIFuncs.h | UTF-8 | 2,429 | 2.609375 | 3 | [] | no_license | #ifndef IGAMEUIFUNCS_H
#define IGAMEUIFUNCS_H
#include <interface.h>
#include "vgui/VGUI2.h"
#include "vgui/KeyCode.h"
#include "modes.h"
/**
* Provides a number of GameUI functions.
*/
class IGameUIFuncs : public IBaseInterface
{
public:
/**
* Gets whether a key is down or not.
* @param keyname Key whose state s... | true |
59f86f98113c2f58e33e9ffd260bfb7f5069a850 | C++ | LU-JIANGZHOU/Cpp-Snippets | /Cpp-Snippets-02-constexpr/main.cpp | UTF-8 | 720 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
#define LEN 10
int len_foo()
{
int i = 2;
return i;
}
constexpr int len_foo_constexpr()
{
return 5;
}
constexpr int len_foo_constexpr(const int n)
{
if (n < -1)
return -1;
else if (n > 1)
return 1;
else
return 0;
}
int main()
{
char arr01[10]; // o... | true |
be3cdba7d73e90e68f6cbc03c9f3562c3cb58804 | C++ | vinayrn12/gfg_interview_questions | /Dynamic programming/Longest common Subsequence/Edit distance/main.cpp | WINDOWS-1258 | 855 | 3.28125 | 3 | [] | no_license | /*
Given two strings str1 and str2 and below operations that can performed on str1.
Find minimum number of edits (operations) required to convert str1 into str2.
Insert
Remove
Replace
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s1, s2;
getline(cin, s... | true |
9ea5b3c68e77fe303555d9c566e59e9a1b911126 | C++ | javileyes/curso-cpp | /Dia22/lst22-04.cxx | ISO-8859-1 | 588 | 2.953125 | 3 | [] | no_license | // Listado 22.4 Muestra el uso de control de versiones
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int tirarDado(void);
main (int argc, char * argv[])
{
int i;
int iIter;
int Dado[ 6 ];
if(argc < 2)
{
printf("Uso: %s n\n", argv[0]);
return 1;
}
iIter = atoi(argv[1]);
me... | true |
bb7e3d6183052490666b36ae5d4b0b30b0bcf404 | C++ | ded1ad/Progream_Files-Bookqt- | /3.6.2.cpp | WINDOWS-1251 | 647 | 2.984375 | 3 | [
"Unlicense"
] | permissive | // ++. x y. -
//, (x; y) .
// . 3.613.85.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
float x, y;
cout << "x=";
cin >> x;
cout << "y=";
cin >> y;
if (y <= 0 && y >= -4 * x - 12 && y >= -4 && y >= 4 * x - 12)
cout << "In the region" << endl;
else
cout << "Not i... | true |
a7318c9b7378fd75f7616a5775224dc440c04c6e | C++ | AeonFlor/Algorithm | /BOJ/BOJ_10798.cpp | UTF-8 | 706 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(void)
{
vector<string> arr(5);
string line;
for(int i=0; i<5; ++i)
{
getline(cin,line);
arr[i]=line;
}
for(int i=0; i<15; ++i)
{
for(int j=0; j<5; ++j)
{
if(arr[j].length()>i)
cout<<arr[j][i];
}
}
}
// ... | true |
7f33f5185e1eaab854802183b49660955f59270c | C++ | vshreyas/serialize | /binary_streamwriter.hpp | UTF-8 | 2,854 | 3.296875 | 3 | [] | no_license | /**
* @file binary_streamwriter.hpp
* @author Shreyas Vinayakumar
* @date Tue Dec 4 17:39:19 2012
*
* @brief Classes/methods to serialize binary data in a compact format
* Expected to be used for native data i.e. currently non-portable. Will be extended to portable also in next revision
*/
#ifndef BINARY_... | true |
55cdf66563743ceff8c2c67b9ae7578969be6ef4 | C++ | broccolism/study_with_alcohol | /3_DP/broccolism_1890_jump.cpp | UTF-8 | 944 | 3.046875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int BOARD[101][101] = {};
long long CASE[101][101] = {};
int N;
/*dp() return type을 int로 해서 제출하니까 자꾸 틀림ㅋㅋ
으악*/
long long dp()
{
CASE[0][0] = (long long)1;
for (int i = 0; i < N; ++i)
{
for (int j = 0; j < N; ++j)
{
for (int x = 1; x < ... | true |
ccd96f476732d6222b1363e3dfb7a5487d307f08 | C++ | yogesh019/DataStructures | /HashTable/stringContainsAtMostNDifferentCharacters.cpp | UTF-8 | 589 | 3.578125 | 4 | [] | no_license | #include<iostream>
#include<string>
#include<unordered_set>
using namespace std;
bool CheckCount(const string&s,int N){
unordered_set<char>check;
int i=0;
while(s[i]){
check.insert(s[i]);
i++;
}
return check.size()<=N;
}
int main(){
string s;
int N;
cout<<"Enter string: ... | true |
408eadf095b60129d1a3b48164f7a54e46c12f3e | C++ | shadab16/ProjectEuler | /src/78.cpp | UTF-8 | 668 | 2.75 | 3 | [] | no_license | #include <iostream>
const long limit = 100000;
const long mod = 1e6;
const long sign[2] = {-1, 1};
// Partition cache
long partition[limit] = {1};
int main() {
long n = 0;
while (++n < limit) {
for (long k = 1; k <= n; ++k) {
const long long p1 = (k * (3 * k - 1)) / 2;
if (n - p1 < 0) {
// n-p... | true |
9a561a862c1e24506eb9d4c5abec33818f12fb04 | C++ | shipoyewu/code | /CF#313B.cpp | UTF-8 | 584 | 2.765625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int a[3][2];
int main(){
for(int i = 0;i < 3;i++){
scanf("%d%d",&a[i][0],&a[i][1]);
}
int flag = 0;
for(int i = 0;i < 2;i++){
int x = a[1][i] + a[2][i];
int y = max(a[1][1-i],a[2][1-i]);
if(x <= a[0][0] && y <= a[0][1] || x <= ... | true |
e104ebb0f0d59bedab6bf3df35565d23e3d63016 | C++ | laninivan/3dModelMaker | /src/Object/LightSource.cpp | UTF-8 | 590 | 2.671875 | 3 | [] | no_license | #include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#ifndef LIGHT_S
#define LIGHT_S
class LightSourse {
public:
LightSourse()
{
this->position = glm::vec3(20.0f, 40.0f, 60.0f);
this->color = glm::vec3(1.0f, 1.0f, 1.0f);
... | true |
3483827dc54d77019e3174f1492c293e5a04f9a0 | C++ | ulissesg/Heap_Sort_Tree | /main.cpp | UTF-8 | 1,053 | 3.71875 | 4 | [] | no_license | //Ulisses Genguini - 2019
#include<stdio.h>
#include <stdlib.h>
void imprimeVetor (int *v){
for (int i = 0; i< 10; i++){
printf("-%d\n", v[i]);
}
}
void troca(int *v1, int *v2){
int aux = *v1;
*v1 = *v2;
*v2 = aux;
}
void Heapify(int *Arv, int i, int n){
int left = 2*(i+1)-1;
int... | true |
0e48caf0f89961fba0c069a1df0585b1ee099766 | C++ | HarielGiacomuzzi/Trabalho-Final-Redes | /Exemplos/Trabalho1/IPProtocol.cpp | UTF-8 | 2,432 | 3.140625 | 3 | [] | no_license | #include "IPProtocol.h"
#include <stdio.h>
void IPProtocol::setPackage(unsigned char *pckg){
this->package = pckg;
}
IPProtocol::IPProtocol(){}
IPProtocol::~IPProtocol(){}
// identifies the type of service and send's back the enum that represent it
int IPProtocol::identifyPackageSize(){
if(this->identifyPro... | true |
da57522b448cea0a102708ae4b8e43c0901e52a9 | C++ | Dimeurg/DisplayProjectsTask | /src/Parser.cpp | UTF-8 | 1,248 | 2.5625 | 3 | [] | no_license | #include "Parser.h"
#include <QJsonArray>
#include <QJsonObject>
#include <QStringLiteral>
void Parser::projectsInfoParse(const QJsonArray& projectsInfo, std::vector<std::shared_ptr<ProjectInfo>>& projectsOutput)
{
std::vector<std::shared_ptr<ProjectInfo>> projects;
for(auto infoJson : projectsInfo)
{
... | true |
643e20623292d10547e633936ec0323d4a958c6e | C++ | Murami/rtype | /Server/include/Game/AMonster.hh | UTF-8 | 656 | 2.90625 | 3 | [] | no_license |
#ifndef _MONSTER_HH_
# define _MONSTER_HH_
# include <string>
# include <cstdint>
# include "APlugin.hh"
class AMonster : public PluginManager::APlugin
{
public:
virtual ~AMonster() {}
std::uint32_t getLevel() const;
bool isAlive() const;
void takeDamage(std::uint32_t damage);
virtual std::uint32_t b... | true |
549785f8a1790b76edf30abb71421ecba827a8f7 | C++ | motepc/Euler | /48.Self_index.cpp | UTF-8 | 780 | 3.109375 | 3 | [] | no_license | /*
The series, 11 + 22 + 33 + ... + 1010 = 10405071317.
Find the last ten digits of the series, 11 + 22 + 33 + ... + 10001000.
*/
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
int i, j, k, carry, num[10], acc[10] = {0};
for(i=1;... | true |
81e70919e137bd241532c34fa808dbc35dcfdecc | C++ | fredlim/GameEngine | /Tools/FBXLoader/Display/DisplayLight.cpp | UTF-8 | 1,858 | 2.6875 | 3 | [] | no_license | #include "DisplayLight.h"
#ifdef DUMP_FBX_INFO
namespace Tools
{
namespace DisplayLight
{
void DisplayDefaultAnimationValues( FbxLight *i_light );
}
}
void Tools::DisplayLight::DisplayLight( FbxNode* i_node )
{
DisplayCommon::DisplayString( "\n\n--------------------\nLight\n--------------------" );
FbxLight ... | true |
a76c6b035e02cf6471aa0e2e998f4de38de721c2 | C++ | ponlawat-w/cpp-tsp | /classes/frontierZdd/frontierMap.cpp | UTF-8 | 2,088 | 3.015625 | 3 | [] | no_license | #include "frontierMap.hpp"
namespace TSP::FrontierZDD {
FrontierMap::FrontierMap(Graph* graph, bool induced) {
this->graph = induced ? graph->clone()->makeCompleteGraph() : graph->clone();
set<Edge*> edgeSet = this->graph->getEdgeSet();
this->edges = this->edgeSetToArray(edgeSet);
... | true |
4f87be2034f6ec60c6972354adcdbf2ef7e6e066 | C++ | vishnujayvel/SPOJ-1 | /GNY07B.cpp | UTF-8 | 580 | 2.828125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
USER: zobayer
TASK: GNY07B
ALGO: ad-hoc
*/
#include <iostream>
#include <string>
using namespace std;
int main()
{
int t, x;
double val;
string unit;
ios::sync_with_stdio(false);
cout.setf(ios::fixed,ios::floatfield);
cout.precision(4);
cin >> t;
for(x=1; x<=t; x++)
{
cin >> val >> unit;
if(unit=="kg"... | true |
37cb34c72138633e6bdc215386f030409428205d | C++ | wilmercastrillon/Ejercicios-Uva-Judge-Online | /Competitive Programming 3/Data Structures and Libraries/Data Structures with Our-Own Libraries/12532 Interval Product___2.cpp | UTF-8 | 571 | 2.640625 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<int, int> ii;
int main(){
int casos, a, x;
scanf("%d", &casos);
while(casos--){
scanf("%d", &a);
vector<ii> v;
for(int i = 0; i < a; i++)
scanf("%d", &x), v.push_back(ii(x, i));... | true |
9ecdf896c2fd6fa1a657a6de08937b34a62f289e | C++ | NathanYu1124/PLR_Vision | /NYPR/Model/NYCharacter.hpp | UTF-8 | 1,197 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | //
// NYCharacter.hpp
// NYPlateRecognition
//
// Created by NathanYu on 29/01/2018.
// Copyright © 2018 NathanYu. All rights reserved.
//
#ifndef NYCharacter_hpp
#define NYCharacter_hpp
#include <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
class NYCharact... | true |
8f782ed0e26fb78690383012403a97f77ffecdec | C++ | rohmer/HydroGarden | /InstallLib/Version.h | UTF-8 | 2,135 | 3.171875 | 3 | [] | no_license | #pragma once
#include <sstream>
#include <string>
#include <json.hpp>
struct sVersion
{
private:
unsigned int major, minor, buildNum;
public:
sVersion()
: major(0)
, minor(0)
, buildNum(0)
{
}
sVersion(int major, int minor, int buildNum)
: major(major)
, minor(minor)
, buildNum(buildNum)
{
}
b... | true |
8d62c1be6d6475f8200a634ae3c46dd3cd6d519d | C++ | freezer-glp/leetcode-submit | /src/Construct Binary Tree from Preorder and Inorder Traversal.cpp | UTF-8 | 1,774 | 3.53125 | 4 | [] | no_license | /*Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
Hide Tags Tree Array Depth-first Search
Show Similar Problems
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* Tree... | true |
7728d89babf7a60a0c205adf63dad20075ba8d73 | C++ | mananmangal/codechef-solution | /practice/beginner/SUMTRIAN.cpp | UTF-8 | 510 | 2.65625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
for(int i=0;i<t;i++){
int n;
cin>>n;
int arr[n][n];
for(int j=0;j<n;j++){
for(int k=0;k<=j;k++){
cin>>arr[j][k];
}
}
for(int j=n-1;j>0;j--){
for(int k=0;k<=j;k++){
... | true |
d4b1b997186e823c550625daf5dbe760db16e1b4 | C++ | MargaretKocherga/MovieTickets | /SourceFiles/editwindow.h | UTF-8 | 1,245 | 2.640625 | 3 | [
"MIT"
] | permissive | #ifndef EDITWINDOW_H
#define EDITWINDOW_H
#include <QDialog>
#include "seance.h"
namespace Ui {
class EditWindow;
}
class EditWindow : public QDialog
{
Q_OBJECT
//Очередь сеансов на определенный день
Queue<Seance> arrayOfSeances;
//Выбранная дата
QString selectedDate;
//Флаг редактирования/до... | true |
703b9f6d083af38b8ee1f4cefb6b9fc4296f00fa | C++ | higgsch/CS6300 | /Optimizations/MaximizeBlocks/MaximizeBlocks.cpp | UTF-8 | 1,717 | 2.515625 | 3 | [] | no_license | #include <algorithm>
#include "MaximizeBlocks.hpp"
#include "AST/BasicBlock.hpp"
#include "AST/ThreeAddressInstruction.hpp"
#include "VisitedBlocks.hpp"
#include "NumParents.hpp"
void cs6300::maximizeBlocks(cs6300::FlowGraph& original)
{
// traverse the blocks
auto vb = VisitedBlocks::instance();
vb->reset();
... | true |
f5cffa833f37390b4df13cb380fc7d6ac9514dfc | C++ | rslinford/DWC_CS217_Data-Structures-and-Algorithms | /Structures/sortedlist.cpp | UTF-8 | 1,963 | 2.84375 | 3 | [] | no_license | /*! \file sortedlist.cpp
* \brief Definitions for class container::SortedList
*
* \section svn Source Control
*
* $URL: http://tablet-001/svn/DWC/CS217/trunk/Structures/sortedlist.cpp $
* $Date: 2009-06-10 21:54:03 -0400 (Wed, 10 Jun 2009) $
* $Author: slinford $
* $Revision: 385 $
*
* \section ... | true |
628ccc82a679905860d7521b0e1aec85a1fa7b72 | C++ | zhangjiangen/SnowTerrainDeformation | /Engine/API/Code/Graphics/Material/FramebufferMaterial.h | UTF-8 | 1,491 | 2.515625 | 3 | [] | no_license | #pragma once
#include "../../Toolbox/Toolbox.h"
#include "Material.h"
#include "../Shader/ShaderParameter/ShaderParameterTexture.h"
#include "../Shader/ShaderParameter/ShaderParameterBool.h"
namespace ae
{
/// \ingroup graphics
/// <summary>Framebuffer shading settings for rendering.</summary>
/// <seealso cref="M... | true |
b5661f11b33faddeb0c0df3a5aa4ffc87ffa9ad9 | C++ | hallgeirl/hiage-original | /src/mario/mariosystems.cpp | UTF-8 | 6,200 | 2.59375 | 3 | [] | no_license | #include "mariosystems.hpp"
#include "mariocomponents.hpp"
#include "events.hpp"
using namespace std;
using namespace hiage;
CharacterStateMachineSystem::CharacterStateMachineSystem() : System()
{
}
void CharacterStateMachineSystem::registerSystem(flecs::world& world)
{
world.system<CollidableComponent, StateCompon... | true |
d60aa6f53f962cb68e4162c5d4b82e153e0951f5 | C++ | jameshfisher/align | /align.cpp | UTF-8 | 6,645 | 3.40625 | 3 | [
"MIT"
] | permissive | /* Given some standard input, fold it to the specified line length in the
* same manner as the `fold` tool, but ensure that appropriate lines are
* justified to the specified line length by inserting spaces at heuristically
* appropriate places.
*/
#include <math.h>
#include <iostream>
#include <vector>
#include <... | true |
7406da4890cd87eaa61557b170d6a45ee4a8e6f8 | C++ | pompon0/traders_puzzle | /utils/number_theory.h | UTF-8 | 671 | 3.296875 | 3 | [] | no_license | #ifndef UTILS_NUMBER_THEORY_H_
#define UTILS_NUMBER_THEORY_H_
namespace util {
template<typename T> constexpr T pow(T a, T b) {
T res = 1;
while(b) {
if(b&1) res *= a;
a *= a;
b >>= 1;
}
return res;
}
// inv(a)*a % (1<<bits(T)) = 1
// T is an unsigned integer type.
template<typename T> constexpr ... | true |
2cb5ba2217d480cbb4cd510eae7c5993a7c8f2bf | C++ | jschulz97/3220 | /FinalProject/Encrypt.h | UTF-8 | 347 | 2.859375 | 3 | [] | no_license | /**
*
*/
std::string encrypt(std::string m) {
int count = 0, keycount = 0;
std::string key = "banking";
for(auto i : m) {
if(keycount == 7)
keycount = 0;
m[count] = i+key[keycount];
while(m[count] < 33) {
m[count]+=93;
}
while(m[count] > 126) {
m[count]-=93;
}
count++;
key... | true |
c32d5e11b7e68dc21e0eb8dd0e6bce68ecd737cd | C++ | FRENSIE/FRENSIE | /packages/monte_carlo/collision/core/test/tstAceLaw4NuclearScatteringEnergyDistribution.cpp | UTF-8 | 5,910 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | //---------------------------------------------------------------------------//
//!
//! \file tstAceLaw4NuclearScatteringDistribution.cpp
//! \author Alex Bennett
//! \brief Law 4 neutron scattering distribution unit tests
//---------------------------------------------------------------------------//
// Std Lib In... | true |
e82203e63b4f004ba6a5b5e2b631572133d1e2ed | C++ | beautifularea/misc | /std_bind_weak_fn.cc | UTF-8 | 3,285 | 3.203125 | 3 | [] | no_license | #ifndef BOOST_WEAK_FN_HPP
#define BOOST_WEAK_FN_HPP
#include <memory>
#include <iostream>
namespace std {
template <typename T = void>
struct ignore_if_invalid { T operator()() const {} };
template <typename V = void>
struct throw_if_invalid {
V operator()() const {
throw std::bad_weak_ptr();
}
};
... | true |
051eb98f5ace9592c010e0ef00c8aed234243b8b | C++ | tanmayGIT/Teaching | /La_Rochelle/IUT/iOS/Learn_iOS/VariousSequenceMatchingTechniques/VariousSequenceMatchingTechniques/numeric.h | UTF-8 | 1,806 | 3.359375 | 3 | [
"MIT",
"BSL-1.0"
] | permissive | /*!
\author Abdourahman Aden Hassan
\date 20/12/2013
*/
#ifndef NUMERIC_H
#define NUMERIC_H
#include "element.h"
namespace model{
class Numeric : public Element
{
/*!
* \class Numeric
* \brief Cette classe définit un élément de type numérique pour une séquence.
* Inherits Element
* \packa... | true |
f70c792c03d9e93998c1a97d64d547cad627c29f | C++ | Pyk017/C | /Code_regular/LetterCountOfaString.cpp | UTF-8 | 353 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main()
{
int i=0,b[100]={0};char a[100];
printf("Enter a String :- \n");
gets(a);
while(a[i]!=NULL)
{
if((a[i]>='A' && a[i]<='Z') || (a[i]>='a' && a[i]<='z'))
{
b[a[i]-'A']++;
}
i++;
}
for(int i=0;i<52;i++)
{
if(b[i]!=0)
printf(" %c is occcured %d time... | true |
bec3aebc60284c8181171bf6ba69362313d61fec | C++ | JavierSLX/Deitel-cpp | /Cap_03/Exer3_15/Fecha.cpp | UTF-8 | 602 | 3.421875 | 3 | [] | no_license | #include "Fecha.h"
void Fecha::establecerDia(int dia)
{
if (dia < 1)
diaFecha = 1;
else
diaFecha = dia;
}
void Fecha::establecerMes(int mes)
{
if (mes >= 1 && mes <= 12)
mesFecha = mes;
else
mesFecha = 1;
}
void Fecha::establecerAno(int ano)
{
anoFecha = ano;
}
in... | true |
8703b0bf5e34be114f9b3421ce341dd89030d6e4 | C++ | andylang8445/BOSSMONSTER_Final_BACKUP | /20180311/괄호의 값/괄호의 값/main.cpp | UTF-8 | 676 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
//#include<conio.h>
//#pragma warning(disable: 4996)
int multiple = 1;
int sum = 0;
int n, m;
char queue[50];
int main()
{
scanf("%s", queue);
for (int i = 0; queue[i] != NULL; i++)
{
if (queue[i] == '(')
{
n++;
multiple *= 2;
if (queue[i + 1] != NULL && queue[i + 1] == ')')
sum +=... | true |
c03a9825a39b112424215bb296be9a1f52797d69 | C++ | erwa/robotics-lab-2020 | /servo-test-2/servo-test-2.ino | UTF-8 | 1,287 | 2.53125 | 3 | [] | no_license | #include <Romi32U4.h>
#include <Servo.h> //Servo library
Romi32U4ButtonA buttonA;
Servo testservo; //initialize a servo object for the connected servo
uint32_t next;
int angle = 0;
void setup()
{
buttonA.waitForButton();
delay(1000);
// gripper: 500: ... | true |
74375de865ce00bb9812f68ffc17f91c3b164719 | C++ | taruchu/ServicePool | /ServicePool/NETOLookUp.cpp | UTF-8 | 2,100 | 2.75 | 3 | [] | no_license | #include "NETOLookUp.h"
void* NETOLookUp::FirstResourceProviderMatching(string property)
{
if(VerifyProperty(property) == false)
return nullptr;
else
{
map<__int64, void*>::iterator itr;
__int64 index;
for (itr = _propertyTable[property].begin(); itr != _propertyTable[property].end();)
{
index = itr->... | true |
f14cb38c7ad3ed2a1db5c4d5cfba8959d7f30137 | C++ | Witek902/Raytracer | /Core/Math/Vector4.h | UTF-8 | 13,191 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Math.h"
#include "Float2.h"
#include "Float3.h"
#include "VectorBool4.h"
namespace rt {
namespace math {
/**
* 4-element SIMD vector
*/
struct RT_ALIGN(16) Vector4
{
union
{
float f[4];
int32 i[4];
uint32 u[4];
#ifdef RT_USE_SSE
__m128 v;
__m... | true |
e60c9bd5ab17dc872d07a08c67d0eb4aed05ca4e | C++ | GauravS99/Arduino-Smartphone-Car | /Arduino_Car_Control.ino | UTF-8 | 3,734 | 3.359375 | 3 | [] | no_license | /*Arduino Car Controller
*
* The following program will allow the user to run a car equipped with an arduino, motor shield, and onesheeld to
drive the car using their android smartphone.
It makes use of the Adafruit Motor Shield Library.
The motor.run() command sets the motor to move either FORWARD,BACKWARD, ... | true |
ec4df1d19e5518ff0933b0bd28bfdf9fb0404118 | C++ | sploitfun/sploitfun | /XploitDev1/bof.cpp | UTF-8 | 2,120 | 2.640625 | 3 | [] | no_license | /*
Buffer Overflow Demo Program
cl /GS- bof.cpp - Disable Stack cookie(/GS)
link /defaultlib:ws2_32.lib bof.obj
*/
#include <winsock2.h>
#include <stdio.h>
#define BUFLEN 1024
void bof(char *recvbuf) {
char sendBuf[512];
strcpy(sendBuf,recvbuf);
}
int main() {
WSADATA wsaData;
int resul... | true |
984790f39eabdee0d90625f9e208bb50a9616a5e | C++ | Silly-Face-LLC/Dynamite-Engine | /Dynamite Engine/Dynamite Engine/Source.cpp | UTF-8 | 1,164 | 2.96875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <Windows.h>
using namespace std;
int main()
{
string senario;
string choice1;
string choice1a;
string choice2;
string choice2a;
string userchoice;
cout << "Dynamite Engine \n";
cout << "v0.1.0a \n";
cout << "Create your own choices game! \n";
c... | true |
86ce4c95321e2a1df810158015f2b2082c2bd515 | C++ | Wallace-Chen/LeetCode | /0066PlusOne.cpp | UTF-8 | 652 | 3.140625 | 3 | [] | no_license | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int len = digits.size(), carryover = 1, pos=len-1;
while(pos>=0 && carryover){
int tmp = carryover + digits[pos];
carryover = tmp/10;
digits[pos] = tmp%10;
pos--;
}
if(... | true |
e3e5eecc2fd08a520e0a8b50d7d93af19bfdb08b | C++ | banjowabble/BT07 | /A3.cpp | UTF-8 | 440 | 3.3125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int countEven(int*, int);
int main ()
{
int a[10] = {1,2,3,4,5,6,7,8,9,10};
countEven(a, 10);
}
int countEven(int* a, int n)
{
int count = 0, revCount = 0;
for (int i=0; i<5; i++)
{
if (a[i] % 2 == 0) count++;
}
for (... | true |
9edc0c880cea7fb86990ab4587e8c268bc692e77 | C++ | JatinSharma2821/C-plus-plus | /Functions/Armstrong.cpp | UTF-8 | 669 | 3.40625 | 3 | [] | no_license | #include<iostream>
#include<math.h>
using namespace std;
// Armstrong no. - A no. whose sum of cube of all digits is equal to no. itself.
int main()
{
int num;
cout<<"This Program is to check wether the given is armstrong or not."<<endl;
cout<<"Enter number to check"<<endl;
cin>>num;
int rem ;
int sum = 0... | true |
9da3d5b195bf2adc8598d802f6e96469f6cee8bf | C++ | lpcteste/wc3data | /DataGen/datafile/id.cpp | UTF-8 | 343 | 2.671875 | 3 | [] | no_license | #include "id.h"
#include "utils/common.h"
std::string idToString(uint32 id) {
if ((id & 0xFFFF0000) == 0x000D0000) {
return fmtstring("0x%08X", id);
} else {
std::string res;
res.push_back(char(id >> 24));
res.push_back(char(id >> 16));
res.push_back(char(id >> 8));
res.push_back(char(id));... | true |
0bb1749df51fe2218f07697b23cb53d44e7d527e | C++ | hoangtrung1999/Data-Structures-and-Algorithms | /Codeforces/StringTask.cpp | UTF-8 | 542 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string S;
string S2;
cin>>S;
for (unsigned int i = 0 ; i < S.size() ; i++)
if ((int) S[i] > 64 && (int)S[i] < 91)
S[i] = char ((int)S[i] + 32);
for (unsigned int i = 0 ; i < S.size() ;)
if (S[i] == 'a' || S[i] == 'o' || S[i] == 'e' |... | true |
16e48d2ff73355a3df15d69b7f5c16c437c8550e | C++ | kwsephiroth/CPPCraftDemo | /UnitTests/unittests.cpp | UTF-8 | 3,952 | 2.6875 | 3 | [] | no_license | #include "stdafx.h"
#include "CppUnitTest.h"
#include <string>
#include <vector>
#include <algorithm>
#include <chrono>
#include <iostream>
#include <ratio>
#include "../CPPCraftDemo/QBRecordCollectionOperators.h"
#include "../CPPCraftDemo/QBRecordDatabase.h"
#include "../CPPCraftDemo/QBBaseImplementation.h"
using nam... | true |
91d6c348b086c59fad7685af07884eb35bbaed8b | C++ | songjunyu/LeetCode | /字符串转换整数 (atoi).cpp | UTF-8 | 1,531 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <utility>
#include <queue>
#include <stack>
using namespace std;
class Solution {
public:
int myAtoi(string str)
{
str.erase(0, str.find_first_not_of(" "));
int i = 0;
bool flag = true;
if (st... | true |
5dc0227ddeeaa22593c96a6b56cb3d97734d32e5 | C++ | seventeeen/algorithm | /baekjoon_online_judge/boj_03034_앵그리창영.cpp | UTF-8 | 395 | 2.75 | 3 | [] | no_license | /*
* About
*
* Author: seventeeen@GitHub <powdragon1@gmail.com>
* Date : 2017-02-21
* URL : https://www.acmicpc.net/problem/3034
*
*/
#include <iostream>
using namespace std;
int main(void){
int N, W, H, length, a;
cin >> N >> W >> H;
length = W*W + H*H;
for (int i = 0; i < N; i++) {
cin >> a;
if (... | true |
c1c861a49c38fb33ad05c67f48773fa79ffc2d66 | C++ | mgrang/caffeinic-codelets | /linkedlist/linkedlist.cpp | UTF-8 | 3,177 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include "linkedlist.h"
using namespace std;
void test(const vector<int> &nums) {
auto *L = new LinkedList(nums);
cout << "List: ";
L->print();
cout << "Reverse list: ";
L->reverse();
L->print();
cout << "Reverse first 1: ";
L->reverse(1);
L->print();
cout ... | true |
9ab45bdbad3c9b2fc8476c11e87fb0f2329de10d | C++ | zhengziqiang/learngit | /acm/acm/acm_pre/leecode/约瑟夫环.cpp | UTF-8 | 2,176 | 3.921875 | 4 | [] | no_license | /*==============================================================================
> File Name: 约瑟夫环.cpp
> Author: zzq
> Mail: zhengziqiang1@gmail.com
> Created Time: 2016年09月27日 星期二 21时11分33秒
==========================================================================*/
// 6.cpp -- using gcc compiler
#... | true |
f1695dbcb061909b441ebbfe00c2cb07c8e040eb | C++ | ingyeoking13/algorithm | /swex/programmingAdvanced/1251.cc | UTF-8 | 1,424 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
struct point
{
int x, y;
point() {};
};
struct Edge
{
long long len;
int u, v;
Edge() {};
Edge(int u, int v, long long len ) :u(u), v(v), len(len) {};
bool operator<(Edge b) { return len < b.len; }
};
int p[(int)1e3];
Edge edges[(int)1e6];
bo... | true |
71e93e63bbdfca34184e7f70f579fa4d7a29a8f6 | C++ | tinhphantrong0612/networkprogramming | /client/Client_UI/weapon.h | UTF-8 | 454 | 2.5625 | 3 | [] | no_license | #pragma once
#include "constant.h"
#define NO_WEAPON_NAME "Egg fights rock"
#define BALISTA_NAME "Balista Sword"
#define CATAPULT_NAME "Big Catapult"
#define CANNON_NAME "Super Dupper Gaint Cannon"
class Weapon {
public:
int type;
char name[NAME_LENGTH + 1];
int attack;
int wood;
int stone;
in... | true |
3ec0a37b067a5a6d69be1451370f30450cfb2f3c | C++ | imoren2x/biblab | /Cpp/Ejercicios/90_Ejercicios/fsm.hpp | UTF-8 | 1,230 | 3.328125 | 3 | [] | no_license | //FSM.h
#ifndef FSM_H
#define FSM_H
#include <iostream>
#include <string>
#include <vector>
#include <memory>
class FSM;
//An individual state (must belong to a FSM)
//This is an abstract class and must be sub-classed
class FSMState {
public:
FSMState(){};
FSMState(FSM *fsm){};
virtual... | true |
b6a528611cdfbbc7811772e5a45a7f40834a818c | C++ | AMPWorks/ArduinoLibs | /ShiftBar/ShiftBar.h | UTF-8 | 738 | 2.5625 | 3 | [] | no_license | /*
* Code to drive ShiftBar, ShiftBrite, etc
*/
#ifndef SHIFTBAR_H
#define SHIFTBAR_H
#include <Arduino.h>
/* SPI Pins */
#define SHIFTBAR_CLOCK_PIN 13 // CI
#define SHIFTBAR_ENABLE_PIN 10 // EI
#define SHIFTBAR_LATCH_PIN 9 // LI
#define SHIFTBAR_DATA_PIN 11 // DI
#define SHIFTBAR_MAX 1023
#define SHIFTBAR_... | true |
94a3c97f3ca4d03ee384451d48e52db975551c3e | C++ | ansich/C-C-Medio | /Actividad_7_1/main.cpp | ISO-8859-1 | 1,014 | 3.765625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <ctime>
#include <cstdlib>
using namespace std;
//1.Implementar una funcin genrica para contar el nmero de veces que un elemento aparece en un vector de elementos.
template <typename T>
int contar (T *Vector){
int max;
T elem;
int cont = 0;
cout << "intr... | true |
8fe6a8a2d37ee829e31deca8cf18fb241add197d | C++ | justincervantes/InfoSniffer | /Source Code/session.cpp | UTF-8 | 9,434 | 2.890625 | 3 | [] | no_license | /*------------------------------------------------------------------------------------------------------------------
-- SOURCE FILE: session.cpp - This file contains all the Winsock 2 API calls.
--
-- PROGRAM: InfoSniffer
--
-- FUNCTIONS:
-- QString hostNameToIP(QString input);
-- QString ipToHostName(QString input);
-... | true |
6d4eaa19840a08cc271853e1e1e2c2951597d0bb | C++ | beikehanbao23/dlgv32 | /dlgv32/gctpc/imolwinv.cxx | UTF-8 | 4,446 | 2.671875 | 3 | [] | no_license | /*******************************************************************************
NAME INTERRUPTED MOLLWEIDE
PURPOSE: Transforms input Easting and Northing to longitude and
latitude for the Interrupted Mollweide projection. The
Easting and Northing mus... | true |
6f1b0dd3bbf50f3e3ba50f58f718d24207a77b3e | C++ | avidLearnerInProgress/Cpp17-STL-Cookbook | /Chapter01/fold_expressions.cpp | UTF-8 | 2,836 | 3.5625 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string>
#include <vector>
#include <type_traits>
#include <algorithm>
#include <set>
#include <cassert>
// C++11 style recursive sum function
template <typename T>
auto sum_rec(T t)
{
return t;
}
template <typename T, typename ... Ts>
auto sum_rec(T t, Ts ... ts)
{
return t + sum_... | true |
e011b8e4cd01edba3cd4453f26e7e94b184a3841 | C++ | AnkangH/LeetCode | /BFS/269. 火星词典.cpp | UTF-8 | 2,994 | 3.6875 | 4 | [] | no_license | /*
现有一种使用字母的全新语言,这门语言的字母顺序与英语顺序不同。
假设,您并不知道其中字母之间的先后顺序。但是,会收到词典中获得一个 不为空的 单词列表。因为是从词典中获得的,
所以该单词列表内的单词已经 按这门新语言的字母顺序进行了排序。
您需要根据这个输入的列表,还原出此语言中已知的字母顺序。
示例 1:
输入:
[
"wrt",
"wrf",
"er",
"ett",
"rftt"
]
输出: "wertf"
示例 3:
输入:
[
"z",
"x",
"z"
]
输出: ""
解释: 此顺序是非法的,因此返回 ""。
注意:
你可以默认输入的全部都是小写字母
假如,a 的字母排列顺序优... | true |
0bb371d8f08fef728b95b5c91bd6d1d2e3822fc3 | C++ | Skuuully/UniGraphicsI | /Rasteriser/Camera.h | UTF-8 | 663 | 2.828125 | 3 | [] | no_license | #pragma once
#include"Vertex.h"
#include"Matrix.h"
#include <math.h>
class Camera
{
public:
Camera();
~Camera();
Camera(float xRotation, float yRotation, float zRotation, const Vertex &position);
//Accessors
float GetxRotation();
void SetxRotation(const float xRotation);
float GetyRotation();
... | true |
03bc32c5a9a6d5a593197e6ebacbc49e02536615 | C++ | juanfparra12/COP3530_Project2 | /Project2.cpp | UTF-8 | 6,292 | 3.96875 | 4 | [] | no_license | #include <vector>
#include <string>
#include <iostream>
using namespace std;
void calculatingLongestPrefixSuffix(string hint, int lengthOfHint, int *LPS);
//Uses KMP patterm searching algorithm
vector<int> KMP(string hint, string initial)
{
//Converts the length of the strings into int variables
int lengthOf... | true |
23e7103eec535174d55fbb61c095def7c61a3cb7 | C++ | Gauraviiitian/Codechef_Solutions_Codes | /LRQUER.cpp | UTF-8 | 1,074 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N = 1e5; // limit for array size
int n; // array size
ll t[2*N];
multiset<int> s[4*N];
void build() { // build the tree
for (int i=n-1; i>0; --i) t[i] = max(t[i<<1], t[i<<1|1]);
}... | true |
91a4ee1647690ef7654b841503244da04ff5cabe | C++ | seanzaretzky23/AdvancedProgServer | /server/OnGoingGamesStatsManager.h | UTF-8 | 3,757 | 3 | 3 | [] | no_license | /****************************************************************
* Student name: sean zaretzky(209164086), yaniv zimmer (318849908)
* Course Exercise Group: 03, 05
*****************************************************************/
#ifndef ADVANCEDPROGSERVER_ONGOINGGAMESSTATSMANAGER_H
#define ADVANCEDPROGSERVER_ONGOIN... | true |