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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8d2f6eab94d648a132218154e073744be1a04868 | C++ | JoaoDanielRufino/Online-Judges | /Uri-Online-Judge/Cpp/2484.cpp | UTF-8 | 578 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false); cin.tie(0);
int space,count;
string str;
while(cin >> str){
count = 0;
space = 1;
for(int i = 0; i < str.size(); i++){
for(int j = 0; j < str.size()-count; j++){
... | true |
718ddb3693dd1870c57414bb13123f26450cd368 | C++ | qvajda/TAP-Sim | /Sim/Learner/SimplifiedLearner.cpp | UTF-8 | 1,080 | 2.75 | 3 | [] | no_license | /*
* SimplifiedLearner.cpp
*
* Created on: Sep 25, 2014
*/
#include "SimplifiedLearner.h"
SimplifiedLearner::SimplifiedLearner(const long n): NetworkLearner(n) {
infos = SimpleRoadInfos(nbRoads);
}
void SimplifiedLearner::exitedRoad(Road* r, const double time, const double length){
infos[r->getId()].addInfo(l... | true |
f0e7672de54810f22251e9d3aa65b608ba0428fc | C++ | pixelite1201/TraceMove | /src/GUI/ImageVotes.h | UTF-8 | 1,559 | 3.1875 | 3 | [] | no_license | /*!
\file ImageVotes.h
\brief This file find the maximum votes per image
*/
#include "Grid.h"
#include<vector>
class ImageVotes{
public:
//! Max location offset difference allowed between drawn patch and database patch
int offsetSize;
//! imgId for which votes are stored
int imgId;
//! Store the patch lo... | true |
aab101a9c986cd471c43d922679d6826d9010725 | C++ | MOYUtianming/simple-motion-counter | /1.camera & divide/PHOTOTOOLS/spare/mainc.cpp | UTF-8 | 4,353 | 3.015625 | 3 | [] | no_license | #include "Windows.h"
#include "stdio.h"
#include "string.h"
#include "malloc.h"
unsigned char *pBmpBuf;//读入图像数据的指针
int bmpWidth;//图像的宽
int bmpHeight;//图像的高
RGBQUAD *pColorTable;//颜色表指针
int biBitCount;//图像类型,每像素位数
bool readBmp(char *bmpName)
{
//二进制读方式打开指定的图像文件
FILE *fp=fopen(bmpName,"r... | true |
9a5fe72c5709fa5735d65aca81e1e163fff482a5 | C++ | Avantika2799/30DayAprilLeetCodeChallenge | /Week of April 22-28/LRUCache.cpp | UTF-8 | 1,295 | 3 | 3 | [] | no_license | /*
https://leetcode.com/explore/featured/card/30-day-leetcoding-challenge/531/week-4/3309/
*/
class LRUCache {
int _capacity;
list<int>Keys;
unordered_map<int,pair<int,list<int>::iterator>>m;
public:
LRUCache(int capacity): _capacity(capacity) {
}
int get(int key) {
if(m.f... | true |
b15e15d7bc547b2d5d48335d254566021cd34f73 | C++ | Mrpye/boatbot | /boatbot.ino | UTF-8 | 2,610 | 3.109375 | 3 | [] | no_license | /*
* Ultrasonic Sensor HC-SR04 and Arduino Tutorial
*
* Crated by Dejan Nedelkovski,
* www.HowToMechatronics.com
*
*/
#include <Servo.h>
// defines pins numbers
const int right_trigPin = 2;
const int right_echoPin = 3;
const int left_trigPin = 4;
const int left_echoPin = 5;
// defines variables
int left_distance[3];... | true |
922bd9b2841522bbbbbdd51b9d4f63efe711eddc | C++ | wolf2lyon/Clases_progra2_2021 | /Semana 6 II/Controladora.cpp | UTF-8 | 2,915 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include "Controladora.h"
using namespace System;
using namespace System::Drawing;
using namespace std;
Controladora::Controladora() {}
Controladora::~Controladora()
{
delete obj_monigote;
delete obj_vehiculos;
}
void Controladora::Iniciar(int MAXW, int MAXH)
{
obj_monigote = n... | true |
fcc97d9e5b0348a137fdfde01f51217443cbe4c1 | C++ | Huijuan2015/MyLeetcodeSolutions | /cpp/370. Range Addition.cpp | UTF-8 | 576 | 2.796875 | 3 | [] | no_license | class Solution {
public:
vector<int> getModifiedArray(int length, vector<vector<int>>& updates) {
//只更新start end+1 index
vector<int> calculateHelper(length, 0);
vector<int> res(length, 0);
for(auto update : updates){
calculateHelper[update[0]] += update[2];
if... | true |
f1351020954f02ec1b63f21378e6ab9e1fc87dd8 | C++ | HealthVivo/mumdex | /unstable/gene_info.cpp | UTF-8 | 2,778 | 2.65625 | 3 | [] | no_license | //
// gene_info.cpp
//
// Output gene information
//
// Copyright 2020 Peter Andrews @ CSHL
//
#include <algorithm>
#include <exception>
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include "error.h"
#include "genes.h"
#include "mumdex.h"
using std::cout;
using std::... | true |
25de161276663ea06d11712d222a4c8f43fa201e | C++ | ericng349/Database-Project | /DataBase/main.cpp | UTF-8 | 420 | 2.59375 | 3 | [] | no_license | /*
* Author: Eric Ng
* Project: Final Project - Database
* Purpose: Creates a SQL database that allows users to input records, find
* records, and make tables
* Notes:
*
* //NOTE:
*/
#include "sql.h"
#include <iostream>
using namespace std;
//Make it check for fields
int main(int argc, char *argv[]... | true |
1dd434439b5e5c18de564433b47e630dcfe68b1c | C++ | rc1/WhereDidTheSelfiesTakeUs | /SelfiesOSX/src/OnionSkinRingBuffer.cpp | UTF-8 | 2,113 | 2.671875 | 3 | [] | no_license | #include "OnionSkinRingBuffer.h"
#pragma mark - Settings
OnionSkinRingBufferSettings::OnionSkinRingBufferSettings () {
numberFrames = 1;
width = 800;
height = 480;
blendMode = OF_BLENDMODE_ALPHA;
show = 4;
}
#pragma mark - Lifecycle
OnionSkinRingBuffer::OnionSkinRingBuffer () {
}
OnionSkinRing... | true |
cb38475aee5c7ccb0280a1030d83bca0b26e36c9 | C++ | emfkdlqjspdla/SGA47 | /TimeAttack/20140514/Utility.hpp | UTF-8 | 447 | 2.921875 | 3 | [] | no_license | #pragma once
#define _USE_MATH_DEFINES
#include <math.h>
template<typename T>
class singleton
{
protected :
singleton(){}
virtual ~singleton(){}
public :
static T& getReference()
{
static T inst;
return inst;
}
};
template<typename T>
void SafeDelete(T& pointer)
{
if (pointer)
{
delete pointer;
poin... | true |
aa3feb42f0b862fa00ce34118cd93822e4d5091b | C++ | pedro-maschio/AlgorithmseDS | /Sorting/mergewithqueue.cpp | UTF-8 | 1,201 | 2.875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define ll long long
#define N (ll)(2*1e5)
#define EPS (double)(1e-12)
#define M (ll)(1e9+7)
using namespace std;
void merge(vector<int>& arr, int l, int middle, int r) {
queue<int> L, R;
for(int i = l; i <= middle; i++)
L.push(arr[i]);
for(int i = middle+1; i <= r; i++)... | true |
d4937d6c6146e88e13d2fbfe9f7cfdffe5b58438 | C++ | danielteel/gpdslCPP | /helpers.cpp | UTF-8 | 3,788 | 3.25 | 3 | [] | no_license | #include "helpers.h"
#include <string>
#include <cmath>
bool isSpace(int chr) {
if (chr <= 32) {
return true;
}
return false;
/*switch (chr) {
case ' ':
case '\t':
case '\n':
case '\v':
case '\f':
case '\r':
return true;
}
return false;*/
}
bool isDigit(int chr) {
switch (chr) {
case '0':
case '1':... | true |
838e959ec2600559e2d7f29c2420cb11fb59ebbe | C++ | mirabellej/WhenThingsSpeak | /1_PlayNote.ino | UTF-8 | 769 | 3.03125 | 3 | [] | no_license | #include <Adafruit_CircuitPlayground.h> // Include the library for the Circuit Playrgound.
void setup() {
CircuitPlayground.begin(); // This initializes the Circuit Playground.
delay(1000); // Warm up delay. Pause for 1 second.
CircuitPlayground.playTone(500, 100); // This plays tone 500 for 100 millis... | true |
c469de2e855bf588750b3d96a84ed5ff30e79936 | C++ | kscharlund/kattis | /allpairspath/allpairspath.cpp | UTF-8 | 1,869 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
static const int INF = 10000000;
int main()
{
cin.sync_with_stdio(false);
cin.tie(NULL);
while (true)
{
int n, m, q;
cin >> n >> m >> q;
if (!(n || m || q)) {
break;
}
// Read graph.
... | true |
bb3e9a046bf2a16c6561d156ba71add8e2f1908f | C++ | bino7/chromium | /base/callback.h | UTF-8 | 2,496 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_CALLBACK_H_
#define BASE_CALLBACK_H_
#include "base/callback_forward.h"
#include "base/callback_internal.h"
// NOTE: Header files that ... | true |
3205ce948bcdfbaf3bacd3413b51a9a4902468b0 | C++ | ashih42/Nibbler | /srcs/SDLModule.cpp | UTF-8 | 7,365 | 2.734375 | 3 | [] | no_license | #include "SDLModule.hpp"
#include "ResourceManager.hpp"
#include "NibblerException.hpp"
# define CELL_WIDTH 24
extern "C"
{
IModule * createSDLModule(int boardWidth, int boardHeight, std::string title)
{
return (new SDLModule(boardWidth, boardHeight, title));
}
}
SDLModule::SDLModule(int boardWidth, int boar... | true |
9ee183fe393a84c2638eeb6cd2419577afb6fbfb | C++ | gogokigen/Cpp17-DataStructure-and-Algorithm | /Leetcode/Medium/814_binary_tree_pruning.cpp | UTF-8 | 1,326 | 3.46875 | 3 | [] | no_license | /*******************************************************************
* https://leetcode.com/problems/binary-tree-pruning/
* Medium
*
* Conception:
* 1.
*
* We are given the head node root of a binary tree,
* where additionally every node's value is either a 0 or a 1.
* Return the same tree where every subtree (of t... | true |
d24c23f01d02133f595137e1e009a5aef6d8dd3b | C++ | Befezdow/databases-stuff | /PgC Procedure/cat.h | UTF-8 | 763 | 3.21875 | 3 | [] | no_license | #ifndef CAT_H
#define CAT_H
#include <string>
#include <iostream>
class Cat {
std::string name;
std::string breed;
unsigned short age;
public:
Cat(std::string name = "", std::string breed = "", unsigned short age = 0);
std::string getName() const;
void setName(const std::string &value);
std::s... | true |
ec98c31a6e6df82b7d2a01d22c7905dbf37baa95 | C++ | parkeroth/EECS-678-P3 | /nachos/threads/thread.h | UTF-8 | 9,115 | 2.875 | 3 | [
"MIT-Modern-Variant"
] | permissive | // thread.h
// Data structures for managing threads. A thread represents
// sequential execution of code within a program.
// So the state of a thread includes the program counter,
// the processor registers, and the execution stack.
//
// Note that because we allocate a fixed size stack for each
// thread, it is p... | true |
9b8600c91d207c43f900142638c50a70ff0555ea | C++ | tomas0716/Square | /EsLib/Bezier4.cpp | UTF-8 | 2,399 | 2.53125 | 3 | [] | no_license | #include "stdafx.h"
#include "Bezier4.h"
IBezier4::IBezier4()
: m_ePlayType(ePlay_Stop), m_fTime(0), m_fCurrBezierTime(0), m_nBlockStep(0),
m_vCurrPosition(GwVector(0,0,0))
{
m_pDelegate_Complete = new IDelegate();
}
IBezier4::~IBezier4()
{
m_PositionList.clear();
m_BlockTimeList.clear();
m_RealBlockTimeList.... | true |
4076cea92b8d30d30f42c77763d8a271a82ff2c5 | C++ | WWology/336-A2 | /src/VertexArray.cpp | UTF-8 | 864 | 2.546875 | 3 | [] | no_license | // This is a personal academic project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "VertexArray.h"
VertexArray::VertexArray()
{
glGenVertexArrays(1, &m_ArrayID);
}
VertexArray::~VertexArray()
{
glDeleteVertexArrays(1, &m_ArrayID);
... | true |
c1c2b5c22ff617f9adf881d803dd8fe4f7204169 | C++ | LineageOS/android_frameworks_av | /media/libheadtracking/QuaternionUtil.cpp | UTF-8 | 3,432 | 2.84375 | 3 | [
"LicenseRef-scancode-unicode",
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | true |
c896c0c34c8bebca24e5fba4e37e5998fa32a3fd | C++ | Agrelimos/tutorials | /Win32/Drawing Shapes/win_main.cpp | WINDOWS-1252 | 10,520 | 3.046875 | 3 | [
"MIT"
] | permissive | // Done by TheTutor
/*
This tutorial is an introduction to the many GDI (Graphical Device Interface) functions
Windows has for drawing shapes. Using the Win32 API, we will generate the following shapes:
Ellipse
Arc
Polygon
Line
So with that brief introduction lets head to the code and get drawing.
*/... | true |
98b43f75149ba636c186529959e32aef72e92847 | C++ | killkelleyr/Programming | /College/C/Sort/Sort/Sort/Source.cpp | UTF-8 | 946 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
int sort(int a[], int size);
int main(void){
int duplicate;
int num[5];
//int x;
printf("Please enter 5 integers\n");
for (int x=0; x < 5; x++){
scanf_s("%d", &num[x]);
}
duplicate = sort(num, 5);
if (duplicate == 0)
printf("There were duplicates in the input\n");
if (duplicate == 1)
... | true |
414c19ced0341bd0a127813f219cfdde0265b4e8 | C++ | xCrosByx/KATET | /laba-2.1/Armament.cpp | WINDOWS-1251 | 5,793 | 3.1875 | 3 | [] | no_license | #include "Armament.h"
void Armament::get_manufacturer_country(string country)
{
manufacturer_country = country;
}
void Armament::get_name_of_armament(string name)
{
name_of_armament = name;
}
void Armament::get_cost(int price)
{
cost = price;
}
void Technics::get_number_of_people(int quantity)
{
num... | true |
8fd2eef8fa73ddeb5307a79d6cb23c59b67e783c | C++ | gridem/ReplobPrototype | /tests/serialization_tests.cpp | UTF-8 | 8,700 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015 Grigory Demchenko (aka gridem)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | true |
eff79413156aec15ebc56fdcd0f962d414243964 | C++ | esarver/svd-pca | /src/utility/program_options.hpp | UTF-8 | 3,881 | 3.203125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <string>
/**
* @brief The ProgramOptions class is a singleton class with a
* fully static interface. It contains all the information the user
* provided on the command-line.
*/
class ProgramOptions
{
public:
/**
* @brief The AlgorithmSelection enum defines the 3 different supported
... | true |
653cd4df555cceacba7b9c87477d486ae5bf6cc9 | C++ | Demi871023/UVa-Problem | /UVa10535/UVa10535.cpp | UTF-8 | 1,786 | 3.5625 | 4 | [
"MIT"
] | permissive | //UVa 10535 Shooter
/*
想法:
計算每個線段的端點極角,排列所有極角後,從最小角度開始掃描。
邊紀錄+1或-1值進入S[]。
最後再掃描一遍S[],取max值即為答案
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0); //利用反餘弦求出3.14159...
const int N = 1005;
... | true |
d8caaad6584a55dbb86a4dbcf019346f07044724 | C++ | Taohid0/C-and-C-Plus-Plus | /vector2/main.cpp | UTF-8 | 506 | 3.125 | 3 | [] | no_license | #include <bits/stdc++.h>
int main()
{
std::vector<int>v(4);
v.push_back(1);
v.push_back(2);
v.push_back(30);
printf("%d\n",(int)v.size());
for(std::vector<int>::iterator itr = v.begin();itr!=v.end();itr++){
printf("%d ",*itr);
}
v.clear();
if(v.empty()){
print... | true |
f02e12d1f4f156b33f5bb0048f7364c0305d6492 | C++ | aliceresearch/MAGPIE | /src/scenarios/common/nodes/Prog2Node.h | UTF-8 | 596 | 2.890625 | 3 | [] | no_license | #ifndef PROG2NODE_H
#define PROG2NODE_H
#include "../../../gp/Node.h"
/**
* {@link Lawnmower} node for joining two child nodes together.
*/
class Prog2Node : public Node
{
public:
/** Constructs the node with an arity of 2 and the name 'Prog2' */
Prog2Node() : Node(2, "Prog2") { }
/** Evaluate child no... | true |
267504ddec0fbf24892834a474ba57cfcfd5476c | C++ | cheyiwei/PAT_B | /1036_2.cpp | UTF-8 | 406 | 2.546875 | 3 | [] | no_license | /*
ID:PAT_B_1036
time@2018/2/4
author@cheyiwei
*/
#include<cstdio>
int main(){
int edge,c;
scanf("%d %c",&edge,&c);
int i = 1,j = 1;
int column = (edge+1)/2;
for(i=1;i<=column;i++){
if(i==1 || i == column){
for(j=0;j<edge;j++){
printf("%c",c);
}
}else{
printf("%c",c);
for(j=0;j<edge - 2;j++){... | true |
1cb6521cbc67d1e32a8a934f9119f5e74f1121cb | C++ | zhihengq/2048 | /include/game_state.h | UTF-8 | 4,632 | 3.578125 | 4 | [
"MIT"
] | permissive | #ifndef _GAME_STATE_H_
#define _GAME_STATE_H_
#include <cstdint>
#include <vector>
#include <ostream>
#include "tile.h"
#include "grid.h"
namespace _2048 {
/**
* Represents a game state.
*/
class GameState {
public:
friend std::ostream &operator<<(std::ostream &os, const GameState &g);
GameState &operato... | true |
a979a583bbea9d2fe0b6b841dc864f7997f4d0c6 | C++ | nmd2611/ADSL | /assign7.cpp | UTF-8 | 6,410 | 3.6875 | 4 | [] | no_license | //============================================================================
// Name : assign7.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <... | true |
08b4e0a798d825a3458abc714c37693fa08ff34f | C++ | ShuhengLi/LeetCode | /week3/2.AddTwoNumbers.cpp | UTF-8 | 988 | 3.609375 | 4 | [] | no_license | /*2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.
You may assume the two numbers do not contain any leading zero, except the num... | true |
d68fd3a4d059227ea0420e6e1fef6cfbb76b7e62 | C++ | MCOxford/ParticleExplosion | /ParticleExplosion/Swarm.h | UTF-8 | 336 | 2.53125 | 3 | [] | no_license | #ifndef SWARM_H_
#define SWARM_H_
#include "Particle.h"
#pragma once
class Swarm
{
public:
const static int NPARTICLES = 5000;
private:
Particle* m_pParticles;
int m_LastTime;
public:
Swarm();
virtual ~Swarm();
const Particle * const getParticles() { return m_pParticles; };
void update(int elapsed);
};
#endi... | true |
7956b3382236e0974bd3afbc3a755a9b5feab70c | C++ | lizj3624/mycode | /mystatic.cpp | GB18030 | 1,155 | 2.9375 | 3 | [] | no_license | // $_FILEHEADER_BEGIN ****************************
// ļƣmystatic.cpp
// ڣ20150821
// ˣ LiZunju
// ļ˵static.cpp
// $_FILEHEADER_END ******************************
#include "mystatic.h"
int myclass::my_i2 = 1;
int my_i_3 = 33;
static int my_i_4 = 44;
myclass::myclass()
{
my_i = 1;
}
myclass::~myclass()
{
}
vo... | true |
80979a1a647ad231dd6f9caf659191f8c05e3ff7 | C++ | zjxjwxk/PAT | /C++/Basic Level/B1028.cpp | UTF-8 | 1,412 | 3.40625 | 3 | [] | no_license | #include <cstdio>
struct Person {
char name[6];
int year;
int month;
int day;
} temp, oldest, youngest, left, right;
int ifOlder(Person p1, Person p2) {
if (p1.year != p2.year) {
return p1.year <= p2.year;
} else if (p1.month != p2.month) {
return p1.month <= p2.month;
} el... | true |
de73c34d3b8c0b4ed9caf27e1b74ee5b3db25cc9 | C++ | GreimuL/Competitive-programming | /BaekjoonOnlineJudge/implementation/sort/1427.cpp | UTF-8 | 532 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int squ(int a, int b)
{
int temp = 1;
for (int i = 0; i < b; i++)
{
temp *= a;
}
return temp;
}
int main()
{
int realpo;
int n;
int tempn = 0;
int num[12];
int po = 0;
int i=0;
cin >> n;
while (tempn != n)
{
tempn = n % squ(10, po);
po... | true |
fd54e8f417ac88d1db602e384eeb53b7401a2fdf | C++ | Jenny-D/programmiersprachen-aufgabenblatt-2 | /source/aufgaben_2_und_3.cpp | UTF-8 | 677 | 3.4375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <list>
#include <set>
#include <iterator>
#include <cstdlib>
int main() {
std::list<unsigned int> l;
for (int i = 0; i < 100; i++) {
unsigned int x = std::rand() % 101;
l.push_back(x);
}
std::set<unsigned int> s;
for (int i : l) {
s.insert(i);
}
std::cout << "In der Liste si... | true |
4dd849a7f461283eccf8b045421299c8469565eb | C++ | aa18514/CNN_FPGA | /SIM/maxfiles/convolution_MAX3424A_DFE_SIM/scratch/software-sim/build/DebugStreams.h | UTF-8 | 1,300 | 2.546875 | 3 | [] | no_license | #ifndef DEBUGSTREAMS_H_
#define DEBUGSTREAMS_H_
#include <boost/shared_ptr.hpp>
#include <map>
#include <string>
#include <fstream>
#include <stdint.h>
#include "ManagerSync.h"
namespace maxcompilersim {
class DebugStreams {
private:
// first is the name of destination stream
// second is the message
typedef st... | true |
07df0afe842ed7aacd3e73a7fd3af0eed94e2ca6 | C++ | Kannupriyasingh/CodeForces-Solutions | /LuckyNumber.cpp | UTF-8 | 457 | 3.203125 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
int main()
{
// Input taking N.
int N;
cin>>N;
bool flag=0;
// All numbers of 1, 21 3digits of 4 and 7.
int arr[12]={4,7,47,74,44,444,447,474,477,777,774,744};
// Checking if given number is satisfying condition or not.
for(int i=0;i<12;i++)
{
... | true |
bb7a60ca71b7ca3e85580c4bd06c50823c9e024f | C++ | gustavo-candido/ONLINE-JUDGE | /URI/1235.cpp | UTF-8 | 533 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
main ()
{
int c=0, z, half, i, j;
char A [200], B[200];
scanf("%d", &z);
while (c<z){
getchar();
scanf("%[^\n]", &A);
half = strlen(A) / 2;
for (i=0, j=half-1; i<=half; i++, j--) {
B[i] = A[j];
}
... | true |
307f57d1c355e4c347ba6db4ab46a3fe72bcf864 | C++ | beneills/motion | /src/timer.cpp | UTF-8 | 1,236 | 2.828125 | 3 | [] | no_license | #include <assert.h>
#include <iostream>
#include <sys/time.h>
#include <SDL2/SDL.h>
#include <timer.hpp>
long long int Timer::ms_since_epoch() {
struct timeval tp;
gettimeofday(&tp, NULL);
return tp.tv_sec * 1000 + tp.tv_usec / 1000;
}
void Timer::start() {
assert( this->start_ms == -1 );
this->start_ms ... | true |
62cdbc0fe065bf549ebcff43e6b427d135df5c7a | C++ | brandonq2/Robot-Code | /3-FlameCode/3-FlameCode.ino | UTF-8 | 1,996 | 3.1875 | 3 | [] | no_license | // Libraries Needed
#include <Servo.h>
#include <Wire.h>
// Motor Variables
const int rightMotor = 6;
const int leftMotor = 5;
const int rightRelay = 4;
const int leftRelay = 7;
// Flame Sensor Vairables
const int flameSensorLeft = A0;
const int flameSensorMid = A1;
const int flameSensorRight = A2;
int flameValueLeft... | true |
b2d5909a9415f23c8316ffe5a3b864bb7a94df5c | C++ | Colo1396/Gestion-de-Stock | /TDA Camiones Tpv4/main.cpp | ISO-8859-2 | 1,769 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include "Solicitud.h"
#include "Reposicion.h"
#include "Camion.h"
#include <cstdlib>
#include <stdio.h>
#include <conio.h>
#include <string>
#include <time.h>
#include <cstring>
#include <iostream>
#include <stdlib.h>
#include <ctype.h>
#include "FunnyProd.h"
using namespace std;
int main()
{ F... | true |
d29df33c23c3f5ae1d098a0859807ee08e295cc1 | C++ | omelove20/ff | /ทดลองครั้งที่7.1.cpp | UTF-8 | 768 | 3.015625 | 3 | [] | no_license | #include <stdio.h>
int num_arr1,num_arr2,num_arr3,arr1[5],arr2[5],arr3[10];
fung_arr1(){
for(int i=0;i<=num_arr1-1;i++){
printf("arr1[%d] : ",i);
scanf("%d",&arr1[i]);
}}
fung_arr2(){
for(int i=num_arr1;i<=num_arr3-1;i++){
printf("arr2[%d] : ",i);
scanf("%d",&arr1[i]);
}}
fun... | true |
3e5a6d16f056237d0aaea42881e96d5c4ab2e88b | C++ | Vaa3D/vaa3d_tools | /bigneuron_ported/erhan/PSF_tracing/functions/MatrixMultiplication.cpp | UTF-8 | 4,553 | 3.203125 | 3 | [
"MIT"
] | permissive | /* C++ IMPLEMENTATION OF PRINCIPAL CURVE TRACING USING MEX INTERFACE
Code developed by: Nikhila Srikanth
M.S. Project
Cognitive Systems Laboratory
Electrical and Computer Engineering Department
Northeastern University, Boston, MA
Under the guidance of: Prof. Deniz Erdogmus and Dr. ... | true |
4cba9f2f6caceeba159ad8a837268fb89f458d13 | C++ | SeaCanFly/CODE | /Study/Data struct/HomeWork/hw4/hw4_3/hw4_3/hw4_3.cpp | UTF-8 | 1,033 | 3.296875 | 3 | [] | no_license | #include<stdio.h>
typedef struct Node
{
int data;
Node* next;
Node(Node* pnode, int i_data)
{
data = i_data;
next = pnode;
}
}Node;
typedef struct List
{
Node* phead;
List(int num)
{
phead = nullptr;
Node* ptail = nullptr;
int i = 1;
while (num>=0)
{
phead = new Node(phead, num);
if (i)
... | true |
ccec949cfa29022099aaab21d13715b52d7b0de7 | C++ | rmmcosta/CppForCprogrammers | /Part A/week 1/sizes.cpp | UTF-8 | 277 | 2.65625 | 3 | [] | no_license | #include "unitTestFramework.hpp"
#include <iostream>
using namespace std;
template <class T>
inline int length(T theArray[]) {
return sizeof(theArray)/sizeof(T);
}
/*int main() {
int nums[] = {1,3,4,5};
cout << "test passed: " << assertTrue(4, length(nums));
}*/ | true |
86fc67539dc688adb3edc96510570dfe5511d373 | C++ | John-Ad/Dijkstras-algorithm-implementation | /Source.cpp | UTF-8 | 8,755 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#define INF 999
using namespace std;
//adjacency list graph implementation for a grid based graph //stores only the adjacent vertices of each vertex
class graph
{
private:
struct vertex {
char v;
bool visited;
int distFromSrc;
vertex* prev;
};
struct ... | true |
d2649d563ac3c54548a55bc581e6cf83cc4e6a23 | C++ | chhetri28/LPU_workshop | /Day-5/seive.cpp | UTF-8 | 711 | 2.875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
const int N = 100;
vector<int> primes;
void seive() {
p[0] = p[1] = 0;
vector<bool> p(N, 1);
for (int i = 2; i < N; i++) {
if (p[i] == 0) continue;
// it has to be a prime number
if (p[i] == 1) primes.push_back(i);
// cancel out all the multip... | true |
44e7480c53e5216dd3295b289c5ec3b1a97f72ee | C++ | LapusteB/StronglyConnectedComponets | /digraphMatrix.h | UTF-8 | 1,128 | 2.828125 | 3 | [] | no_license | #ifndef __DIGRAPH_MATRIX_H
#define __DIGRAPH_MATRIX_H
#include <string>
#include <stack>
#include <unordered_map>
#include <vector>
using namespace std;
enum mark_t { UNDISCOVERED, DISCOVERED, EXPLORED };
class DigraphMatrix
{
private:
int e, v;
vector<vector<bool>> a;
stack<int> s;
vector<... | true |
bd4708c7be2077b4e19742ff3c8fca622e159bb0 | C++ | Koios1143/Algorithm-Code-Saved | /template/AC_machine.cpp | UTF-8 | 763 | 2.734375 | 3 | [] | no_license | //By Koios1143
#include<bits/stdc++.h>
using namespace std;
const int Max = 26;
struct Node{
Node *child[Max];
int fail;
Node(){
for(int i=0 ; i<Max ; i++){
child[i]=NULL;
}
fail=-1;
}
};
struct Trie{
Node *root;
void init(){
for(int i=0 ; i<Max ; i++){
root->child[i] = NULL... | true |
2447661ed1145aea3ef4fad68b37f64369b5342d | C++ | Gaurav3435/CPP-Practice | /constructor-in-derived-class.cpp | UTF-8 | 837 | 3.765625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class base1
{
int data1;
public:
base1(int i)
{
data1=i;
}
void printbase1()
{
cout<<"The value in base1 is: "<<data1<<endl;
}
};
class base2
{
int data2;
public:
base2(int i)
... | true |
e01b944064735f958fddce10d44af269000768be | C++ | Kaermor/stepik-course363-cpp | /1-7-5z.cpp | UTF-8 | 342 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | //
// Created by grey on 18.10.2019.
//
#include <iostream>
#include <vector>
using namespace std;
void foo_1_7_5z(){
int n, sh = 0;
cin >> n;
vector<int> a(n);
//input, processing
for (int i = 0; i < n; i++){
cin >> a[i];
if (a[i] > 0){
sh++;
}
}
//out... | true |
1d00987c8ba05d23645cab9d7a8ef894baf8fa26 | C++ | PimentaMateus/ProjetosArduino | /Carro/car_com_controle_para_liga/car_com_controle_para_liga.ino | UTF-8 | 882 | 2.78125 | 3 | [] | no_license | int fPinA = 2; // Forward for motor A (left)
int rPinA = 3; // Reverse for motor A (Left)
int toggleA = 9; // Turns motor A on/off
int fPinB = 4; // Forward for motor B (Right)
int rPinB = 5; // Reverse for motor B (Right)
int toggleB = 10; // Turns motor B on/off
void setup()
{
pinMode... | true |
f4fe76fe83086ba591aed61d2228f0af75f66e9d | C++ | thegamer1907/Code_Analysis | /DP/420.cpp | UTF-8 | 488 | 2.828125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int b,g;
cin>>b;
int *boys = new int[b];
for (int i = 0; i < b; i++){
cin>>boys[i];
}
cin>>g;
int* girls = new int[g];
for (int i = 0; i < g; i++){
cin>>girls[i];
}
int i = 0,j = 0,pairs = 0;
sort(boys,boys+b);
sort(girls,girls+g);
while (i < b... | true |
14194d0f4f73d5285fc6b05f2102925126c848ee | C++ | PradipBaral022/Cpp_Projects | /Lab_Works/Lab_1(AreaOfTriangle)/Simple_Method/areaOfTriangle_2.cpp | UTF-8 | 406 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
float base, height, areaOfTriangle;
cout << "Enter the base of the triangle:";
cin >> base;
cout << "Enter the height of the triangle:";
cin >> height;
areaOfTriangle = 0.5 * (base * height);
cout << ... | true |
d249295e37fd3143d0e0002c40d4eb0cd8dd41f7 | C++ | FeniksComputerClub/montecarlo | /src/design.cxx | UTF-8 | 13,054 | 2.859375 | 3 | [] | no_license | #include "sys.h"
#include "debug.h"
#include "utils/MultiLoop.h"
#include "statefultask/AIStatefulTask.h"
#include "statefultask/AIEngine.h"
//===========================================================================
// Task
struct Task : public AIStatefulTask {
private:
bool m_do_finish;
protected:
//... | true |
571f5519c7a81e53dddde9ca3301f7225ce70364 | C++ | ZhongYingjia/Cpp-Primer | /ch12/ex12.28.cpp | UTF-8 | 1,208 | 2.9375 | 3 | [] | no_license | #include <string>
using std::string;
#include <vector>
using std::vector;
#include <map>
using std::map;
#include <set>
using std::set;
#include <iostream>
#include <fstream>
#include <sstream>
int main()
{
std::ifstream file("../data/storyDataFile.txt");
string text;
vector<string> input;
map<stri... | true |
cdf7a513cde19b970bf4172ec83641c2047c0df4 | C++ | akshya03/LoveBabbar-DSA-playlist | /binaryTree 13.cpp | UTF-8 | 1,848 | 3.59375 | 4 | [] | no_license | //similar to vertical traversal
// only diff is that only last dist is taken
#include<bits/stdc++.h>
using namespace std;
struct Node{
int data;
struct Node *left,*right;
Node(int x){
data=x;
left=right=NULL;
}
};
void bottomView(Node* root){
if(!root)
return;
Node* c... | true |
2e3c1705432015e565b9c4fa67fff5bc9cbaa6d1 | C++ | Pengxinjie/DataStructure-C | /DataStructure-C/队列2.cpp | GB18030 | 2,146 | 3.546875 | 4 | [] | no_license | //#define _CRT_SECURE_NO_WARNINGS
//#include<stdio.h>
//#include<stdlib.h>
//#include "2.h"
//
//int main()
//{
// LinkQueue q;
// initQueue(q);
// int boo = 1,
// te;
// while (boo)
// {
// int temp;
// printf("1.Ԫأӣ\n2.ɾԪأӣ\n3.ʾԪ\n4.ٶв˳\n");
// printf("ҪеĶв");
// scanf("%d", &temp);
// switch (temp) {
// case... | true |
7439913c22f071350b4e5ebc2ebf1bfc11ef6851 | C++ | juechen-zzz/C | /C_project/6_2 继承的基本概念/main.cpp | UTF-8 | 1,112 | 3.453125 | 3 | [] | no_license | //
// main.cpp
// 6_2 继承的基本概念
//
// Created by 倪浩鹏 on 2020/2/9.
// Copyright © 2020 nihaopeng. All rights reserved.
//
// 父类子类(基类派生类)
#include <iostream>
#include <string>
using namespace std;
class Student{
public:
Student(int id, string name){
this->id = id;
this->name = name;
}
... | true |
d4fda95cd5bb9f79851dceddbb9a4166a50ce8fb | C++ | luzyong/Proyecto-Teoria | /gramatica.cpp | UTF-8 | 6,064 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <conio.h>
#include<stdlib.h>
#include <iostream>
using namespace std;
int main(){
int var,ter,pro,i,j,l,respuesta,positiva,desigual,epsilon=0;
char terminales[5];
char produccion[pro];
char variable,terminal,produ,mayus,simbolo,minusc;
do{
//EXPLICACIÓN SOBRE LA... | true |
ae0bf497fb68c3ca7fd3f57e094cc720ee3bc204 | C++ | eraymitrani/hackerrank | /bidding_game.cpp | UTF-8 | 2,298 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int calculate_bid(int player, int pos, int* first_moves, int* second_moves) {
//Your logic to be put here
int o_left = 100, t_left = 100, bid = 0, draw=0;
int winning = 0, i = 0;
if (pos > 5) winning = 1;
else if (p... | true |
253a8e745ea3450931f975e00cc382ff596f66cb | C++ | UBIC-repo/core | /App.h | UTF-8 | 1,340 | 2.59375 | 3 | [
"MIT"
] | permissive |
#ifndef TX_APP_H
#define TX_APP_H
#include "FS/FS.h"
#if defined(_WIN32)
#include <synchapi.h>
#else
#include <unistd.h>
#endif
class App {
private:
bool terminateSignal = false;
bool reindexing = false;
bool starting = false;
uint32_t reindexingHeight = 0;
public:
static App& Instance(){
... | true |
dcd6513a0a1041504ed1d9f26f554cc9a2a0dff9 | C++ | vishuchhabra/cpp_programs | /programs codes/simple program based on multiple inheritance .cpp | UTF-8 | 529 | 2.875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class vishu
{
private:
int x,y;
public:
void setd()
{
cout<<"enter the two numbers "<<endl;
int a,b;
cin>>a>>b;
x=a;
y=b;
}
void print()
{
cout<<"yours values are following as "<<endl<<"x="<<x<<endl<<"y="<<y... | true |
425a278f6af0078451e92b2208039e6ee299210e | C++ | Yeeunbb/Lecture_Algorithm | /algo6/main4.cpp | UHC | 3,930 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
//ö
using namespace std;
struct Metro{ // ü
string station;
int index;
};
int m, l, staionIndex; // m, ȣ l, ε staionIndex
int visited[10000]; // 湮ߴ ǥ visited迭
string s1, s2, start, last; // 踦 Է¹ s1, s2, ۿ start, las... | true |
eca1d5a4d7b299fdd2f0ab6505af4888070d704a | C++ | kfarsany/undergraduate | /ICS_45C/shapes/Shape.h | UTF-8 | 369 | 3.046875 | 3 | [] | no_license | #ifndef SHAPE_H
#define SHAPE_H
#include <string>
#include <iostream>
using namespace std;
class Shape
{
int centerX;
int centerY;
string name;
public:
Shape(int newX, int newY, string newName)
: centerX(newX), centerY(newY), name(newName)
{}
virtual double area() = 0;
virtual void dra... | true |
372688a21f5a4c76cb0e1e163c45752dbe9c71d4 | C++ | Neutree/SmartHome | /demo/embedded/lib/src/F103_PWM.cpp | UTF-8 | 7,192 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "F103_PWM.h"
/**
*@brief 用于计算出Psc的值和Arr的值,分两种情况,第一种,72M能被frequency整除,第二种 72M不能被frequency整除
*@param quo 第一次计算之后的商
*@param quo2 第二次计算的商,由于在第一次计算里面已经定义了,就直接传过来了;
*@param rem2 理由通quo2
*@param flagBest 标志是否找到最佳的Psc和Arr的值
*/
void PWM::Calcute2(u32 quo,u32 quo2,u32 rem2,bool flagBest)
{
u16 i;
for(i = 1... | true |
af65d2cc0f46f8aed07449a769a91a4e8196108f | C++ | romanoprid/IOT-2019 | /main.cpp | UTF-8 | 3,931 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <conio.h>
#define _USE_MATH_DEFINES
#define n 5
#define m 5
using namespace std;
class Matrix
{
private:
double M[m];
public:
friend void inputArray(Matrix Array[]);
friend void outputArray(Matrix Array[]);
friend void sortArray(Matrix Array[]);
void... | true |
fa5c8cdea34d07bc016395c8b18a3088d667d535 | C++ | misterpeddy/CS216 | /Lab08/test.cpp | UTF-8 | 221 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
void passIntValue(float value)
{
value = 0.0;
}
void passIntRef(float & value)
{
value = 0.0;
}
int main()
{
float value = 0.0;
passIntValue(value);
passIntRef(value);
}
| true |
7972c4426e71ae8f59527f81b94dbb163c82daa5 | C++ | ea-evdokimov/3-semestr | /2-contest/2_B.cpp | UTF-8 | 3,460 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cmath>
#include <iomanip>
#include <set>
template<typename T>
struct Point{
T x, y;
T sq_len(const Point &a) const {
return (a.x - x) * (a.x - x) + (a.y - y) * (a.y - y);
}
friend std::istream& operator>> (st... | true |
241621c7d59be46982f2df7ba2ca1c13018ddb50 | C++ | cies96035/CPP_programs | /TEST/test.cpp | UTF-8 | 866 | 3.140625 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<queue>
using namespace std;
class A{
public:A(){a=1;cout<<"AX"<<endl;}
A(int x){a=x;cout<<"AX(int)"<<endl;
if(x<0)throw(x);
}
~A(){cout<<"DA:"<<a<<endl;}
int a;
};
class B:public A{
public:
int b;
B(): A(11){b=3;cout<<"CB"<<endl;}
... | true |
9ea7aa94449e61fb02d1d88baf3ce0f1d55e4a54 | C++ | ademakov/Oroch | /oroch/integer_stats.h | UTF-8 | 2,951 | 2.703125 | 3 | [
"MIT"
] | permissive | // integer_codec.h
//
// Copyright (c) 2015-2016 Aleksey Demakov
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use,... | true |
ea29e1067fe7dfc1013776febe5f0b2c9772ea8b | C++ | iu-vail/iprimal | /iPrimal.h | UTF-8 | 4,994 | 2.9375 | 3 | [
"MIT"
] | permissive |
///////////////////////////////////////////////////////////////////////////////
// File name: iPrimal.h
// This file defines the main algorithm of IMPROVED primal assignment Method.
// The time complexity is improved to O(n^3 lg n), via merging multiple steps
// into single stages of swap loop searching.
// Min-heaps... | true |
3834ee8482cd4ddc2ff8e15af2204f7f5c3c3de2 | C++ | AnminQ97/UE4_World | /Source/U02_Action/Components/CInventoryComponent.cpp | UHC | 1,229 | 2.90625 | 3 | [] | no_license | #include "CInventoryComponent.h"
#include "Global.h"
#include "InventorySystem/CItem.h"
UCInventoryComponent::UCInventoryComponent()
{
Capacity = 20;
}
void UCInventoryComponent::BeginPlay()
{
Super::BeginPlay();
/*for (auto& Item : DefaultItems)
{
AddItem(Item);
}*/
}
// ߰
bool UCInventoryComponent::AddI... | true |
a7c79a88b95525df4ce180f1cfac7817bd730862 | C++ | andrewbkbk/sf_project | /TaskPlugin.cpp | UTF-8 | 728 | 2.75 | 3 | [] | no_license | #include "TaskPlugin.h"
#include "Task.h"
#include <iostream>
namespace
{
class MyTask : public Task
{
public:
virtual ~MyTask( )
{
std::cout << "~MyTask" << std::endl;
}
virtual bool run( )
{
std::cout << "Run!!" << std::endl;
return true;
}
virtual int get_progres... | true |
6e6cfb0856ba40b7fd89503950bb12b313be2b14 | C++ | tnsgh9603/BOJ_Old | /트리의 순회.cpp | UHC | 914 | 3.296875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int in_order[100001], post_order[100001], position[100001];
void solve(int is, int ie, int ps, int pe) {
// is -> inorder_start, ie -> inorder_end
// ps -> position_start, pe -> position_end
if (is > ie || ps > pe) {
return;
}
int root = post_order[pe];
cout << root << ... | true |
af47024eab12c9f10b2f69a46c50b616277d35e1 | C++ | defytheflow/libege | /numconv/old/tests.cpp | UTF-8 | 1,387 | 3.140625 | 3 | [] | no_license | #include "common.h"
#include "numconv.h"
using namespace std;
typedef string (*numConvFunc)(string, int);
void test_error(string func, string test_case, string exp_res, string res)
{
cerr << "Test failed in function " + func << endl;
cerr << "Testcase - " + test_case + ", Expected result - " + exp_res +
... | true |
62b9c94ec7c26ef5125818696c888036ebeb5250 | C++ | leehaei/HTN_UbiGame | /UbiGame/Source/GameEngine/Util/TextureManager.h | UTF-8 | 3,992 | 2.71875 | 3 | [] | no_license | #pragma once
#include <vector>
#include <SFML/Graphics/Texture.hpp>
#include <SFML/System/Vector2.hpp>
namespace GameEngine
{
//TODO - if needed, move out of Engine part to some sort of loader on the game side of things
namespace eTexture
{
enum type
{
None = -1,
Player = 0,
//PlayerIdle,
//PlayerAt... | true |
b1f97c38b443e274c22f6f838438d5c017ed4013 | C++ | scottyege/simplication | /SIMP/HalfMesh.h | UTF-8 | 14,593 | 2.875 | 3 | [] | no_license | #ifndef HALFMESH_H
#define HALFMESH_H
#include "glm.h"//obj model loader
#include<vector>
using std::vector;
#include<map>
using std::map;
using std::pair;
using std::make_pair;
#include<queue>
using std::queue;
struct HEVertex;
struct HEFace;
struct HalfEdge;
#include<ctime>
#include<cstdlib>
#include<algorithm... | true |
11021d0dc96348d95e3cb0827a7af62b51527a29 | C++ | dmkorolevskii/OOP | /milestone/ErrorState.h | UTF-8 | 619 | 2.859375 | 3 | [] | no_license | // Header file. Contains constructor, member functions, helper operator, error message declaration
// File ErrorState.h
// Date: 2018/03/22
// Author: Dmitrii Korolevskii
#ifndef AMA_ERRORSTATE_H
#define AMA_ERRORSTATE_H
namespace AMA{
class ErrorState{
char* errorMessage;
public:
explicit ErrorState(const char*... | true |
262ec91c9e5e154cae2a025eb4bcc323333fde12 | C++ | Databean/mipsify | /include/mips32/Instruction.h | UTF-8 | 12,101 | 2.953125 | 3 | [] | no_license | #ifndef MIPS32_INSTRUCTION_H
#define MIPS32_INSTRUCTION_H
#include <iostream>
#include <string>
namespace mips32 {
typedef unsigned short Register;
extern const Register R_ZERO;
extern const Register R_AT;
extern const Register R_V0;
extern const Register R_V1;
extern const Register R_A0;
extern cons... | true |
8916ad8e8b2ce0442956da0101ac2fcd5786e2b1 | C++ | Iraniya/code-for-today-for-everyDay | /code-for-today-for-everyDay/Practice/HackerRank/30Daysofcodes/day10/BinaryNumber/main.cpp | UTF-8 | 822 | 2.734375 | 3 | [] | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | true |
67e4dc7878e2c4ee4a039ee995250358fd7c5137 | C++ | jzmrexu1s/leetcode-exercises | /LeetCode/Tree BFS/102. Binary Tree Level Order Traversal.cpp | UTF-8 | 1,360 | 3.390625 | 3 | [] | no_license | //
// Created by Chengwei Zhang on 5/20/20.
//
/*
* 队列
* q.empty() 如果队列为空返回true,否则返回false
* q.size() 返回队列中元素的个数
* q.pop() 删除队列首元素但不返回其值
* q.front() 返回队首元素的值,但不删除该元素
* q.push() 在队尾压入新元素
* q.back() 返回队列尾元素的值,但不删除该元素
*... | true |
e1f587e1ff978bf227208c166967f5cfdf2fcb88 | C++ | dineshkumares/wotop | /include/logger.h | UTF-8 | 574 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef LOGGER
#define LOGGER
#include <iostream>
#include <sstream>
#include <mutex>
enum LogLevel { DEBUG, VERB2, VERB1, INFO, WARN, ERROR};
const LogLevel logLevel = WARN;
class logIt {
public:
logIt(LogLevel l);
logIt(LogLevel l, const char *s);
template <typename T>
logIt & operator<<(T const ... | true |
29a81e96be3328d4d09cc33fbedf6a4855863648 | C++ | tks3210/Atcoder | /abc126/abc126_d.cpp | UTF-8 | 1,185 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, ll> P;
#define N_OVERSIZE 100050
vector<P> root[N_OVERS... | true |
08473746d00438f4816fdada0096ae0e44752ce1 | C++ | MonkeYKonG/Enchiladas-s-shmup | /lib/my_objects_lib/Panel.cpp | UTF-8 | 5,562 | 2.640625 | 3 | [] | no_license | #include "Panel.hpp"
namespace my
{
Panel::Panel()
{}
Panel::~Panel()
{}
bool Panel::IsIntersect(const sf::Vector2f & point) const noexcept
{
return (false);
}
bool Panel::IsIntersect(const sf::FloatRect & square) const noexcept
{
return (false);
}
const sf::FloatRect Panel::GetHitBox() const noexc... | true |
46268ad742fd3b05db3d3f9064c079de8c4f8983 | C++ | stdstring/leetcode | /Algorithms/Tasks.1501.2000/1503.LastMomentBeforeAllAntsFallOutOfPlank/solution.cpp | UTF-8 | 1,030 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <vector>
#include "gtest/gtest.h"
namespace
{
class Solution
{
public:
[[nodiscard]] int getLastMoment(int n, std::vector<int> const &left, std::vector<int> const &right) const
{
const int leftMaxDistance = left.empty() ? 0 : *std::max_element(left.cbegin(), left.cend())... | true |
7a973d55bf65dfb3b1602dadc5853cef639ddc20 | C++ | Finalcheat/leetcode | /src/cpp/Maximum-69-Number.cpp | UTF-8 | 1,278 | 3.703125 | 4 | [] | no_license | /**
* @file Maximum-69-Number.cpp
* @brief Maximum 69 Number(https://leetcode.com/problems/maximum-69-number/)
* @author Finalcheat
* @date 2020-04-12
*/
/**
* Given a positive integer num consisting only of digits 6 and 9.
* Return the maximum number you can get by changing at most one digit (6 becomes 9, and ... | true |
2d5549ddd1bc08465c36d3e2b739244ee1d79281 | C++ | kriogenia/the-parting-of-sarah | /ThePartingOfSarah/Door.cpp | UTF-8 | 304 | 2.65625 | 3 | [
"MIT"
] | permissive | #include "Door.h"
Door::Door(string filename, int x, int y, int width, int height, int fileWidth, int fileHeight, Game* game) :
MappedTile(filename, x, y, width, height, fileWidth, fileHeight, DOOR_OPEN, game) {
}
void Door::open() {
this->position = 1;
}
void Door::close() {
this->position = 0;
} | true |
d4775d9f3f14358c505f0ef53ba6fa3b6484716e | C++ | ksatyendra/REF | /C++ REF/Ch04pr01.cpp | UTF-8 | 4,041 | 3.75 | 4 | [] | no_license | // Program Ch04pr01
// Program to maintain a linked list
#include <iostream>
using namespace std;
class linklist
{
private :
// structure containing a data part and link part
struct node
{
int data ;
node * link ;
} *p ;
public :
linklist( ) ;
void append ( int num ) ;
void... | true |
caca00dd2469fe57ce9b1a55cdf35aec030ee8d8 | C++ | j-p-e-g/AdventOfCode2017 | /AdventOfCode/December21b.cpp | UTF-8 | 4,821 | 2.8125 | 3 | [] | no_license | #include "stdafx.h"
#include <iostream>
#include "CoordPoint.h"
#include "December21b.h"
#include "Matrix.h"
using namespace AdventOfCode::December21;
PixelPatternB::PixelPatternB(const std::string& fileName)
: PixelPattern()
{
ReadFile(fileName);
}
void PixelPatternB::OutputResultToConsole() const
{
s... | true |
73c020040d9574d95d21172fbaea715f6ea074d7 | C++ | preethichandra20/LeetCode | /Arrays/Easy/sortarraybyincreasingfrequency.cpp | UTF-8 | 723 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> nums={-1,1,-6,4,5,-6,1,4,1};
int n=nums.size();
map<int,int,greater<int>> mp;
for(int i=0;i<nums.size();i++)
{
mp[nums[i]]++;
}
multimap<int,int> mp1;
map<int,int>:: iterator itr;
for(itr=mp.begin();itr!=mp.... | true |
fc52b9cd5bca7b2bb243fefdbfeeb618ce0333cb | C++ | phirasit/MyLib | /BinomialHeap.cpp | UTF-8 | 2,688 | 3.25 | 3 | [] | no_license |
#ifndef BINOMIAL_HEAP
#define BINOMIAL_HEAP
#include <vector>
using namespace std;
template<class Data> class BinomialHeap {
public :
class iterator {
public :
int id, deg;
Data key;
iterator *parent, *left, *right, *left_child;
iterator(Data k) : key(k), deg(0), parent(NULL),
l... | true |
dcaca1775ae31f1bf3960d98317b433a5e1a265a | C++ | JSYoo5B/TIL | /PS/BOJ/2010/2010.cc | UTF-8 | 237 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(void) {
int n_taps;
cin >> n_taps;
int total_holes = 1;
for (int i = 0; i < n_taps; i++) {
int n_holes;
cin >> n_holes;
total_holes += n_holes - 1;
}
cout << total_holes;
} | true |
e3b0698c128f0743b1d2243ae97a1b38e9f87d90 | C++ | mam28/cpp_for_profi | /ch02/listing_02_07.cpp | UTF-8 | 367 | 3.046875 | 3 | [] | no_license | // Программа с логическими операторами
#include <cstdio>
int main()
{
bool t = true;
bool f = false;
printf("!true : %d\n", !t);
printf("true && false: %d\n", t && f);
printf("true && !false: %d\n", t && !f);
printf("true || false: %d\n", t || f);
printf("false || false: %d\n", f || f);
... | true |