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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3ede34ce7621d800b1cb279b0f351990d53b99bd | C++ | ruchika-swain/Data-networking-basic-codes | /data_networking/single_parity_check.cpp | UTF-8 | 804 | 3.5 | 4 | [] | no_license | /* to check if the given message has error or not considering last bit as parity bit and for even parity */
#include<bits/stdc++.h>
using namespace std;
int convertBinaryToDecimal(int n)
{
int decimalNumber = 0, i = 0, remainder;
while (n!=0)
{
remainder = n%10;
n /= 10;
... | true |
6496c359cc82b20aec3abfad8bbe9755bcac1302 | C++ | VARIACION/Student-Management-System | /Courses.cpp | UTF-8 | 10,134 | 3.375 | 3 | [] | no_license | #include "Courses.h"
Time::Time() {
this->minute = this->hour = -1;
}
int Time::getHour() { return this->hour; }
int Time::getMinute() { return this->minute; }
bool Time::setHour(const int & hourInput) {
if (hourInput < 7 || hourInput > 17)
return false;
this->hour = hourInput;
return true;
}
... | true |
01e03e5c7deb696acfe0957d6e123819026fd9e9 | C++ | faterazer/LeetCode | /0592. Fraction Addition and Subtraction/Solution.cpp | UTF-8 | 1,600 | 3.359375 | 3 | [] | no_license | #include <numeric>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
string fractionAddition_MK1(string expression)
{
expression.push_back('+');
int numerator1 = 0, denominator1 = 1, sign = 1, numerator2 = 0, denominator2 = 0, num = 0;
... | true |
3e1c5ee80f3e0561c416cc3a609552de5e96b0b9 | C++ | brendankeesing/Collision-Detection | /CollisionDetection/CollisionFrustum.cpp | UTF-8 | 3,325 | 2.921875 | 3 | [
"Unlicense"
] | permissive | #include "CollisionFrustum.h"
static void trasformperspective(MthVector3& out, const MthVector3& point, const MthMatrix& mat)
{
MthVector4 temppoint(point.x, point.y, point.z, 1.0f);
MthVector4 tempout;
mat.Transform(tempout, temppoint);
out = (MthVector3&)tempout * (1.0f / tempout.w);
}
void CollisionFrustum::G... | true |
6c910b7e98b8d21fe30f2e2bdc70f4d3c4c38d86 | C++ | petru-d/leetcode-solutions-reboot | /problems/p845.h | UTF-8 | 1,845 | 3.25 | 3 | [] | no_license | #pragma once
#include <vector>
namespace p845
{
class Solution
{
public:
int longestMountain(std::vector<int>& A)
{
auto AA = A.size();
if (AA < 3)
return 0;
enum class State
{
Ascending,
Desc... | true |
a196dd49d2a580d90270d5c51e29cf65393236e3 | C++ | BUCTdarkness/JiyiShen-s-Coding | /LeetCode/Unique Binary Search Trees.cpp | UTF-8 | 560 | 2.828125 | 3 | [] | no_license | class Solution
{
public:
int f[1010][1010];
int getv(int begin,int end)
{
if(begin>end)
return 1;
return f[begin][end];
}
int numTrees(int n)
{
for(int i=0;i<n;i++)
{
f[i][i]=1;
}
for(int len=2;len<=n;len++)
{
for(int begin=0;begin<n;begin++)
{
int ... | true |
fef6be29cf57631fc69ce15c1e6516d04f897f6b | C++ | katasanirohith/HackerRankCodes | /Stick cutting.cpp | UTF-8 | 474 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout<<INT_MAX;
int n;
cin>>n;
int a[n];
int min=INT_MAX;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int index=n;
//cout<<n<<endl;
int count=0;
while(index>0)
{
cout<<index<<endl;
min=INT_MAX;
for(int i=0;i<n;i++)
{
if(min>a[i])
... | true |
6b0741322645d9d886bb354ff7490816d74cbb3d | C++ | newdeal123/BOJ | /Greedy Algorithm(그리디 알고리즘)/1080_행렬.cpp | UTF-8 | 791 | 2.53125 | 3 | [] | no_license | #include <iostream>
using namespace std;
const int MAX_N = 50 + 2;
#pragma warning(disable:4996)
int main()
{
int N, M, cnt = 0;
cin >> N >> M;
int board1[MAX_N][MAX_N], board2[MAX_N][MAX_N];
for (int i = 1; i <= N; i++)
for (int j = 1; j <= M; j++)
scanf("%1d", &board1[i][j]);
for (int i = 1; i <= N; i++)
... | true |
c2803ffb524719704084c6f672ce5a57af76958d | C++ | gfunk0704/FinancialEngineering | /FinancialEngineering/quote.h | UTF-8 | 390 | 2.625 | 3 | [] | no_license | #pragma once
#include <calendar.h>
#include <period.h>
#include <global_variable.h>
namespace FinancialEngineering
{
class Quote
{
public:
Quote(Date, Real, SharedPointer<Calendar>);
Quote(Real, SharedPointer<Calendar>);
Real value();
protected:
SharedPointer<Calendar> _calendar;
Date _value_date;
Re... | true |
678b0117de7b16431efc8e6c6d82abbe129a9c36 | C++ | rrkarim/neerc | /leet/sudoku_solver.cpp | UTF-8 | 1,794 | 3 | 3 | [] | no_license | /*
Sudoku Solver
*/
class Solution {
public:
unordered_map<int, int> mp_c, mp_r, mp_b;
int ind[10][10];
int box(int i, int j) {
int a = i / 3, b = j / 3;
return 3*a+b;
}
bool solve(vector <vector <char>>& board) {
int r = -1, c = -1, cx = 0;
for(int i = 0; i < board... | true |
357ec606e910322273d5f9def63a2576c2a16da7 | C++ | st076569/MatMex_MMM_Programming | /Semester_3/03.09.2020/Program_2/source/raidlib.cpp | UTF-8 | 8,319 | 2.703125 | 3 | [] | no_license | ////////// RAID 5 ////////////////////////////////////////////////////////////
// Автор : Баталов Семен //
// Дата : 10.09.2020 //
// Задача : Решить задачу с помощью STL. Эффективно смоделировать RAID 5, //
// ... | true |
9836c73ef84587028b61f290bcfc2ab86b22a786 | C++ | vital228/Algorithm | /Popovich/Popovich/List.h | WINDOWS-1251 | 5,242 | 3.46875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include "Node.h"
using namespace std;
template<class T>
class List
{
friend class Node<T>;
Node<T>* Head;
Node<T>* Tail;
int count;
public:
class Iterator
{
friend class List<T>;
Node<T>* it;
Iterator(Node<T>* ptr)
{
it = ptr;
}
public:
Iterator(... | true |
c31b152637646c296e9e2e404d5a11c0a58b55cc | C++ | suzyz/leetcode_practice | /p164/p164.cpp | UTF-8 | 1,424 | 3.3125 | 3 | [
"MIT"
] | permissive | // Part of bucket sort.
#include <iostream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;
class Solution {
public:
int maximumGap(vector<int>& nums) {
int n = nums.size();
if (n < 2)
return 0;
int minv = nums[0], maxv = nums[0];
for (int i = 1; i ... | true |
7a9ade574b592c76203eba0b4f6a465b755f7cd2 | C++ | asyan4ik/ws2812b_effects_loop | /police/police.ino | UTF-8 | 1,963 | 2.640625 | 3 | [] | no_license | #include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
const int buttonPin = 2;
int buttonState = 0; // статус кнопки - нажата или отпущена
// All of this stuff below is from the example
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are... | true |
aa3893d262c8298257333300662256191e1fb64d | C++ | jpc014/Phile_Scanner | /Phile_Scanner source code/Hydra.h | UTF-8 | 395 | 2.609375 | 3 | [] | no_license | #pragma once
#include "pathItem.h"
class Hydra {
public:
struct node_thing {
node_thing* next;
node_thing* previous;
pathItem content;
};
Hydra(int preffered_comb_size, const int num_drives);
pathItem remove_node();
int add_node(int drive, pathItem fileLoc);
bool is_empty();
int iterate();
private:
int c... | true |
0a0d19e5e94cb1985a9abe376fe6eb95ad863802 | C++ | baiyucraft/DS_study | /2.线性表/LinkList_17.cpp | GB18030 | 677 | 3.375 | 3 | [] | no_license | #include <stdio.h>
#include "DLinkList.h"
// бѭ˫ǷԳ
bool SymmertryCirDLinkList(DLinkList L) {
// ͷָp
DNode* p = L->next;
// βָq
DNode* q = L->prior;
// ʱp=qżʱq->next=p(p->next=qΪûбȽֱֹͣ)
while (p != q && q->next != p) {
if (p->data == q->data) {
p = p->next;
q = q->prior;
}
else
return false;
}
re... | true |
2d394fba871dc8acd63567f2e479e464b005fcb6 | C++ | Z-maple/CodeInterviewGuide | /CH9/9.19/main.cc | UTF-8 | 862 | 3.9375 | 4 | [] | no_license | ///在有序旋转数组中找到最小值
#include <iostream>
#include <vector>
using namespace std;
int getMin(vector<int> &input){
int left = 0, right = input.size() - 1;
while(left < right){
int middle = (right - left)/2 + left;
if(left == right - 1){
return min(input[left], input[right]);
}
... | true |
c09dfac82122adf3997cf845967ddd09e86b5900 | C++ | subatomicdev/binancebeast | /binancebeast/examples/rest.cpp | UTF-8 | 2,384 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | #include <binancebeast/BinanceBeast.h>
#include <mutex>
#include <functional>
#include <condition_variable>
using namespace bblib;
int main (int argc, char ** argv)
{
if (argc != 2 && argc != 3)
{
std::cout << "Usage, requires key file or keys:\n"
<< "For key file: " << argv[0] ... | true |
afdec30a6679c48499193d8b3063700302146da5 | C++ | JackMalone1/RPG | /TileMapLoader.h | UTF-8 | 995 | 2.859375 | 3 | [] | no_license | #pragma once
#include <SFML/System/Vector2.hpp>
#include <vector>
#include <sstream>
#include <fstream>
#include <iostream>
#include "yaml-cpp\yaml.h"
#include <SFML/Graphics.hpp>
#include <unordered_map>
enum class LayerType
{
Renderable = 0,
Collision,
Triggers
};
struct Tile
{
sf::Vector2f position;
sf::Sprit... | true |
d7017c77e9a7b2853f9b617a0acde6d5147e8a0b | C++ | harry1213812138/water-problem-code | /Cpp1 star.cpp | UTF-8 | 358 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int i,j;
for(i = 0;i < 4;i++)
{
for(j = 0;j <= 2-i;j++)
{
printf(" ");
}
for(j = 0;j <= i*2;j++)
{
printf("*");
}
printf("\n");
}
for(i = 3;i > 0;i--)
{
for(j = 0;j <= 3-i;j++)
{
printf(" ");
}
for(j = 0;j <= i*2-2;j++)
{
printf("*"... | true |
e0866295844adbdd6462882f3fd63217de64aa64 | C++ | Rice-Farmer/Cpts-122 | /Homework/Homework 1/Exersice 7/timeOutput.cpp | UTF-8 | 257 | 3.078125 | 3 | [] | no_license | #include <iostream>
void formatOutputTime(int hours, int minutes)
{
using namespace std;
if(minutes>=10)
cout << "Time: " << hours << ":" << minutes << endl;
else
cout << "Time: " << hours << ":0" << minutes << endl;
} | true |
d2fd3c0eb2dad4fbce0b2253e4894bb581fb3bd2 | C++ | chuanyedadiao/dataStructure | /第一周/1-2(2).cpp | GB18030 | 1,223 | 3.234375 | 3 | [] | no_license | #include<stdio.h>
#include<malloc.h>
#include<stdlib.h>
typedef struct list
{
int data;
struct list *next;
}LNode,*LinkList;
LinkList InitList()
{
LinkList L;
L=(LinkList)malloc(sizeof(LNode));
L->next=NULL;
return L;
}
void createList(LinkList list,int n)
{
LNode *p,*q;
p=list;
int i;
for(i=0;i<n;i++)
{
... | true |
a0edb6635e995c317c84c656edf80166900e2a81 | C++ | mrouillard/Arduino-PC-Gameport-HID | /Analog_Joystick/PC_Gameport_Analog_Joystick.ino | UTF-8 | 3,752 | 2.765625 | 3 | [] | no_license |
// Settings
#define ENABLE_DEBUG;
// Pins
const int button0 = 7;
const int button1 = 6;
const int button2 = 5;
const int button3 = 4;
const int axis0 = A0;
const int axis1 = A1;
const int axis2 = A2;
const int axis3 = A3;
// Analog to digital
const int AXIS_MIN = 550;
const int AXIS_MAX = 1023;
const int AXIS_NUL =... | true |
7bdf4529fad4c2ef7bec090e3b81267ae07294f5 | C++ | purpleKarrot/nccmake | /cmAlgorithms.h | UTF-8 | 1,028 | 2.8125 | 3 | [] | no_license | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmAlgorithms_h
#define cmAlgorithms_h
#include <algorithm>
#include <utility>
namespace ContainerAlgorithms {
template<typename T>
struct cmIsPair
{
enum
{
... | true |
b5ec06eb4a4af99316919a32396889a295447430 | C++ | Nocturne-hub/IG | /Src/Laser.cpp | UTF-8 | 1,916 | 2.640625 | 3 | [] | no_license | #include "Laser.h"
Laser::Laser() {
tailleX = 0.15f;
tailleY = 0.15f;
tailleZ = 1.0f;
}
Laser::Laser(Vaisseau v, int i) {
tailleX = 0.15f;
tailleY = 0.15f;
tailleZ = 1.0f;
posX = v.coordCanons[i][0];
posY = v.coordCanons[i][1];
if (i == 0) {
posZ = -0.5;
}
else {
... | true |
a832fe3b64b3927eac34cfe3c9d29e29803df003 | C++ | LawHsia1/CPU-Simulator | /Memory.h | UTF-8 | 827 | 2.640625 | 3 | [] | no_license | /*
* Memory.h
*
* Created on: Sep 26, 2014
* Author: rayhsia
*/
#ifndef MEMORY_H_
#define MEMORY_H_
#include <fstream>
#include <sstream>
#include <stdexcept>
#include "flags.h"
#include <stdlib.h>
#include <unistd.h>
class Memory
{
public:
enum ErrorNums
{
INVALID_ACCESS = 1,
BOUNDS_ERROR,
};
p... | true |
6238d679b38ec322729e08902b48f46d00d7aaad | C++ | czqmike/Leetcode | /iqiyi2021秋招提前批Java/split_str.cpp | UTF-8 | 814 | 3.046875 | 3 | [] | no_license | /***
* @Author: czqmike
* @Date: 2021-08-01 17:02:46
* @LastEditTime: 2021-08-02 19:11:30
* @LastEditors: czqmike
* @Description:
* @FilePath: \undefinedd:\git_repos\Leetcode\iqiyi2021秋招提前批Java\split_str.cpp
*/
#include <bits/stdc++.h>
using namespace std;
vector<string> split_str(const string& s... | true |
e55c73856a9af53c57350865a33b68717eba91f1 | C++ | bdumitriu/playground | /university-work/utcn/sisteme de operare/linux/so/include/driver/DirectoryListing.h | UTF-8 | 4,999 | 3.40625 | 3 | [] | no_license | /*
* Project: File System Simulator
* Author: Bogdan DUMITRIU
* E-mail: bdumitriu@bdumitriu.ro
* Date: Sun Oct 27 2002
* Description: This is the interface of the DirectoryListing class.
*/
/***************************************************************************
* ... | true |
726099b646ce17e5cd0388c2d1cca8e8c52e80b3 | C++ | Linueks/Fys4411-Variational-Monte-Carlo | /Hamiltonians/harmonicoscillator.h | UTF-8 | 537 | 2.75 | 3 | [] | no_license | #pragma once
#include "hamiltonian.h"
#include <vector>
class HarmonicOscillatorNum : public Hamiltonian{
public:
HarmonicOscillatorNum(System* system, double omega_ho, double omega_r);
double computePotentialEnergy(std::vector<Particle*> particles);
protected:
double m_omega_ho = 0;
double m_omega_r ... | true |
98ab4ec076e7c50f9dbb7bbc14cc99368fa9fda4 | C++ | jobgsk/CppGameEngine | /animation/AnimationFrame.h | UTF-8 | 2,471 | 2.78125 | 3 | [] | no_license | #ifndef ANIMATION_FRAME_H_
#define ANIMATION_FRAME_H_
#include <vector>
#include "AnimationBone.h"
#include "../GameObject.h"
class AnimationFrame
{
public:
std::vector<AnimationBone*> blist;
int current;
int m_id;
GameObject * m_owner;
AnimationFrame(int id, GameObject * owner):
m_id(id), m_... | true |
1eff0978a3e6229a2dcd6b1bbcac723596da12eb | C++ | 9643kavinder/Algorithms | /PATTERN_3.cpp | UTF-8 | 459 | 2.6875 | 3 | [] | no_license | /* PATTERN
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
*/
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"ENTER THE NUMBER";
cin>>n;
int val,j;
for(int i=0;i<=n;i++){
if(i%2==0){
val = 0;
for(j=1;j<=i;j++){
cout<<val<<" ";
if(val==0){
val = 1;
}
else{
val = 0;
}
}
}
else{
v... | true |
a315859a9ba700a108ad2f2bf7ae18fa8879d6c5 | C++ | anishsingh935/C- | /swap.cpp | UTF-8 | 962 | 3.78125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class aman;
class anish
{
private:
int val1;
friend void exchange(anish &, aman &);
public:
void set_data(int a)
{
val1 = a;
}
void display ()
{
cout<<"The value of class 1 :"<<val1<<endl;
}
};
class aman
{
... | true |
c4542a2967bcd625649511fdb692874678f72ea8 | C++ | jjzhang166/WinNT5_src_20201004 | /NT/inetsrv/iis/svcs/cmp/webdav/inc/ex/autoptr.h | UTF-8 | 9,612 | 2.796875 | 3 | [] | no_license | /*
* E X \ A U T O P T R . H
*
* Implementation of automatic-cleanup pointer template classes.
* This implementation is safe for use in NON-throwing environments
* (save for EXDAV & other store-loaded components).
*
* Copyright 1986-1998 Microsoft Corporation, All Rights Reserved.
*/
//--------------... | true |
da6546d900a7db6b9aeb93fb6300338537558941 | C++ | kushagraagrawal/codeforces-codechef | /Music/git_project2/codeforces/499B.cpp | UTF-8 | 337 | 2.859375 | 3 | [] | no_license | #include<map>
#include<cmath>
#include<iostream>
using namespace std;
map<string,string> dict;
int main()
{
int N,M,i;
string key,val;
cin>>N>>M;
while(M--)
{
cin>>key>>val;
dict[key] = val;
}
while(N--)
{
cin>>val;
if(dict[val].length() < val.length())
cout<<dict[val]<<" ";
else
cout<<val<<" ";... | true |
9e0ee1b40dc7892f251a8fa23cf9775156ca6c66 | C++ | yoqwerty/trial | /middleElemLL.cpp | UTF-8 | 586 | 3.21875 | 3 | [] | no_license | /*
Please note that it's Function problem i.e.
you need to write your solution in the form Function(s) only.
Driver Code to call/invoke your function would be added by GfG's Online Judge.*/
/* Link list Node
struct Node {
int data;
Node* next;
}; */
/* Should return data of middle node. If linked l... | true |
9d797a32f32c255bf49924a504df48c8e34c07dc | C++ | adityaXXX/Spoj | /ARMY.cpp | UTF-8 | 480 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
std::cin >> t;
while (t--) {
int n, m;
std::cin >> n >> m;
int N = INT_MIN, M = INT_MIN, temp;
for(int i = 0; i < n; i++){
std::cin >> temp;
if(temp > N)
N = temp;
}
for(int i = 0; i < m; i++){
std::... | true |
5bc6f619f270f6517f3d318d876ffd69f552697b | C++ | MarwenAouiti/competitiveProgrammingAlgorithms | /Backtracking.cpp | UTF-8 | 1,453 | 3.4375 | 3 | [] | no_license | #include <bits/stdc++.h>
/**
backtrakingAlgorithms(Permute a string)
Pseudocode :
fonction permute(s):
if s is an empty string :
nothing to do
else :
foreach character in s :
choose c to be first... | true |
35ce62b57a29d25481a5b19b22230b849a787463 | C++ | wangxx2026/universe | /ideas/procpp/mixin_handler/tests/map.cpp | UTF-8 | 786 | 2.640625 | 3 | [] | no_license | #include "ReactHandler.h"
#include <map>
#include <iostream>
using namespace std;
int main()
{
map<string, string> m;
L.debug_log("prepare map");
for (int i = 0; i < 10000000; i++) {
m[Utils::rand_string(50)] = Utils::rand_string(20);
}
L.debug_log("look up map");
auto start = Utils... | true |
124ba7e16ed69eb0c6f30407f39649e7950a7e19 | C++ | vladimir-123/Straustrup | /u3_task6.cpp | UTF-8 | 749 | 3.328125 | 3 | [] | no_license | #include <iostream>
// программа получает на вход 3 числа и выводит их в порядке убывания
int main(int argc, char const *argv[])
{
std::cout << "Enter three numbers:\n";
int a, b, c;
std::cin >> a >> b >> c;
if (a >= b && a >= c){
std::cout << a << ", ";
if (b >= c){
std::cout << b << ", " << c << ".\n";
}... | true |
a2fc7b232acbbb86d3dd7eb8e2f51d8d4f727397 | C++ | patriquus/PROGRAMOWANIE-TOTAL | /C++/for gwiazdki2.cpp | UTF-8 | 353 | 2.6875 | 3 | [] | no_license | #include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int x;
cin>>x;
for(int i=x; i>1; i--)
{
for(int j=1; j<=i; j++)
{
cout<<"* ";
}
cout<<endl;
}
for(int i=1; i<x+1; i++)
{
for(int j=1; j<=i; j++)
{
cout<<"* ";
}
cout<<endl;
}
... | true |
7ece717c4b628b575b1180d037499b87700e349b | C++ | N1MBER/AlgorithmAndDataStructure | /Second_Part/P3210_MKolesnikov_1322.cpp | UTF-8 | 904 | 2.859375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int first_char;
int m = 100000;
string str;
int *counts = new int[m];
int *analog;
int sum = 0;
char *result_word;
int main() {
cin >> first_char;
cin >> str;
analog = new int[m];
result_word = new char [str.length()];
for (int i = 0; i < m; i++) {
... | true |
69793edfdbb4095b9d15fbe7aac37311c13ce0a4 | C++ | Dongeun1206/SGA | /2017 1228 스택 큐 풀큐 원형 큐/ConsoleApplication1/cPoolingQueue.cpp | UHC | 1,138 | 3.109375 | 3 | [] | no_license | #include "stdafx.h"
#include "cPoolingQueue.h"
#include "cQueue.h"
#include "cNode.h"
cPoolingQueue::cPoolingQueue()
{
m_pQueue = new cQueue;
m_pMemoryPool = new cQueue;
}
cPoolingQueue::~cPoolingQueue()
{
delete m_pQueue;
m_pQueue = NULL;
delete m_pMemoryPool;
m_pMemoryPool = NULL;
}
void cPoolingQueue::Enqu... | true |
7d306d857e10c5bb7813ba38d6bd1fd8c25983b5 | C++ | A3mercury/Backus-Naur-Form | /Backus-Naur Form/Backus-Naur Form/Source.cpp | UTF-8 | 1,211 | 2.921875 | 3 | [] | no_license | // Backus-Naur Form
// Austin Andrews
// Visual Studio 2013
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
const string INPUT = "bnf.in";
const string OUTPUT = "bnf.out";
const string HALT = "HALT";
bool isXNumber(string X)
{
if (X == "0") return true;
else if (X == "1") return true;... | true |
bdc2f55a557ca74da76a1aee2168f1a331d6d8ae | C++ | egeigel/MPI_Scheduling | /Downloads/MPI/MPI/MPI/static_sched.cpp | UTF-8 | 2,440 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <cstdlib>
#include <chrono>
#include <mpi.h>
#ifdef __cplusplus
extern "C" {
#endif
float f1(float x, int intensity);
float f2(float x, int intensity);
float f3(float x, int intensity);
float f4(float x, int intensity);
#ifdef __cplusplus
}
#endif
float ... | true |
7e053d9d614665505bba9dba6266d3bc4a2e3d25 | C++ | yoogle96/algorithm | /BOJ/알고리즘 분류/다이나믹 프로그래밍/2133.cpp | UTF-8 | 281 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int DP[31];
int N;
int main() {
cin >> N;
DP[0] = 1;
DP[1] = 0;
DP[2] = 3;
for (int i = 4; i <= N; i+=2){
DP[i]=DP[i-2]*3;
for(int j=4;i-j>=0;j+=2)
DP[i]+=DP[i-j]*2;
}
cout << DP[N];
} | true |
a04cde97e0352b0d63014c4b44a23fb943974754 | C++ | Sieunguoimay/GameWandering_Dec2016_Win32_VS_Backup | /Dec2016GameProject/Button.cpp | UTF-8 | 2,597 | 3.125 | 3 | [] | no_license | #include "Button.h"
Button::Button(float x, float y, float w, float h, Texture*texture, Sound*sound, Sound*sound2)
:ButtonDefault(x,y,w,h,texture),sound(sound),sound2(sound2)
{
buttonState = 0;//0123
dead = false;
}
Button::~Button()
{
dead = false;
delete rectangle;
rectangle = NULL;
sound = NULL;
sound2 ... | true |
67892151a1cb69c880de1bb890cf24d62408221b | C++ | cuom1999/CP | /HashCode_2020/sortfirst.cpp | UTF-8 | 8,752 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
string subtasks[6] = {"a_example.txt", "b_read_on.txt",
"c_incunabula.txt", "d_tough_choices.txt",
"e_so_many_books.txt", "f_libraries_of_the_world.txt"};
string output(int index) {
char c = (char) (index + 'a');
string... | true |
a21e6973fffd2e9d193639bdd6daf2acedca92b5 | C++ | kartikdutt18/CPP-and-its-Algo-based-Problems | /To-Be-Restructured/Competitive/Count_Sub_Tree_With_Given_sum.cpp | UTF-8 | 1,081 | 3.78125 | 4 | [] | no_license | //https://practice.geeksforgeeks.org/problems/count-number-of-subtrees-having-given-sum/1
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x)
{
data = x;
left = right = NULL;
}
};
int ConvertT... | true |
1454cb3601674f4cab0ba27e3dc8efef79a39d09 | C++ | alexandraback/datacollection | /solutions_5765824346324992_0/C++/mkocian/b-barbers2.cpp | UTF-8 | 1,430 | 2.5625 | 3 | [] | no_license | #include<cstdio>
#include<vector>
#include<map>
#include<set>
#include<iostream>
#include<iomanip>
#include<time.h>
#include<sstream>
#include<fstream>
#include<string>
#include<string.h>
#include<algorithm>
#include<queue>
#define nl printf("\n")
using namespace std;
int gcd(int a, int b)
{
for (;;)
{
... | true |
a6f382e97669eb0bcccc347fb5fa1cb2911e9d1d | C++ | jbengtsson/jmbgsddb | /src/glps_ops.cpp | UTF-8 | 4,823 | 2.859375 | 3 | [] | no_license |
#include "math.h"
#include <sstream>
#include <limits>
#include <stdexcept>
#include "glps_parser.h"
namespace {
// Numeric operations
int unary_negate(parse_context* ctxt, expr_value_t *R, const expr_t * const *A)
{
*R = -boost::get<double>(A[0]->value);
return 0;
}
int unary_sin(parse_context* ctxt, exp... | true |
03c7036bbadb6541cf45c3c280c7681a3efad5dd | C++ | Personal-Learnings/CPP_Learning_CodeLite | /Workspace/References/main.cpp | UTF-8 | 894 | 3.734375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
void displayVector(const vector<string> input);
int main() {
vector<string> names {"Madan", "Jayashree", "Yashika"};
for(auto name : names)
name = "New Name";
cout << "Items in the Vector will not be ... | true |
8d16f3f983d843bf1579e5f9cc1e7c56c8674224 | C++ | liyuan989/blink | /src/blink/TcpClient.cpp | UTF-8 | 3,941 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | #include <blink/TcpClient.h>
#include <blink/SocketBase.h>
#include <blink/EventLoop.h>
#include <blink/Connector.h>
#include <blink/Log.h>
#include <boost/bind.hpp>
#include <assert.h>
#include <stdio.h>
namespace blink
{
namespace detail
{
void removeConnection(EventLoop* loop, const TcpConnectionPtr& connection... | true |
88c91458e70ff6a593a2f28e425ac669956d5115 | C++ | ZHANG-1921/JobySimlulator | /SimTimer.cpp | UTF-8 | 1,195 | 2.84375 | 3 | [] | no_license |
#include "SimTimer.hpp"
joby::SimTimer::SimTimer(double time_to_run_seconds,
double min_frame_time,
double max_frame_time)
{
mCurrentRunningTime = 0.0;
mLengthToRunSeconds = time_to_run_seconds;
mMinFrameLength = min_frame_time;
mMaxFrameLength = max_f... | true |
14ac675d4ed275b3fd5dc5d40126770ab87ccf0e | C++ | Miao4382/Starting-Out-with-Cplusplus | /Chapter 8/Program Example/1+.h | UTF-8 | 1,869 | 3.75 | 4 | [] | no_license | #include<iostream>
#include<vector>
#include<cstdlib>
#include<ctime>
//constant
const int N = 10000;
//function prototype
void initialize_num(int num[], int total);
void find_num(int num[], int array_size, std::vector<int> &position, int &total_match, int number);
int main()
{
int num[N];
int total_match;
int nu... | true |
9735da64da1a1edecfb778c8a253501421c18574 | C++ | samienne/reactive | /include/reactive/stream/sharedstream.h | UTF-8 | 2,169 | 2.78125 | 3 | [] | no_license | #pragma once
#include "stream.h"
#include "sharedcontrol.h"
namespace reactive
{
namespace stream
{
template <typename T>
class SharedStream
{
template <typename TFunc>
struct OnDelete
{
~OnDelete()
{
... | true |
cacaadaf2e9c5dd07f9ec110315d651e9976e04a | C++ | al-ry/ood-labs | /lab7-composite/Composite/CGroup.h | UTF-8 | 752 | 2.890625 | 3 | [] | no_license | #pragma once
#include "IGroup.h"
#include <vector>
class CGroup
: public IGroup
, public std::enable_shared_from_this<IGroup>
{
public:
CGroup();
RectD GetFrame() const override;
void SetFrame(const RectD& frame) override;
OutlineStylePtr GetLineStyle() const override;
StylePtr GetFillStyle() const override;
... | true |
3fbb0779f1149575e2bb738391c5a6b4d1c17e9a | C++ | Alex-Sindledecker/OpenGL3.3-Demo | /src/CameraFP.cpp | UTF-8 | 2,430 | 3 | 3 | [] | no_license | #include "CameraFP.h"
CameraFP::CameraFP(glm::vec3 pos, float walkSpeed)
{
this->pos = pos;
this->walkSpeed = walkSpeed;
attitude = glm::vec3(0);
front = glm::vec3(0);
sprintButton = sf::Keyboard::LShift;
sprintSpeed = 6;
up = glm::vec3(0, 1, 0);
view = glm::mat4(1.f);
xBounds = glm::vec2(0);
zB... | true |
a6e1f10ecaf31140a6b87b8fe5c592de23b9dec8 | C++ | tmforshaw/Operating-System | /src/Kernel_Files/InputOutput/Text/TextPrint.hpp | UTF-8 | 1,267 | 2.765625 | 3 | [] | no_license | #pragma once
#include "../../Types/String.hpp"
#include "../../Types/Types.hpp"
#include "./TextModeColourCodes.hpp"
uint_16 PositionFromCoords(uint_8 x, uint_8 y); // Turn an X and Y value into the index of the position on screen
void PrintString(const char* str, uint_8 colour = DEFAULT_COLOUR); // Used to print... | true |
8a82b1f79beb62919120aa3a4945112772aa1fa6 | C++ | cankoc95/BankManagement | /Account.cpp | UTF-8 | 1,104 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <cctype>
#include <iomanip>
#include "Account.h"
Account* Account::createAccount(std::string name, TYPE type, int amount){
Account *acct = new Account(name, type, amount);
return acct;
}
bool Account::doCheck(u_int32_t num, std::string name){
if (t... | true |
f31bdb704e3ef7aa64208c7d61c781a6574f9153 | C++ | melvinabraham/DSAlgoPrep | /validparanthesis.cpp | UTF-8 | 624 | 3.296875 | 3 | [] | no_license | class Solution {
public:
bool isValid(string s) {
if (s == "")
return true;
stack <char> k;
char c;
for(int i = 0; i < s.size(); ++i) {
if(s[i] == ')' || s[i] == '}' || s[i] == ']') {
if(k.empty()) {
return false;
}
if(s[i] == ')' ||) {
c = ... | true |
d93b961515397b13dbbfbfb2c958fa5b2aa7a133 | C++ | blackeywong/DataStructure | /DS7/tridiagonalAsIrregularArray.h | GB18030 | 5,691 | 3.28125 | 3 | [] | no_license | #pragma once
#ifndef _TIRDIAGONALASIRREGULARARRAY_H
#define _TIRDIAGONALASIRREGULARARRAY_H
#include <iostream>
#include "../DS5/exceptions.h"
#include "matrix.h"
using namespace std;
//ݽṹ㷨Ӧ-C++
//Exercise 25
template<class T>
class tridiagonalAsIrregularArray {
template<class T>
friend ostream& operator<<(ostream&, ... | true |
51146236f7b4d51efc12ac6a300038bccc62afd6 | C++ | brijrajk/DataStructuresCodeNCodeSeries | /NumberTheory/L19EulerTotientFuctionFast/EulerTotientFast.cpp | UTF-8 | 599 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int phi[1000001];
void initialize(int maxN) {
for(int i = 0; i <= maxN; ++i) {
phi[i] = i;
}
for(int i = 2; i <= maxN; ++i) {
if(phi[i] == i) { // this is a prime no.
for(int j = i; j <= maxN; j += ... | true |
fed798ac8d22052b1b6d49f514043bd22a3ea9bd | C++ | pranshu-09/Launchpad-Coding-Blocks | /Arrays/1-D Array/Array Rotation/7-maximum_rotated_sum.cpp | UTF-8 | 511 | 3.53125 | 4 | [] | no_license | #include<iostream>
using namespace std;
int maxmimum_rotated_sum(int arr[], int n)
{
int arr_sum = 0;
int curr_sum = 0;
for(int i=0;i<n;i++)
{
arr_sum += arr[i];
curr_sum += (i*arr[i]);
}
int max_sum = curr_sum;
for(int j=1;j<n;j++)
{
curr_sum = curr_sum + (arr_sum - n*(arr[n-j]));
if(curr_sum > m... | true |
80f8cdbca9fadb281cfe1cad7ffd65ac8290473f | C++ | AlexeyVKrasnoperov/MWPCReadout | /sensormap.cpp | UTF-8 | 2,554 | 2.515625 | 3 | [] | no_license | #include "sensormap.h"
SensorMap::SensorMap()
{
cnt = 0;
size_t nWires[10] = {192,192,192,192,640,448,576,320,640,320};
for( size_t w = 0 ; w < 17; w++)
for( int c = 0; c < 10; c++ )
ChamberProfiles[c][w].resize(nWires[c],0);
}
SensorMap::~SensorMap()
{
clear();
}
void SensorMap::... | true |
bdde3ffbc57ecdaca01ce073b934d31d3000ddc8 | C++ | mariokonrad/marnav | /include/marnav/seatalk/message_20.hpp | UTF-8 | 856 | 2.953125 | 3 | [
"BSD-3-Clause",
"BSD-4-Clause"
] | permissive | #ifndef MARNAV_SEATALK_MESSAGE_20_HPP
#define MARNAV_SEATALK_MESSAGE_20_HPP
#include <marnav/seatalk/message.hpp>
namespace marnav::seatalk
{
/// @brief Speed through water
///
/// @code
/// 20 01 XX XX
///
/// Speed through water: XXXX/10 Knots
/// @endcode
///
/// Corresponding NMEA sentence: VHW
///
class message... | true |
5f1b4e84fd25a57e6a7d8c741c9091f4a8734f76 | C++ | GeneLiuXe/PIKACHU-CODE | /ACM-Templates/01_数学/17_多项式卷积/00_FFT.cpp | UTF-8 | 1,623 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
struct FastFourierTransform {
typedef complex<double> cp;
typedef int R;
static const int MAXN = 1e5+5;
// a: a[0]*x^0+a[1]*x^1+...+a[n-1]*x^(n-1)
// b: b[0]*x^0+b[1]*x^1+...+b[m-1]*x^(m-1)
// c: c[0]*x^0+c[1]*x^1+...+c[n+m-2]*x^(n+m-2)
... | true |
1cdf74150ab3390ce9b366b9547a0fcd9af05214 | C++ | inc00ming/Playlist-Editor | /main_Node.cpp | UTF-8 | 407 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include "Node.hpp"
using namespace std;
int main(){
Node<int>* node5 = new Node<int>(5);
Node<int>* node4 = new Node<int>(4);
Node<int>* node3 = new Node<int>(3);
node5->setNext(node4);
node4->setNext(node3);
Node<int>* temp = node5;
while(temp){
cout << *temp << endl;
temp = temp->ge... | true |
9e5e4be6c64b643b308878a959544bf245a0ebf4 | C++ | FatemaFawzy/OpenGL-Puzzle-Game | /source/common/mesh/vertex-attributes.hpp | UTF-8 | 932 | 2.703125 | 3 | [
"MIT"
] | permissive | #ifndef OUR_VERTEX_ATTRIBUTES_H
#define OUR_VERTEX_ATTRIBUTES_H
#include <glad/gl.h>
namespace famm {
// Just as convenience, we write which location "we" use for each attribute in our shader.
// If you used different locations, modify these constants or just ignore (dont' use) them
namespace default_att... | true |
eb0c8824a113d24cdd5857a3fd400a27a3e5782a | C++ | gtz12345/gao_tianze | /第四章/account/main.cpp | UTF-8 | 872 | 3.1875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
float number;
float account;
float balance;
float charge;
float credits;
float limit;
float Newbalance;
while (number!=-1)
{
cout<<"Enter account number(or -1 to quit):";
cin >> number;
cout << "Enter beginning balance:";
cin >> ba... | true |
37bf22467afafc58de7de6cd23688fedbf68cb98 | C++ | BFH-E3d/AutoPosting | /AutoPosting-app/letter.h | UTF-8 | 739 | 2.78125 | 3 | [
"MIT"
] | permissive | #ifndef LETTER_H
#define LETTER_H
#include <QString>
class Letter
{
private:
QString title;
QString recipient;
QString address;
QString country;
QString content;
qint32 id;
public:
Letter();
Letter(QString title, QString recipient, QString streetNo, QString plzCity, QSt... | true |
d338af81fa80f26c79c91835f648d3a994848719 | C++ | yutaokamoto/Blog | /20210508/iterator.cpp | UTF-8 | 848 | 3.28125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
// 少しポインタの復習
int a = 0;
int* i_p = &a;
(*i_p)++;
cout << *i_p << endl;
// イテレータは、ポインタの一般形
//// コンテナの要素を指す
//// イテレータ自体を移動したり、指す要素の参照・変更が行える
vector<int> vec(3, 0);
//// for文の終了判定条件が「!=」であることに注意!
//// イテレータが指すコンテナの要素の中身を表示するときは、「*」をつける
for(auto i=vec... | true |
fabd110e3e481e1005ac8e8ce61d8cafdcf0899d | C++ | mtahernia/Non-Binary-GF-q-LDPC | /GFq.cpp | UTF-8 | 3,763 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* GFq.cpp
*
* Created on: 22 Dec, 2014
* Author: Mehrdad Tahernia
* User: mehrdad
*/
#include "Functions.h"
#include "GFq.h"
/************************************************************************
*
* GF(q)
*
************************************************************************/
// Static ... | true |
1707e03979519d1b1b941dd381bba1c9035452de | C++ | nieyu/learncpp_com | /07_Functions/07_04b_returning_value_by_value_reference_and_address/main.cpp | UTF-8 | 714 | 3.15625 | 3 | [] | no_license | //
// main.cpp
// 07_04b_returning_value_by_value_reference_and_address
//
// Created by txc-ios on 2020/9/29.
//
#include <iostream>
#include <tuple>
struct SS {
int m_x;
double m_y;
};
SS returnStruct() {
SS s;
s.m_x = 5;
s.m_y = 6.7;
return s;
};
std::tuple<int, double> returnTuple() {... | true |
711ebfa94316ffb8c5ba1185309560a557a0bd26 | C++ | shmulik-willinger/PID_controller | /src/PID.cpp | UTF-8 | 684 | 2.84375 | 3 | [] | no_license | #include "PID.h"
#include <iostream>
using namespace std;
PID::PID() {}
PID::~PID() {}
#define WINDOW_SIZE 20
void PID::Init(double Kp, double Ki, double Kd)
{
minError = std::numeric_limits<double>::max();
maxError = std::numeric_limits<double>::min();
PID::Kp = Kp;
PID::Ki = Ki;
PID::Kd = Kd;
p_error ... | true |
54956df85df71a5135dc314473311772c16b6291 | C++ | weiwu1248/Cargo-Plane-Simulation | /Cargo-Plane-Simulation/Project Source Code/Project/CargoPlane.cpp | UTF-8 | 12,190 | 3.390625 | 3 | [] | no_license | //This is CargoPlane.cpp
#include "CargoPlane.h"
#include "Cargo.h"
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
CargoPlane::CargoPlane()
{
//initializes the variables in the class.
maxWeight = 0;
maxVolume = 0;
fuelCapacity = 0;
fuelRate = 0;
currentCity = "";
milesFlown = 0;
... | true |
b6fc8a955b351b7b63db57c386cb74dc078c3f4a | C++ | montaser55/Cracking-The-Coding-Interview | /2.LinkedList/2.kthFromLast.cpp | UTF-8 | 1,556 | 3.6875 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int val;
Node *next;
};
void insert(Node *&head, int data)
{
Node *newNode = new Node;
newNode->val = data;
newNode->next = head;
head = newNode;
}
Node *kthfromLast(Node *head, int k)
{
if (head == NULL)
return NULL;
... | true |
3c0a24d5372c3191fe6e73f5f13abd82f62b8e83 | C++ | nidujay/openetk | /doc/examples/isr-service-example.cpp | UTF-8 | 1,734 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <isr/isr-service.h>
namespace djetk {
// Base class of some peripheral driver. It implements the interrupt
// handler code for that type of device.
// Each instance of this peripheral (e.g. UART1 and UART2) will derive
// from this.
class SomeDriverBase : private IIsrHandler
{
public:
... | true |
d9dafc9c38a1ab567cf62e46c160611f372d41ff | C++ | sessamekesh/Indigo-Sapphire | /include/view/cubemap.h | UTF-8 | 511 | 2.53125 | 3 | [] | no_license | #pragma once
#include <glad/glad.h>
#include <vector>
#include <model/imagedata.h>
namespace view
{
class Cubemap
{
public:
Cubemap();
~Cubemap();
Cubemap(const Cubemap&) = delete;
bool init(
const model::ImageData& left,
const model::ImageData& right,
const model::ImageData& top,
const model:... | true |
1a6aa2265752e068cbc6a1a107c331d68cd6dfd7 | C++ | Man0Sand/Matches-on-Bar-Table | /Matches on Bar Table/screen_buffer.cpp | UTF-8 | 3,777 | 3.03125 | 3 | [] | no_license | #include <Windows.h>
#include "screen_buffer.h"
namespace
{
class ScreenBuffer
{
public:
ScreenBuffer();
~ScreenBuffer();
void SetCursorPosition(COORD coordinates);
void ClearScreen();
COORD GetCursorPosition();
void ClearRow();
void I... | true |
93c07a9a9d8fa9d750e0026d2eb649bbb2fcceec | C++ | SimJung/Baekjoon_20190704 | /p9663.cpp | TIS-620 | 1,257 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <cstring>
#define pi pair<int, int>
using namespace std;
int n, ans;
stack<pi> s;
bool possible[15];
pi arr[15];
void print() {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
bool chk = false;
for (int k = 0; k < n; k++) {
if (arr[k].first == i &... | true |
003030a966e5f7f440de99b5d1c97d384c47eec8 | C++ | carlos-lopez-garces/ray | /vec3.h | UTF-8 | 3,208 | 3.234375 | 3 | [] | no_license | #ifndef VEC3_H
#define VEC3_H
#include "common.h"
#include <math.h>
#include <stdlib.h>
#include <iostream>
class vec3 {
public:
vec3() : e{0, 0, 0} {}
vec3(double e0, double e1, double e2) : e{e0, e1, e2} {}
inline static vec3 random() {
return vec3(random_double(), random_double(), random_double());
... | true |
c6c921ed04302580907de03669234d4fab10b16c | C++ | xiazeyu/OI_Resource | /Cpp_Programs/lougu/201808/origin/T39016.cpp | UTF-8 | 418 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #include <bits/stdc++.h>
using namespace std;
long n, m, seed;
int a[123456] = {0};
void generate_array(int a[], int n, int m, int seed) {
unsigned x = seed;
for (int i = 0; i < n; ++i) {
x ^= x << 13;
x ^= x >> 17;
x ^= x << 5;
a[i] = x % m + 1;
}
}
int main(){
scanf... | true |
e1bcfe07c9c644a6d61bd25881f08de2f4906d9c | C++ | Krpa/GappedSuffixArray | /src/ArraySuffixMapper.cpp | UTF-8 | 2,667 | 2.78125 | 3 | [] | no_license | //
// Created by luka on 11/15/15.
//
#include "ArraySuffixMapper.h"
std::set<int> ArraySuffixMapper::lookupMatches(char *seed, unsigned int len) {
std::set<int> result;
for(auto &i : lookupMismatch(seed)) {
result.insert(i);
}
for(auto &i : lookupDeletion(seed)) {
result.insert(i);
... | true |
11d78b5e692a0be07d1195def631576d64335dea | C++ | Karamu98/BatchCropper | /BatchCropper/src/Image.h | UTF-8 | 628 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <string>
class Image
{
public:
Image();
Image(const std::string& a_filePath);
~Image();
void Load(const std::string& a_imagePath);
bool Trim(unsigned int a_fromLeft, unsigned int a_fromRight, unsigned int a_fromTop, unsigned int a_fromBottom);
void Write(const std::string& a_fileDir);
vo... | true |
b4be06a1307e0d2e3a264369d94a4292d85d6a85 | C++ | aditi1403/C-tutorials | /array_challenge_kadane_algo.cpp | UTF-8 | 741 | 3.53125 | 4 | [] | no_license | //PROB_8-->KADANE'S ALGORITHM
#include<iostream>
#include<climits>
using namespace std;
int main(){
int n;
cout<<"Enter the value of n:"<<endl;
cin>>n;
int arr[n];
cout<<"Enter the elements of the array:"<<endl;
for (int i = 0; i < n; i++)
{
cin>>arr[i];
}
cout<<"Your array... | true |
dc898534c5112430abed84d6ace073b35449e029 | C++ | runwei/Coding_Problems | /shortestpalindrome.cpp | UTF-8 | 1,043 | 3.421875 | 3 | [] | no_license | /*
Given a string S, you are allowed to convert it to a palindrome by adding 0 or more characters in front of it.
Find the length of the shortest palindrome that you can create from S by applying the above transformation.
Examples:
cca -> 1
aba -> 0
acb -> 2
abcb -> 3
abb -> 2
abcdefg -> 6
*/
#include<vector>
#include... | true |
9584d4ff15d763941fc735770d62f19e99d333a6 | C++ | Kevin7-net/- | /校门外的树.cpp | GB18030 | 404 | 2.515625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int a[10001],s[101],e[101];
int main(){
int l,m;
int ans=0;
cin>>l>>m;
for(int i=0;i<m;i++){
cin>>s[i]>>e[i];
for(int j=s[i];j<=e[i];j++){
a[j]=1;//·ξλ1
}
}
for(int i=0;i<=l;i++){
if(a[i]==0)
ans++;//ûǹĵ˵û
}
cout<<ans;
return 0;
}
| true |
ed69f2ab2bdd1852fb36b5971388b639d662a132 | C++ | uxtuno/PetitEmu | /petitemu1_gui/myutil.cpp | UTF-8 | 231 | 2.796875 | 3 | [] | no_license | #include "myutil.h"
int inrange(int arg,int min,int max){
return (arg>=min)&&(arg<=max);
}
int isdigits(char* arg){
int i=0;
for(i=0;(i<256)&&(arg[i]!=0);i++){
if(!isdigit(arg[i]))return false;
}
return true;
} | true |
754e0381f9fec024ec3628e413e6d11098d7c220 | C++ | Nicksechko/mapreduce | /table_io.h | UTF-8 | 1,091 | 3.015625 | 3 | [] | no_license | #pragma once
#include <string>
#include <fstream>
#include <vector>
using TableItem = std::pair<std::string, std::string>;
class TableReader {
public:
explicit TableReader(const std::string& table_path);
bool Next();
bool HasNext();
bool Empty();
const std::string& GetKey() const;
const s... | true |
97359221931b2c4c77c83a18a97555875bd76581 | C++ | Jack-Tanner/SpaceWave | /SpaceWave/SpriteHandler.h | UTF-8 | 1,135 | 2.59375 | 3 | [] | no_license | #pragma once
#include "Sprite.h"
#include "Player.h"
#include "Vector2.h"
#include "Bullet.h"
#include "Enemy.h"
#include "Explosion.h"
#include "MapData.h"
#include <vector>
#include <string>
using namespace std;
using namespace Math;
namespace Game
{
class SpriteHandler
{
public:
SpriteHandler()
{
BulletID... | true |
cb9710202adbe1ea738cf3ddbf9f64bc29656f9c | C++ | dl57934/Algorithms | /2021-02-04/2611/2611.cpp | UTF-8 | 1,234 | 2.609375 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#define ll long long
#define element pair<ll, ll>
using namespace std;
vector<pair<int, int> > pathInfo[1002];
queue<int> qu;
int N, M;
ll vertex[1002];
vector<int> ingreed[1002];
void topologySort(){
queue <int> qu;
vector<int> history[100... | true |
c2b8a064fc15e51fe1b6f7449937f1be9f0a656e | C++ | gabigt99/IML | /IML/SRT_DST.cpp | UTF-8 | 504 | 2.984375 | 3 | [] | no_license | #include "pch.h"
#include "SRT_DST.h"
const int SRT_DST::getType()
{
return 10;
}
vector<double> SRT_DST::calculate(vector<double> values)
{
for (size_t i = 0; i < values.size(); i++)
{
removeDublicates(values[i], values, i);
}
return values;
}
void SRT_DST::removeDublicates(double number, vector<double> &val... | true |
097afa6e0bbb4467693d1565486c4a496b858f79 | C++ | nayuki/Nayuki-web-published-code | /zellers-congruence/zeller.cpp | UTF-8 | 5,786 | 3.703125 | 4 | [] | no_license | /*
* Zeller's congruence (C++)
* by Project Nayuki, 2023. Public domain.
* https://www.nayuki.io/page/zellers-congruence
*/
#include <array>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <random>
#include <vector>
/*---- Zeller's congruence function ----*/
/*
* Returns the day-of-week ... | true |
c7c58e3b0aa05afc8d938d4c1de2516f91d64833 | C++ | SergeyVN94/compiler | /lib.cpp | UTF-8 | 350 | 2.640625 | 3 | [] | no_license | #pragma once
#include <fstream>
using namespace std;
long long unsigned int getFileSize(ifstream *fileStream) {
long long unsigned int currentPosition = fileStream->tellg();
fileStream->seekg(0, ios_base::end);
long long unsigned int fileSize = fileStream->tellg();
fileStream->seekg(currentPosition, ios_base... | true |
461c47d106f045655e758fd61abf644c79985d51 | C++ | gartenriese2/VulkanWrapper | /extern/VulkanWrapper/include/vw/modelId.hpp | UTF-8 | 674 | 2.90625 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <functional>
namespace vw::scene
{
class ModelID
{
public:
ModelID()
{
static uint64_t s_nextID = 1;
m_id = s_nextID++;
if (s_nextID == 0)
{
throw std::runtime_error("Maximum number of ... | true |
d045112654ecb99ac5e100ffbf67a6f9ebf40db1 | C++ | yLim92/PIC10CProject | /status.h | UTF-8 | 6,027 | 2.515625 | 3 | [] | no_license | #ifndef STATUS_H
#define STATUS_H
#include "utility.h" //gc::StatusType, gc::TargetType
#include <map>
class GameUnit;
class Status;
class Ability;
struct LinkedStatus;
class BattleView;
struct AttributeList {
AttributeList() : is_stackable(true), effect_decay(0), effect_magnitude(0), duration(gc::PRACTICALLY_INFIN... | true |
936227e11c250b1c9d4b67a8d060e49a58cc0557 | C++ | andrejlevkovitch/KaliLaska | /src/graphics/ConstIterator.cpp | UTF-8 | 1,414 | 2.609375 | 3 | [] | no_license | // ConstIterator.cpp
#include "KaliLaska/GraphicsScene.hpp"
#include "imp/GraphicsSceneImp.hpp"
namespace KaliLaska {
GraphicsScene::ConstIterator::~ConstIterator() {
}
GraphicsScene::ConstIterator::ConstIterator(std::unique_ptr<SceneIterator> imp)
: imp_{std::move(imp)} {
}
GraphicsScene::ConstIterator::ConstI... | true |
190458a2e6e98d45b08af14814b9fabe7f82271a | C++ | Mehwa/Algorithm_Study | /SR_Study/SR_Study/BJ12100_2048.cpp | UHC | 2,848 | 2.96875 | 3 | [] | no_license | /*
2019.04.11
*/
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int N, result;
int map[20][20], tmap[20][20];
int m[5];
void input() {
result = 0;
cin >> N;
for (int r = 0; r < N; r++) {
for (int c = 0; c < N; c++) {
cin >> map[r][c];
}
}
}
void updateR(int r) { // ش
i... | true |
006b2cc8d8ab153c9a42f9956707a71e3ddc8059 | C++ | j10kay/Computer-Science-1-Coursework | /Lab16.cpp | UTF-8 | 1,296 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
using namespace std;
void get_data(int&, int&); //Function Prototypes
void print_data(int, int);
void heading();
int main()
{
int user_miles;
int user_hours;
heading();
get_data(user_miles, user_hours);
print_data(user_miles, user_hou... | true |
cdd03a810bf10c0dcc3c5308ecd814d8ed5b500f | C++ | ptryfon/loxim-stats | /src/SystemStats/StoreStats.h | UTF-8 | 2,435 | 2.78125 | 3 | [] | no_license | /*
* StoreStats.h
*
* Created on: 12-nov-2009
* Author: paweltryfon
*/
#ifndef STORESTATS_H_
#define STORESTATS_H_
#include <SystemStats/AbstractStats.h>
#include <SystemStats/DiskUsageStats.h>
namespace SystemStatsLib{
/*
* Store stats collect stats related with store module:
* - amount of readed pages... | true |