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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a416d1826e58fa478a16ee24b9fcc41a99d9637e | C++ | lars-frogner/RayImpact | /RayImpact/include/SpecularBTDF.hpp | UTF-8 | 2,340 | 2.640625 | 3 | [] | no_license | #pragma once
#include "BSDF.hpp"
#include "FresnelReflector.hpp"
namespace Impact {
namespace RayImpact {
// SpecularBTDF declarations
class SpecularBTDF : public BXDF {
private:
const TransmissionSpectrum transmittance; // Fraction of incident light that is transmitted (disregarding Fresnel effects)
const... | true |
94f5bc9216672423281d457fc236e91a010ce901 | C++ | Navidulhaque/competitive-programming-solutions | /Codeforces/C++/1285/1285_B.cpp | UTF-8 | 1,850 | 2.671875 | 3 | [] | no_license | // https://codeforces.com/problemset/problem/1285/B
//Galatians 4:16
#include <bits/stdc++.h>
#define sonic ios_base::sync_with_stdio(false); cin.tie(NULL);
#define f(i,a,b) for(int i=a;i<b;i++)
#define vi vector<int>
#define newline cout<<endl;
#define pb push_back
#define all(a) a.begin(),a.end()
#define ff first
#... | true |
88d132eb44fd8d66d8fabc82e57bf0d46dc08e67 | C++ | ChenXinyu-CHD/Snake | /GameMap.cpp | UTF-8 | 1,578 | 3.078125 | 3 | [] | no_license | /**
* name : GameMap.cpp;
* date : 2018/5/28;
* g++ version : 8.1.0;
* g++ options : -O2;
* */
#include "GameMap.h"
#include <cstdlib>
#include <ctime>
GameMap::GameMap(Snake *snake_p):
snake(snake_p)
{
srand((unsigned)time(0));
for(int i = 0;i < MAX_HIGHT;++i)
for(int j = 0;j < MAX_LENGTH;++j)
if
(
... | true |
69c60acfdd067b29f128e35e6735a676c68ba507 | C++ | svelhinh/Projects | /Projects/piscine_cpp/j04/ex01/Enemy.cpp | UTF-8 | 1,438 | 2.71875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Enemy.cpp :+: :+: :+: ... | true |
cbe2f13af8fe3c3d7f3faf236078c36b4b68945b | C++ | marvins/Code_Sandbox | /opencv/cpp/stab-demo/cv/Fast_Marching.hpp | UTF-8 | 1,976 | 2.984375 | 3 | [] | no_license | #ifndef STAB_DEMO_CV_VIDEOSTAB_FAST_MARCHING_HPP
#define STAB_DEMO_CV_VIDEOSTAB_FAST_MARCHING_HPP
// C++ Libraries
#include <algorithm>
#include <cmath>
#include <queue>
// OpenCV Libraries
#include <opencv2/core.hpp>
class FastMarchingMethod
{
public:
FastMarchingMethod() : inf_(1e6f), size_(0)
... | true |
04194d0cb3c2330aa600dcf5b6a48c413027462b | C++ | waingt/pvz_wupaofuzhu | /src/utils.h | UTF-8 | 249 | 2.6875 | 3 | [] | no_license | #pragma once
#include <initializer_list>
#define inrange(x,low,high) ((x)<(low)?(low):((x)>(high)?(high):(x)))
template<typename T>
bool in(T t, std::initializer_list<T> list) {
for (auto& i : list)
{
if (t == i)return true;
}
return false;
} | true |
688189620791a98ed97cbf3c932f8bef3f1bf055 | C++ | yijunyu/demo | /datasets/github_cpp_10/7/71.cpp | UTF-8 | 1,941 | 2.78125 | 3 | [
"BSD-2-Clause"
] | permissive |
#include <thrust/iterator/iterator_traits.h>
#include <thrust/detail/backend/cpp/merge.h>
#include <thrust/detail/backend/cpp/detail/insertion_sort.h>
namespace thrust
{
namespace detail
{
namespace backend
{
namespace cpp
{
namespace detail
{
template <typename RandomAccessIterator,
typename Strict... | true |
b928909644372650da789060e17745a37047db8c | C++ | SebastianKunz/ChessEngine | /src/Figures/Pawn.cpp | UTF-8 | 1,629 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "Figures/Pawn.h"
#include "GameBoard.h"
Pawn::Pawn(const int y, const int x,
const char color, FigureLoader *loader)
: AFigure(y, x, color, Figure::PAWN, loader),
_isFirstMove(true)
{
}
bool Pawn::isLegalMove(const int y, const int x, AFigure ***board) const {
if (!GameBoard::isInBounds(y, x))
return... | true |
ce60550dced0a8fc7b5de45b139715679ef96a6f | C++ | YarikAlex/BlackJack-Game-for-Geekbrains | /Player.cpp | UTF-8 | 594 | 3.25 | 3 | [] | no_license | #include "Player.h"
Player::Player(const string& name = "") : GenericPlayer(name)
{
m_Name = name;
}
Player:: ~Player() { }
void Player::Win() const
{
cout << m_Name << ", you win!" << endl;
}
void Player::Lose() const
{
cout << m_Name << ", you lose!" << endl;
}
void Player::Push() const
{... | true |
116b3fa478e6c9b52f583c997aac195669b329e0 | C++ | PiotrJTomaszewski/SK2_Projekt | /CheckersClient/game_piece.cpp | UTF-8 | 1,514 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "game_piece.h"
GamePiece::GamePiece(const QString man_pixmap, const QString king_pixmap, const GLOBAL::COLOR piece_color, QGraphicsItem *parent) : QGraphicsPixmapItem(man_pixmap, parent) {
this->setZValue(10);
this->piece_type = GLOBAL::MAN;
this->piece_color = piece_color;
this->setVisible(fa... | true |
a6b870c61b9a1d5fdd359c40335fa8d83bb64917 | C++ | WhiZTiM/coliru | /Archive2/ec/42c461ba35b35b/main.cpp | UTF-8 | 307 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <exception>
struct MyException : std::exception {
const char *what() const noexcept override {
return "My awesome message";
}
};
int main() {
try {
throw MyException();
} catch (std::exception ex) {
std::cout << ex.what();
}
} | true |
7fd6ca62ea3ee6620be4f769ca207672706d934e | C++ | ike4892/CSCI20-Fall2016 | /assignment1/assignment1.cpp | UTF-8 | 761 | 3.3125 | 3 | [] | no_license | // Kasey Koch
// Assignment 1
// Date created - 9/12/2016
// Date last worked on - 9/12/2016
#include <iostream>
using namespace std;
int main()
{
int hours = 0;
float wage = 0;
string firstName = "";
string lastName = "";
float net = 0;
float gross = 0;
float tax = 0;
cout<<"W... | true |
1d52e6df61e6787cb5ca2250cdf68bfc1139540f | C++ | dnllowe/NRG_Engine | /Classes/nrgTimer.h | UTF-8 | 1,965 | 3.0625 | 3 | [] | no_license | #pragma once
#include "pch.h"
class nrgTimer
{
public:
nrgTimer();
void Start(); //Starts timer
void Stop(); //Stops timer
void Pause(bool unpauseOnResumeInput = false); //Pauses timer (same as stop, but can be unpaused)
bool IsUnpauseOnResume();
void Unpause(); //Resumes ticking, but only if previous paused
b... | true |
284484aa46a53f8b13eee5cd39d513204d537a39 | C++ | CGQZtoast/c_plus | /test/作业训练二/9字符串压缩.cpp | UTF-8 | 827 | 2.796875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n, a, b;
cin >> n >> a >> b;
string str;
cin >> str;
int ans = 0;
string temp1, temp2;
ans += a;
for (int i = 1; i < n; i++)
{
bool flag = false;
temp1 = str.substr(0, i);
for (int j ... | true |
c34416f08179bb529211744de45256257fd05b94 | C++ | luist18/feup-aeda-proj | /src/application/controller/offer/view_offers_page_controller.cpp | UTF-8 | 1,235 | 2.9375 | 3 | [
"MIT"
] | permissive | #include "view_offers_page_controller.h"
ViewOffersPageController::ViewOffersPageController(CurrentSession ¤t_session, AuthUserManager &auth_user_manager,
Company &company) : current_session(current_session),
... | true |
ef328e0eb0a9b1621e8610aa8d16ded5f3be1b52 | C++ | haoranchen1104/RMbot | /RMbot_bringup/src/com_controller.cpp | UTF-8 | 8,965 | 2.53125 | 3 | [] | no_license | #include "com_controller.h"
com_controller::com_controller(com_controller& other)
:nh_(other.nh_), dev_(other.dev_), baudrate_(other.baudrate_), time_out_(other.time_out_), hz_(other.hz_)
{}
com_controller::com_controller(ros::NodeHandle& nh, std::string dev="/dev/ttyUSB0", int baudrate=115200, int time_out = 100... | true |
4149d4ff8c288f9dcdff15a966abc8da94e59e53 | C++ | yavuzDemir21/CMPE322_Project1 | /EventSimulator.cpp | UTF-8 | 4,109 | 3.03125 | 3 | [] | no_license | //
// Created by Yavuz on 16/11/2018.
//
#include "EventSimulator.h"
#include <fstream>
#include <queue>
EventSimulator::EventSimulator() {
this->schedule;
this->outputFile = "";
}
EventSimulator::EventSimulator(vector<Process> _sched, string outputFile) {
this->schedule = _sched;
... | true |
9077d634aee3709273e6024565c12041a62c1457 | C++ | zhuli19901106/codeeval | /easy/self-describing-numbers(AC).cpp | UTF-8 | 453 | 2.59375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char s[1000];
int c[10];
int i;
int len;
while (scanf("%s", s) == 1) {
len = strlen(s);
if (len > 10) {
printf("0\n");
continue;
}
for (i = 0; i < 10; ++i) {
c[i] = 0;
}
for (i = 0; i < len; ++i) {
++c[s[i] - '0'];
... | true |
fabd86661efea2b789edd5979c67418ee008021f | C++ | nzuzow/335-project3 | /Negate.h | UTF-8 | 708 | 2.765625 | 3 | [] | no_license | #ifndef NEGATE_H
#define NEGATE_H
#include "ExprVisitor.h"
#include "Expr.h"
class Negate: public Expr{
private:
Expr* m_opPtr;
public:
Negate (Expr* opr):m_opPtr(opr){};
virtual ~Negate() {delete m_opPtr;}
Expr* getOperand() {return m_opPtr;}
/*Test to get type*/
std::string getType()... | true |
6c5edbb034cd956e922efc9a5e13a2757a9c3e5a | C++ | liaochiheng/CarND-PID-Control | /src/PID.cpp | UTF-8 | 4,058 | 2.984375 | 3 | [] | no_license | #include "PID.h"
#include <limits>
#include <iostream>
using namespace std;
/*
* TODO: Complete the PID class.
*/
PID::PID() {}
PID::~PID() {}
void PID::Init(double Kp, double Kd, double Ki) {
this->Kp = Kp;
this->Kd = Kd;
this->Ki = Ki;
p_error = std::numeric_limits<double>::max();
i_error = 0.0;
}
void PI... | true |
564d5012e510b5fcf584830c9ff178f7101f6e69 | C++ | autumn192837465/LeetCode | /1012. Complement of Base 10 Integer.cpp | UTF-8 | 1,139 | 3.734375 | 4 | [] | no_license | /*
Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on. Note that except for N = 0, there are no leading zeroes in any binary representation.
The complement of a binary representation is the number in binary you get when ... | true |
c20b40945248b9c379aad99342bd3bb425d06b9e | C++ | banetta/kpu_airport_control_system | /source/cpp/header/flightschedule.h | UHC | 600 | 2.765625 | 3 | [] | no_license | //by YHS
#ifndef _FLIGHTSCHEDULE_
#define _FLIGHTSCHEDULE_
#include "main_header.h"
// ¼ ִ.
class ControlTower;
class FlightSchedule { // Ŭ
private:
string airline;
string destination;
int seat[3];
int hour;
string shit;
int min;
public:
FlightSchedule() {}; // Ʈ
FlightSchedule(string fairli... | true |
1d2114982e80b1dd5da8296a46847d9afca3391a | C++ | gorkinovich/LP2 | /P01/A03/FDelincuentes.cpp | ISO-8859-1 | 13,407 | 2.71875 | 3 | [
"MIT"
] | permissive | //---------------------------------------------------------------------------
// Gorka Surez Garca - Ing. Tec. Inf. de Gestin 2 B.
// Prctica 01 - Apartado 03.
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
//-----------------------------------------------... | true |
b0e7f7a3aaa59302f08ef8c3cdd80445df6f4b02 | C++ | LArSoft/lardataobj | /lardataobj/RawData/RawDigit.h | UTF-8 | 7,355 | 2.828125 | 3 | [] | no_license | /** ****************************************************************************
* @file RawDigit.h
* @brief Definition of basic raw digits
* @author brebel@fnal.gov
* @see RawDigit.cxx raw.h
*
* Compression/uncompression utilities are declared in lardata/RawData/raw.h .
*
* Changes:
* 20141210 Gianluca Petri... | true |
c22d4ea6e40a6fbe5ee1bd2efb4a83fcc374fdd9 | C++ | UFC-MDCC-HPC/PobCPP | /pork/elsa/elkhound/examples/gcom4/parser.cc | UTF-8 | 1,393 | 2.734375 | 3 | [] | no_license | // parser.cc
// driver program for guarded command example
#include "lexer.h" // Lexer
#include "gcom.h" // GCom
#include "glr.h" // GLR
#include "ptreenode.h" // PTreeNode
#include "ptreeact.h" // ParseTreeLexer, ParseTreeActions
#include <cstring> // strcmp
int main(int argc, char *argv[])
{
... | true |
9c341ca8329f332244fa159e5266a9626c7ebc0d | C++ | csietingkai/leetcode | /(0084) largest rectangle in histogram.cpp | UTF-8 | 417 | 3.25 | 3 | [] | no_license | class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
int max = 0;
for (int i = 0; i < heights.size(); i++) {
int min_height = heights[i];
for (int j = i; j < heights.size(); j++) {
if (min_height > heights[j]) {
min_height = heights[j];
}
int rect_value = min_height * (j... | true |
9a47799343dd9171d888e898f2619ed1ff42eea7 | C++ | mutual-ai/jules | /include/jules/base/const_vector.hpp | UTF-8 | 5,796 | 3.453125 | 3 | [
"Zlib"
] | permissive | // Copyright (c) 2017 Filipe Verri <filipeverri@gmail.com>
// My soul melts away for sorrow;
// strengthen me according to your word!
// Psalm 119:28 (ESV)
#ifndef JULES_BASE_CONST_VECTOR_H
/// \exclude
#define JULES_BASE_CONST_VECTOR_H
#include <memory>
#include <type_traits>
#include <vector>
namespace jules
{
... | true |
fb81956984b548127fd98baf5c703af6a8bb03ca | C++ | gilbertoesp/EstructurasDeDatos | /EstructurasLineales/ListaOrdenadaRepBaja.h | UTF-8 | 2,227 | 3.140625 | 3 | [] | no_license | #ifndef LISTAORDENADAREPBAJA_H_INCLUDED
#define LISTAORDENADAREPBAJA_H_INCLUDED
#include "Caja.h"
#include "Enumeraciones.h"
/**
Estructura lineal que organiza los datos dados de menor a mayor
Esta Lista permite la repeticion de Datos, se recomineda que la repeticion de esta sea
pequena ya que genera una nue... | true |
2ac9fea95f1f3ba8a6319ffbd6363967b203080b | C++ | elingg/cognitive-dissonance | /project/code/KalmanFilter.cpp | UTF-8 | 3,168 | 2.5625 | 3 | [] | no_license | #include "KalmanFilter.h"
#include "cv.h"
#include "cxcore.h"
#include "cvaux.h"
#include "objects.h"
#include "highgui.h"
#include <iostream>
using namespace std;
/**
* Utility function to convert a CvBlob to a CObject
*/
CObject cvBlobToCObject(CvBlob* blob, string label) {
CObject obj;
obj.rect = cvRect(0, 0... | true |
ce1ce7466ae0e0d08c958516f184939975c62e5b | C++ | OPilgrim/circle-area | /Circle.cpp | GB18030 | 426 | 3.34375 | 3 | [] | no_license | #include"CIRCEL.H"
Circel::Circel()
{
this->r=0; //ʼrthis-> Ե
}
//һʼûиִֵʾ
Circel::circel(double R)
{
this->r=R; //ֵr=R
}
double Circel::Area()
{
return 3.14*r*r; //
}
//ȻֱR㣬privateûˡȻֻһСеϰҪе
| true |
43dd9b300c3527b10d079928158fe11fbb37ac68 | C++ | luigibrancati/snake_game | /food.hpp | UTF-8 | 406 | 3.296875 | 3 | [] | no_license | #ifndef _FOOD_H_
#define _FOOD_H_
#include <iostream>
class Food {
short pos_x;
short pos_y;
char symbol;
public:
Food(short x, short y, char s='x'):
pos_x(x),
pos_y(y),
symbol(s)
{}
short getX() const {return this->pos_x;}
short getY() const {return this->pos_y;}
char getS() const {return this->symbo... | true |
ae48e44dcd350369abc81fa9e821df21f6e4a57f | C++ | qianwenxu/compiler | /node.h | UTF-8 | 6,080 | 2.734375 | 3 | [] | no_license | #pragma once
#include "cn.h"
#include "entrytable.h"
#include "fourele.h"
#include<math.h>
#define MAXCHILDREN 10 //每一个树结点所拥有的孩子结点的最大个数
class treenode {
public:
treenode* children[MAXCHILDREN];
int value_type;//int 1 float 2 double 3 char 4 ID 5 STRING 6 类型7 修饰符8 其他9
int children_number;
float value_float;
int v... | true |
dceede3cbbcf48097f1287136bad70c970af27e4 | C++ | APU160139/LIGHT-OJ | /1354 - IP Checking.cpp | UTF-8 | 720 | 2.890625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int binary(int n);
int main()
{
int a,b,c,d,e,f,g,h,i,k,m,n,p,T;
scanf("%d",&T);
for(i=1;i<=T;i++)
{
scanf("%d.%d.%d.%d",&a,&b,&c,&d);
e = binary(a);
f = binary(b);
g = binary(c);
h = binary(d);
... | true |
b6916f7ee3b96cdda208b7116d79e4d3597f66e2 | C++ | Daiver/jff | /cpp/own_g/SpacePhysicalObjects/ship.h | UTF-8 | 381 | 2.609375 | 3 | [] | no_license | #ifndef SHIP_H
#define SHIP_H
#include "spacephysicalobject.h"
#include "destroyablespaceobject.h"
namespace SpacePhysicalObjects {
class Ship : public DestroyableSpaceObject
{
public:
Ship();
float speed() const { return m_speed; }
void setSpeed(const float speed)
{
this->m_speed = speed... | true |
3134e61069c9fe3a8731e94a3023e52052c299b8 | C++ | yumayo/treelike | /include/treelike/utility/file_system.h | UTF-8 | 549 | 2.53125 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include <algorithm>
#include <filesystem>
namespace treelike
{
namespace utility
{
class file_system
{
std::string _root_relative_path;
std::vector<std::string> _names;
public:
void search( std::string const& relative_path );
std::vector<s... | true |
8e0c5c5bde95908f3508cd43ec8351e3ff060a85 | C++ | R0B0T023/CPP | /insercion.cpp | UTF-8 | 583 | 3.3125 | 3 | [] | no_license | #include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
int numeros[]={3,5,4,2,1,6};
int i,pos,aux;
for(i=0;i<6;i++)
{
pos=i;
aux=numeros[i];
while((pos>0) && (numeros[pos-1] > aux))
{
numeros[pos]=numeros[pos-1];
pos--;
... | true |
e498d845cb52b8374797aab9051ea045e6db6d5e | C++ | right-x2/Algorithm_study | /2470.cpp | UTF-8 | 935 | 2.625 | 3 | [] | no_license | #include <vector>
#include <iostream>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
vector<int> v;
int a1,a2;
int cur;
int ans;
int main(int argc, char** argv)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int flag = 0;
int n;
int a;
int s,e... | true |
2a9090d6c22a023a6aee2ec2010b632f14d78fc0 | C++ | szyszprzemek/Cpp_training | /kurs_cplusplus/exercise_template.cpp | UTF-8 | 389 | 3.75 | 4 | [] | no_license | #include <iostream>
int const size_d = 3;
using namespace std;
template <class T>
T sum(T *input, int size_d, T sum=0){
for(int i=0; i<size_d; i++)
sum += input[i];
return sum;
}
int main(){
cout << " Template for sum() "<< endl;
int a[] = {1, 2, 3};
double b[] = {2.1, 2.2, 2.3};
cout... | true |
2d446efb4faf7d3b5548ed0b35ad06881642dee7 | C++ | roman-zm/nsh | /main.cpp | UTF-8 | 4,418 | 2.5625 | 3 | [] | no_license | #define STD_INPUT 0
#define STD_OUTPUT 1
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <unistd.h>
#include <fcntl.h>
#include <vector>
#include <sys/wait.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
void printPromt()
{
char* USER;
char* PWD;
USER=get... | true |
b498001145f21b948ac7a0804eb295e7a96846ff | C++ | atkinsja/Traveling_Salesman | /GeneticMath/tour_manager.cpp | UTF-8 | 283 | 2.921875 | 3 | [] | no_license | #include <vector>
#include "tour_manager.h"
void Tour_manager::add_city(City *city)
{
destination_cities->push_back(city);
}
City* Tour_manager::get_city(int index)
{
return destination_cities->at(index);
}
int Tour_manager::num_cities()
{
return destination_cities->size();
}
| true |
d906d2dd0216c039db09db800f5bf0f64695b671 | C++ | pharick/cpp | /1-year/31-pred-test/2.cpp | UTF-8 | 224 | 3.328125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int max(int x, int y) {
if (x > y) return x;
return y;
}
int main() {
int a, b;
cin >> a >> b;
int z = max(a, 2*b) * max(2*a - b, b);
cout << z << endl;
return 0;
}
| true |
1c9bf45e245d6e48d03b8b8513deddd6c85e9bc8 | C++ | walkccc/LeetCode | /solutions/0356. Line Reflection/0356.cpp | UTF-8 | 772 | 2.96875 | 3 | [
"MIT"
] | permissive | class Solution {
public:
bool isReflected(vector<vector<int>>& points) {
int minX = INT_MAX;
int maxX = INT_MIN;
unordered_set<pair<int, int>, pairHash> seen;
for (const vector<int>& p : points) {
const int x = p[0];
const int y = p[1];
minX = min(minX, x);
maxX = max(maxX, x... | true |
74a77ef240c8287a5297ad5afc5585f699274ee2 | C++ | MichalDolata/netquiz | /server/main.cpp | UTF-8 | 4,242 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <map>
#include <netinet/in.h>
#include <fcntl.h>
#include "message.pb.h"
#include "client.h"
#include "question.h"
using namespace std;
void se... | true |
68cc3927206ace09b8211bcc9f2af5d1d7d52087 | C++ | msklyarov/Cocos2dx-Tetris | /proj.win32/TetrisGlass.cpp | UTF-8 | 3,335 | 2.90625 | 3 | [] | no_license | #include "TetrisGlass.h"
#include "Settings.h"
#include "TetrisLayer.h"
#include "Log.h"
#include "cocos2d.h"
CTetrisGlass* CTetrisGlass::_pSingletonInstance = NULL;
CTetrisGlass::CTetrisGlass(void)
{
}
CTetrisGlass::~CTetrisGlass(void)
{
clearGlass();
/*vector<GlassRow*>::iterator it;
for (it = _glass.begin(); ... | true |
02e9ebdc3df4d402a4a9a68d9cac493574a54fb5 | C++ | nickclark2016/containers | /projects/containers/include/slot_map.hpp | UTF-8 | 28,240 | 3.109375 | 3 | [] | no_license | #ifndef slot_map_hpp__
#define slot_map_hpp__
/// \file slot_map.hpp
/// <summary>
/// File containing implementation of the slot map data structure and helper functionality.
///
/// \author Nicholaus Clark
/// \copyright Copyright 2021 Nicholaus Clark
/// Permission is hereby granted, free of charge, to any person ob... | true |
0a55a002ec2dde5bedf9b5421f8b27479e48d9f2 | C++ | blomios/Teeko | /src/Menus/MainMenu.h | UTF-8 | 1,094 | 2.859375 | 3 | [] | no_license | #ifndef TEEKO_MAINMENU_H
#define TEEKO_MAINMENU_H
#include "SpectatorMenu.h"
/**
* @brief Class for creating and rendering a main menu
*/
class MainMenu : public Menu {
private:
// The "Play (2 Players)" button of the main menu
sf::RectangleShape play_two_button_;
// The "Play against A.I." button
s... | true |
d6f6988be087cb6aeede73bc98d88f971cae529e | C++ | kk-katayama/compro | /library/Bellmanford/Bellmanford.cpp | UTF-8 | 1,137 | 3.234375 | 3 | [] | no_license | //最短経路問題。全ての辺についてのループを全ての頂点の数だけ回す(最悪のケース)。O(V*E)
//負のコストをもつ辺があっても適用可能。
struct edge{//辺の情報
int from,to,cost;
};
int V,E;//頂点の数、辺の数
edge e[1001];
int d[1001];//d[v]は始点から頂点vまでの最短距離
bool update;
void bellmanford(int s){//始点sからスタート
for(int i=0;i<V;i++) d[i]=INF;//初期化
d[s]=0;
for(int j=0;j<V;j++){
update=false;//... | true |
cf93f36d10aaf949909e723150e05009b901eb91 | C++ | pawelbeza/AlgoAnalysis | /Sort/bubble_sort.cpp | UTF-8 | 534 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
template <typename IteratorType>
void bubbleSort(IteratorType first, IteratorType last){
IteratorType pom1;
IteratorType pom2;
bool change = 1;
for(int i = 0; i < last-first && change; ++i){
change = 0;
pom1 = first;
... | true |
3ab36a335947f67c3b8bf50e95ee5a58239936c3 | C++ | lvzongsheng/PAT | /EN1067.cpp | UTF-8 | 1,535 | 3 | 3 | [] | no_license | //
// main.cpp
// PAT1067
// http://pat.zju.edu.cn/contests/pat-a-practise/1067
// Solutions:
// 此题的解题思路不是很难,就是每次交换都尽量实现一个数的正确排序,即0跟0所在的位置的数进行交换。比如说0在7的位置上,则0跟7交换,值得注意的是当0回到0的位置上而整个序列未排序的话,需要使0跟任何不是排序好的数交换,以此类推。
// 此题对时间要求较高,自己用了两个优化思路,1. 用空间换时间,记录每个数所在的位置 2. 在0到0位置时,进行判断记录起点游标,减少比较量。
// Created by 吕 宗胜 on 21/10... | true |
a5d9611322ec7684f82fd73d0d20de6dd8ea6c27 | C++ | Alaxe/noi2-ranking | /2017/solutions/B/LBS-Burgas/progres.cpp | UTF-8 | 711 | 2.546875 | 3 | [] | no_license | #include <cstdio>
#define MAXN 1000
int A[MAXN], N, D=1, n=0;
void red(int x)
{
for(int a=x+1; a<=N; a++)
{
if(A[a] - A[x] == D)
{
n++;
if(a!=N-1) {red(a);}
}
}
}
int main()
{
int maxA=0, minA=MAXN;
scanf("%d", &N);
for(int i=... | true |
0e9c7c17d8b11a587cda6ec50180724437807380 | C++ | jthemphill/love-letter | /choice.cc | UTF-8 | 1,878 | 3.171875 | 3 | [] | no_license | #include <cstdio>
#include "choice.h"
#include "const.h"
Choice::Choice(int turn, int player, Card holding, Card drawn)
: turn_(turn), player_(player), holding_(holding), drawn_(drawn),
action_(NULL) {}
Choice::Choice(int turn, int player, Card holding, Card drawn,
const Action* action)
... | true |
a6698a97bfa2247ff1c3960f5b5f415b1f912ba9 | C++ | williamchanrico/competitive-programming | /Toki Learning/Quadtree 1 Pengkodean.cpp | UTF-8 | 1,088 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int R, C, table[150][150], id[130];
void quadtree(int x, int y, int xx, int yy, string kode)
{
bool satu = false, nol = false;
for (int a = x; a < xx; a++)
for (int b = y; b < yy; b++)
if (table[a][b] == 0)
nol = true... | true |
81c2da29e3eeec59263d86c5e549a8499d5c0e93 | C++ | NWPlayer123/libmunna | /src/munna/filetypes/munna_yaz0.cpp | UTF-8 | 3,027 | 2.53125 | 3 | [] | no_license | #include "munna/filetypes/munna_yaz0.h"
namespace munna {
yaz0::yaz0(munna::file& input, munna::file& output) {
assert(input.read32() == 0x59617A30); //magic == "Yaz0"
uncompressed_size = input.read32(); //yaz0+4 = uncompressed size
input.seek(0x10);
//for (u32 i = 0; i < uncompressed_size; ) {
//for (int i... | true |
5154e9c7cecb45e2b4e60fb8189cc647147b52da | C++ | SeA-xiAoD/Learning_OpenCV3_Homework | /ch10/10_2/Ex_10_2.cpp | UTF-8 | 813 | 2.796875 | 3 | [] | no_license | #include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
int main( int argc, char** argv )
{
cv::Mat img = cv::Mat::zeros(100, 100, CV_8U);
img.at<uchar>(49, 49) = 255;
img.at<uchar>(49, 50) = 255;
img.at<uchar>(50, 49) = 255;
img.at<uchar>(50, 50) = 255;
cv::Mat smooth5, smooth... | true |
82ab8c94f66e2d4e524af3b691f6102a532463da | C++ | 3048205169/ECE551 | /miniproject/CalculCov.cpp | UTF-8 | 783 | 2.703125 | 3 | [] | no_license | #include <Eigen>
#include "calculate.h"
#include "read.h"
void printMatrix(const Eigen::MatrixXd & corr) {
for (int i = 0; i < corr.rows(); i++) {
for (int j = 0; j < corr.cols(); j++)
std::cout << corr(i, j) << "% ";
std::cout << std::endl;
}
}
void printAssets(Assets & assets) {
for (unsigned l... | true |
abf69c844fdaab40f3d24191c5d8791df689c5ab | C++ | y3046308/addNewLines | /addNewLines/Source.cpp | UTF-8 | 8,587 | 3.125 | 3 | [] | no_license | // reads text file (Korean & English), which doesn't have any line breaks and create new lines after every 4th periods.
// directory of the file is set to "D:\\bcs\\old\\";
// user can continuously work with another text file after one another.
// to finish, type "zz"
// update: added folder directory function so use... | true |
14a94fdd374c043e97e9111b840eaaac028a75c8 | C++ | abnayak/brainz | /InterviewBit/Array/plus1.cpp | UTF-8 | 608 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
vector<int> plusOne(vector<int> &A) {
int carry = 0;
for(int i = A.size()-1; i >= 0; i--) {
if( i == A.size()-1){
A[i] += 1;
}else {
A[i] += carry;
carry = 0;
}
if(A[i] > 9){
A[i] = 0;
carry = 1;
}
... | true |
065a926f2aa253211ebd30a17eaefc7db62e27ce | C++ | ScXin/StorageAndBufferManager | /Storage_and_Buffer_Manager_v2/Hash_P2F.cpp | UTF-8 | 1,936 | 3.265625 | 3 | [] | no_license | #include "Hash_P2F.h"
using namespace std;
Hash_P2F::Hash_P2F(){
init();
}
void Hash_P2F::init(){
for(int i = 0; i < BUFFERSIZE; i ++){
BCB * newHead = new BCB;
BCB * newTrail = new BCB;
newHead ->isHead = true;
newHead ->isTrail =false;
newHead ->previous = nullptr;
newHead ->next = newTrail;
newTr... | true |
bacf4633e6f0b40f3cf0cd8fef5ca2fd504ddb3f | C++ | RickyLiu0w0/HomeWorkCode | /Algorithms/Brute_Force/sequentialSearch2.cpp | UTF-8 | 415 | 3.53125 | 4 | [] | no_license | #include <vector>
int SequentialSearch2(std::vector<int> arr, int key)
{
//顺序查找的算法实现,它用例查找键作为限位器
//输入:一个n个元素的数组arr和一个查找键key
//输出:第一个值等于key的元素的位置,如果找不到这个元素,返回-1
arr.push_back(key);
int i = 0;
while (arr[i] != key)
i++;
if (i < arr.size() - 1)
return i;
else
return -1;
} | true |
a4dc1ef23da2a0088fcdff424e52e8478fc85cef | C++ | frittblas/fbl | /game_projects/Ca2/GameState/Race/Maze.cpp | UTF-8 | 20,690 | 2.5625 | 3 | [] | no_license | /*
*
* Charming Alarming 2: Reasonable Robots
*
* Maze.cpp
*
* Maze class implementation, takes care of the maze generation etc..
*
* Hans Strömquist 2022
*
*/
#include "../../../../src/fbl.hpp"
#include "../../Ecs/Ecs.hpp"
#include "../../Ecs/Components.hpp"
#include "../../Game.hpp"
#include "Maze.hpp"
Maze::aF... | true |
e0ee13ba9a548a46f41281f7a3c1771732467809 | C++ | rosero42/Basic-Client-Server | /Client.cpp | UTF-8 | 4,181 | 3 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h> // socket, bind
#include <sys/socket.h> // socket, bind, listen, inet_ntoa
#include <netinet/in.h> // htonl, htons, inet_ntoa
#include <arpa/inet.h> // inet_ntoa
#include <netdb.h> // gethostbyname
#include <unistd.h> ... | true |
4f989e03a4e62145edb3381d09526bc15533b27e | C++ | ja754969/Cplusplus-Programming | /上課檔案/課本範例檔/chapter 10_使用者自訂函式/範例10-11.cpp | BIG5 | 850 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
void totalmoney(int *,int,int,int); //ŧi禡
int main()
{
int money[2][3][2],i,j,k;
string interval[2]={"W","U"};
for (i=0;i<2;i++)
for (j=0;j<3;j++)
for (k=0;k<2;k++)
{
cout << "J" << i+1<<"aq"
<<... | true |
c88e1151a1da3f0f01337451ae84354afc7b5276 | C++ | juyingguo/android-knowledge-principle-interview | /18-c-and-cpp/cpp/C++程序设计题解与上机指导(第2版)-byeink/教材例题程序/c12/c12-3-2.cpp | UTF-8 | 340 | 2.984375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Point
{public:
Point(){}
virtual ~Point(){cout<<"executing Point destructor"<<endl;}
};
class Circle:public Point
{public:
Circle(){}
~Circle(){cout<<"executing Circle destructor"<<endl;}
private:
int radus;
};
void main()
{Point *p=new Circle... | true |
4a4b36e7874cc31e939e4e308082c9e1588d5097 | C++ | FranckRJ/HVlov-server | /hvlov-server/hvlov-entries/include/IHvlovEntrySerializer.hpp | UTF-8 | 931 | 3.09375 | 3 | [
"Zlib"
] | permissive | #pragma once
#include <string>
#include <vector>
#include "BaseInterface.hpp"
#include "HvlovEntry.hpp"
namespace hvlov
{
/*!
* Interface used to serialize HvlovEntries to diverse type of strings.
*/
class IHvlovEntrySerializer : public BaseInterface
{
public:
/*!
* Seriali... | true |
12a9dfb0b77c164318300a7c9d029cc594c3a77b | C++ | retrobrain/Employee | /Sources/employee.h | UTF-8 | 1,049 | 3.375 | 3 | [] | no_license | #ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include "globalappconsts.h"
namespace SALARY
{
const int HOURLY = 2233;
const int FIXED = 3344;
}
class Employee
{
public:
Employee();
Employee(int id, const std::string &name, float salary, int T);
// copy and assignment prohibited
Employee(const Employee&) =... | true |
6291d8e9ac38d075dda9c8f78f1adfd05b93b5c2 | C++ | Taekyukim02/usaco | /astar/plat/schlnet/schlnet.cpp | UTF-8 | 1,655 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#define MAX_N 100
using namespace std;
int N;
vector <int> graph[MAX_N+5];
// solve A methods
int order[MAX_N + 5];
int orderIdx = 0;
bool visited[MAX_N+5];
void topSort(int n) {
visited[n] = true;
for(int to : graph[n]) {
if(!visited[to])
topSort(t... | true |
a64457874d64c73392a2938f98118ee7f7623a23 | C++ | ckobylko/HIPAccBenchmark | /src/Benchmark/Benchmark.cpp | UTF-8 | 1,960 | 2.578125 | 3 | [] | no_license | // Benchmark.cpp : Defines the entry point for the console application.
//
#include "../../include/MemoryThroughput/MemoryThroughput.h"
#include "../../include/ImageAdd/ImageAdd.h"
#include "../../include/NormalizedGradient/NormalizedGradient.h"
#include "../../include/BubbleSortMedian/BubbleSortMedian.h"
#incl... | true |
c6d7e93f4d20c6820bbd8ee03a881392a2b74c0c | C++ | enihsyou/Data-structures-Exercises | /No3/BinaryTree.h | UTF-8 | 7,280 | 3.40625 | 3 | [] | no_license | #pragma once
#include <memory>
#include <ostream>
#include <functional>
struct TreeNode;
class BinaryTree;
typedef std::shared_ptr<TreeNode> TreeNodePtr;
namespace {
struct AsciiNode;
typedef std::shared_ptr<AsciiNode> AsciiNodePtr;
/**
* \brief 为了输出二叉树的帮助类,保存了节点的左右支,与父节点的边长、方向,节点深度,字符标签数据
*/
struct AsciiNode {
... | true |
07651e340a9706ebb44487f40e4fbd7ba16b081b | C++ | zv-proger/ol_programms | /acmp/0280.cpp | WINDOWS-1251 | 456 | 2.5625 | 3 | [] | no_license | /*
: (zv.proger@yandex.ru)
0280 acmp.ru
*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll x; cin >> x;
map<ll, int> divs;
for (int i = 2; i <= x; i++) {
if (x % i == 0) {
x /= i;
divs[i--]++;
}... | true |
b429acacd8d45ef0a25fef278ec9e6536ed1a7b5 | C++ | Twinparadox/AlgorithmProblem | /Baekjoon/11401.cpp | UTF-8 | 578 | 3.015625 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
const long long MOD = 1000000007;
long long power(long long x, long long n)
{
long long ans = 1;
while (n > 0)
{
if (n % 2 == 1)
ans = (ans * x) % MOD;
x = (x * x) % MOD;
n /= 2;
}
return ans;
}
long long fact(long long n)
{
long long ans = 1;
for (long long i = ... | true |
c8f2f9f9f9796f45cc1350c84ca2b5413d605ffd | C++ | ThreeInches/Total_review | /总复习/BinarySortTree/BinarySortTree/BinarySortTree.cpp | UTF-8 | 284 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include "BinarySortTree.h"
using namespace std;
int main()
{
gwp::BSTree<int> bst;
bst.Insert(5);
bst.Insert(3);
bst.Insert(8);
bst.Insert(6);
bst.Insert(4);
bst.Insert(7);
bst.Insert(1);
bst.Insert(2);
bst.Erase(2);
system("pause");
return 0;
}
| true |
fe11d0cbf42c3f547a3dd3013707ad3f2f039a21 | C++ | WookieHere/AI_Project_ECE57000 | /AI_Test_Project/AI_Test_Project/Output_Handler/Player_Training.cpp | UTF-8 | 7,507 | 2.6875 | 3 | [] | no_license | //
// Player_Training.cpp
// AI_Test_Project
//
// Created by Luke Nasby on 10/31/20.
// Copyright © 2020 Luke Nasby. All rights reserved.
//
#include "Player.hpp"
#include "Output_Handler.hpp"
#include "Random_Generator.hpp"
#include "Player_Training.hpp"
#define GENE_MAX_NEGATIVE -10000
#define GENE_MAX_POSITIV... | true |
e0fcae72bc755203fef2f886d186b99445b85c6a | C++ | charles-pku-2013/CodeRes_Cpp | /BazelProject/examples/gflags_demo.cc | UTF-8 | 3,326 | 2.578125 | 3 | [] | no_license | /*
* Tutorial: https://gflags.github.io/gflags/#validate
* gflags_demo.cpp
* /tmp/test -nobig_menu --languages=Chinese,English,Japanese
*/
/*
* Usage:
* 不可以出现未定义的选项参数
* app_containing_foo --nobig_menu -languages="chinese,japanese,korean" ...
* app_containing_foo --languages="chinese,japanese,korean"
* app_con... | true |
5bb7d7814543d1e9f065ce4f9fdaaddc0aba96a1 | C++ | dashagriiva/SPOJ-Submissions | /Classical/STPAR.cpp | UTF-8 | 902 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
using namespace std;
int main()
{
int n;
while(cin>>n && n)
{
vector<int> S(n);
for(int i = 0; i < n; i++)
cin>>S[i];
stack<int> Stack;
int curr = 1;
int index = 0;
bool res = true;
while(index < n && c... | true |
caaf2450cf8e641fc304e3f727781e97ce660b09 | C++ | rzel/SimpleDualTest | /native_app/src/Application.h | UTF-8 | 3,848 | 3.015625 | 3 | [] | no_license | /*
* Application.h
*
* Created on: Nov 6, 2012
* Author: dpajak
*/
#ifndef APPLICATION_H_
#define APPLICATION_H_
#include "ManagedPtr.h"
#include "System.h"
namespace System
{
class Application: public ManagedAbstractObject
{
public:
Application(void)
{
}
~Application(void)
{
}
... | true |
c783bdab38b76f167c22bc2c441277e75c547151 | C++ | 1564047446/byt | /test164.cpp | UTF-8 | 1,198 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
if (n < 10 || n > 30) {
printf("0\n");
return 0;
}
int temp[10000][10];
int ans = 0;
for (int a1 = 1; a1 <= 3; a1++) {
for (int a2 = 1; a2 <= 3; a2++) {
for (int a3 = 1; a3 <= 3; a3++) {
for (int a4 = 1; a4 <= 3; a4++) {
for (int a5 = 1; ... | true |
da91383bc82cd319b7c1c4fa30daf37d8ad02fad | C++ | leonoronhas/cs165 | /myCheck03a.cpp | UTF-8 | 1,819 | 3.5625 | 4 | [] | no_license | /***********************************************************************
* Program:
* CheckPoint 03a, Exceptions
* Brother Comeau, CS165
* Author:
* Leonardo Santos
* Summary:
* Enter a brief description of your program here! Please note that if
* you do not take the time to fill out this block, YOU ... | true |
001bbbafbbfac78c735abc64b145ec0a3348279f | C++ | cogu/qt-apx | /remotefile/inc/qrmf_filemap2.h | UTF-8 | 1,647 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
QT adaptation of RemoteFile Layer
*/
#ifndef QRMF_FILEMAP2_H
#define QRMF_FILEMAP2_H
#include <QString>
#include <QtGlobal>
#include <QList>
#include "qrmf_file.h"
namespace RemoteFile {
/**
* @brief Abstract base class for RemoteFile::FileMap2. Concrete classes needs to implement the assignFileAd... | true |
587fb80762b2d6f7a814ae481fbb5d89ef783962 | C++ | mdzobayer/Problem-Solving | /Uva/Uva - 10905 Children's Game.cpp | UTF-8 | 2,358 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
/// Read & Write to File Short-Cut
#define fRead(x) freopen(x, "r", stdin)
#define fWrite(x) freopen(x, "w", stdout)
/// Data type Short-Cut
#define LLI long long int
#define ULL unsigned long long int
#define ff first
#define ss second
#define mk make_pair
#define phb pus... | true |
8a7e361052e2fe36b65724fe06d04b9cf164b7a7 | C++ | umaidansari12/Assignments-H-JHU | /1_tree/sum_root_to_leaf_numbers.cpp | UTF-8 | 406 | 2.90625 | 3 | [] | no_license | class Solution {
public:
int solve(TreeNode* root, int s)
{
if (!root)
return 0;
if (!root->left and !root->right)
return s * 10 + root->val;
return solve(root->left, s * 10 + root->val) + solve(root->right, s * 10 + (root->val));
}
int sumNumber... | true |
db10caf76b1af6e40de49a1d819de2037f7e041b | C++ | Justinianus2001/ProjectEuler | /old_version/P082.cpp | UTF-8 | 1,207 | 2.9375 | 3 | [] | no_license | /*
* Copyright (c) Justinianus
* https://github.com/Justinianus2001/ProjectEuler
*/
#include "library.hpp"
int main(int argc, char** argv){
freopen("P082.txt", "r", stdin);
vector<long long> v[500];
long long cache[500][500], res = LLONG_MAX;
long long len = 0, width = 0;
string str;
while(cin >> str){
vect... | true |
7d2cfae8f5db87709bb089d45ca66904479d61d9 | C++ | svlpsu/crete-release | /lib/include/crete/elf_reader.h | UTF-8 | 2,090 | 2.8125 | 3 | [
"BSD-2-Clause-Views"
] | permissive | #ifndef ELF_READER_H
#define ELF_READER_H
#include <gelf.h>
#include <string>
#include <vector>
#include <stdint.h>
#include <boost/filesystem/path.hpp>
namespace crete
{
struct Entry
{
Entry() : addr(0), size(0) {}
Entry(uintptr_t address, uintptr_t e_size) : addr(address), size(e_size) {}
Entry(uintp... | true |
6c758b76363641d419b0baefb40d8782c64362f9 | C++ | ykclin/Projects | /C++/networkfunction/networkfunction/function/function.cpp | UTF-8 | 393 | 2.53125 | 3 | [] | no_license | #include "function.h"
void CFunction::testspecialcharacter()
{
string aa = "aca\1hwb";
int m = 92;
aa += m;
unsigned int ia = aa[3];
int bb3 = aa.find(m);
cout<<aa<<endl;
aa = aa.replace(aa.find(m),1,"v");
cout<<aa<<endl;
}
void CFunction::testMaxNum()
{
int iInt = 0x7fffffff;
unsigned int uInt = 0xffffffff... | true |
06b2ee16da38ada4aeb299e0edd7dc8f857c8d8e | C++ | vipin54/C-DSA | /circular_linklist.cpp | UTF-8 | 630 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <array>
using namespace std;
struct node
{
public:
int data;
node *next;
}*head=NULL;
void create(int A[],int n){
int i;
struct node *t,*last;
head=new node;
head->data=A[0];
head->next=head;
last=head;
for(i=1;i<n;i++){
... | true |
05570934924ff8edb460f663a8234982647d1d4a | C++ | isaiahIM/C_language_study | /graphic/square/main.cpp | UTF-8 | 1,697 | 3.03125 | 3 | [] | no_license | #include <stdio.h>
#include <iostream>
#include <graphics.h>
#include <math.h>
#define PI 3.14159
#define SQUARE_SIZE 150
typedef struct _POSITION
{
int x;
int y;
} Pos;
void SetPos(Pos *pos, int x, int y);
void Sqare(int square[], Pos StartPos, int r, float Degree);
float ToRadian(float Degree);
int main(... | true |
eebf8ce500a8ee85547d54d2e6f8cf9b43dd610c | C++ | yaominzh/CodeLrn2019 | /mooc43-bobo-algo/Play-with-Algorithms-master/09-Shortest-Path/Course Code (C++)/Chapter-09-Completed-Code/IndexMinHeap.h | UTF-8 | 4,182 | 3.734375 | 4 | [
"Apache-2.0"
] | permissive | //
// Created by liuyubobobo on 9/28/16.
//
#ifndef INC_03_IMPLEMENTATION_OF_DIJKSTRA_INDEXMINHEAP_H
#define INC_03_IMPLEMENTATION_OF_DIJKSTRA_INDEXMINHEAP_H
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
// 最小索引堆
template<typename Item>
class IndexMinHeap{
private:
Item *data... | true |
506d332d7e5ee549440f4b98651fedb85f8c591b | C++ | Kanchii/Online_Judge_Problems | /Uri/1038.cpp | UTF-8 | 509 | 2.890625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int cod, quant;
scanf("%d %d", &cod, &quant);
if(cod == 1){
printf("Total: R$ %.2f\n", quant*4.00);
} else if (cod == 2){
printf("Total: R$ %.2f\n", quant*4.50);
} else if (cod == 3){
printf("Total: R$ %.2f... | true |
ba8936c9bdac5f1e7e21b24893a1e5ef98031483 | C++ | edict-game-program/shooting_game_1 | /SystemForLearning0409/SystemForLearning/Game/Bullet.cpp | SHIFT_JIS | 4,815 | 2.875 | 3 | [] | no_license | #include "Bullet.h"
#include <cmath>
#include <Sprite.h>
#include <Collision.h>
#include "ShootingGame.h"
#if COLLISION_VISIBLE
#include <PrimitiveEdgeSprite.h>
#endif
using namespace core2d;
// -----------------------------------------------------------------------
// e\NX
// --------------------------------------... | true |
2dcd223b129b91b96df6baaa86d7e0a257196bda | C++ | Deepakgarg2309/hackoctoberfest2021 | /prims_algorithm.cpp | UTF-8 | 1,422 | 3.171875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define V 5
int minKey(int array[], bool mstVisited[]) {
int min = INT_MAX;
int min_index;
for (int i = 0; i < V; i++) {
if (mstVisited[i] == false && array[i] < min) {
min = array[i];
min_index = i;
}
}
return... | true |
36034fdb2c32c5ddd93c3ab746b6ffda3922a881 | C++ | lyapunov99/DataStructures | /solutions/lab-assoc/main.cpp | UTF-8 | 648 | 2.859375 | 3 | [] | no_license | //
// main.cpp
// lab10
//
// COMP 15: Data Structures
// Tufts University Department of Computer Science
//
#include <iostream>
#include "Assoc.h"
using namespace std;
int main (int argc, const char * argv[])
{
Assoc presidents;
presidents["Monaco"] = "Anthony";
presidents["Clinton"] = "Bill";
p... | true |
b3462b9c46828072e65f1b76586e08f5e0970be9 | C++ | rbary/isiviewer-1.3 | /objects/triMesh.cpp | UTF-8 | 6,525 | 2.78125 | 3 | [] | no_license | #include "triMesh.h"
TriMesh::TriMesh()
: Object3D()
{
_name="TriMesh";
std::cout<<"Meshing in progress..."<<endl;
}
void TriMesh::addVertex(Vertex v){
extendBoundingBox(v);
_vertices.push_back(v);
}
void TriMesh::addVertex(double x, double y, double z){
addVertex(Vertex(x,y,z));
}
void TriMe... | true |
95062bf0a71a8f8db635a05ae02580e510e84af5 | C++ | saralazic/Single-pass-assembly | /ls160054d/src/Convert.cpp | UTF-8 | 2,338 | 3.1875 | 3 | [] | no_license | #include "Convert.h"
#include <iostream>
using namespace std;
string Convert::BinToHex(string bin) {
string h_digit;
string ret="";
for (int i = 0, j = 4 * i; i < 2; i++) {
h_digit = bin.substr(j, 4);
if (h_digit == "0000") ret += "0";
else if (h_digit == "0001") ret += "1";
else if (h_digit ... | true |
011d1f5ab97fe56a23bd1f50474a5019495c4aeb | C++ | aleksay/quadr_ino_copter | /src/avrTimer1.cpp | UTF-8 | 4,604 | 2.8125 | 3 | [] | no_license | #include "avrTimer1.h"
// Variables
uint16_t timer1_prescaler;
uint16_t timer1_minHzPrescaler1;
uint16_t timer1_minHzPrescaler8;
uint16_t timer1_minHzPrescaler64;
uint16_t timer1_minHzPrescaler256;
// FUNCTIONS
int8_t timer1_init() {
// calculate max values per prescaler
timer1_getPrescalerMinHz();
// conf... | true |
68158e45e77ded284dc47a2f461632ed0b1718c2 | C++ | DoNotTouchMe/StudingCPlus | /stoke/main.cpp | UTF-8 | 862 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <String>
using namespace std;
class Stoke {
private:
string name;
int article;
int amt;
public:
Stoke () {
name = "Null";
article = 0;
amt = 0;
}
Stoke (string name) {
this->name = name;
this->article = 0;
this... | true |
263f6dfffb54f5d48db19256c87c44ac9a241101 | C++ | project-arcana/clean-ranges | /src/clean-ranges/algorithms/last.hh | UTF-8 | 877 | 2.859375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <clean-core/assert.hh>
#include <clean-core/functors.hh>
#include <clean-core/iterator.hh>
#include <clean-ranges/detail/call.hh>
namespace cr
{
/// returns the last element satisfying the predicate in the range
/// NOTE: requires at least one matching element
/// Complexity: O(n)
template <cla... | true |
e70557c9c40004786248d6da6700b640d158ffc7 | C++ | keeyank/PPP | /Ch18/cat.cpp | UTF-8 | 1,052 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int str_len(const char* s) {
if (s == nullptr) return 0;
int count = 0;
while (s[count]) ++count;
return count;
}
string cat(string s1, string s2, string delim = "") {
ostringstream c;
c << s1 << delim << s2;
return c.str();
}
char... | true |
b87d819d3c9b52c0f9f385940560d43e55a5313e | C++ | kenkov/nlp-tutorial | /unigram_worddivision.cpp | EUC-JP | 2,560 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <string>
#include <fstream>
#include <string>
#include <stack>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <boost/algorithm/string.hpp>
#include "util.h"
using namespace std;
vector<string> wordsplit(
vector<string> uniwords,... | true |
2638331f218afc9807c52dbd09fdc9c4224ad8e1 | C++ | lys861205/test | /test.cc | UTF-8 | 1,598 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <sstream>
#include <tuple>
#include <exception>
#include <string>
#include <vector>
using namespace std;
class Girl {
public:
string name;
int age;
Girl() {
cout << "Girl()" << endl;
}
~Girl() {
cout << "~Girl()" << endl;
}
Girl(string _name, i... | true |
21b890dcec4d7035b022af1f4af278c55815213c | C++ | harsh9500/LeetCode | /April Challenge 2021/April 29.cpp | UTF-8 | 828 | 2.84375 | 3 | [] | no_license | class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
int n=nums.size();
vector<int> answer{-1,-1};
if(n==0)
return answer;
int low=0,high=n-1,mid;
while(low<=high)
{
mid=low+(high-low)/2;
if(nums[mid]==t... | true |
fb8648806b6ab2ea9552ab7b04736ee4f5ba1e95 | C++ | Prince-1501/Hello_world-Competiitve-Programming | /Lecture - 26.cpp | UTF-8 | 881 | 2.9375 | 3 | [] | no_license | //
// main.cpp
// hsgts
//
// Created by Prince Kumar on 29/03/19.
// Copyright © 2019 Prince Kumar. All rights reserved.
// Chef and his daily routine Problem Code: CHEFROUT
#include <iostream>
using namespace std;
int main()
{
int T; cin>>T;
while(T--)
{
string s; cin>>s;
int coun... | true |