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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
40576f7e83511e899f8b539d01ffd511c3328841 | C++ | Iktwo/hk | /src/healthdataworkout.h | UTF-8 | 2,460 | 2.8125 | 3 | [
"MIT"
] | permissive | #ifndef HEALTHDATAWORKOUT_H
#define HEALTHDATAWORKOUT_H
#include <QObject>
#include <QDateTime>
class HealthDataWorkout : public QObject
{
Q_OBJECT
public:
explicit HealthDataWorkout(QObject *parent = nullptr);
Q_PROPERTY(HealthDataActivityType activityType READ activityType NOTIFY activityTypeChanged)
... | true |
40e1dbdcb34db5065dcf0a00acba7bf3b86f38a0 | C++ | Merisho/comprog | /codeforces/round-684-div-2/c.cpp | UTF-8 | 2,058 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<vector<int>> ans;
vector<string> a;
vector<pair<int, int>> o;
vector<pair<int, int>> z;
vector<int> tr;
void invert(vector<int>& coords) {
for (int i = 0; i < coords.size(); i += 2) {
int x = coords[i];
int y = coords[i + 1];
a[x][y] = ... | true |
03d55957dc9cdfc998b8d10781e9af831fb58c7c | C++ | Hydraz320/CPP-Primer-Practice | /chapter4/4.22.cpp | UTF-8 | 688 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <cstring>
using std::cin; using std::cout;
using std::endl;
using std::string; using std::vector;
using std::begin; using std::end;
using std::strcat; using std::strcpy;
string grade(int point)
{
... | true |
f7ee53f15ab9616fb46b3f60132d44eb69c7cd72 | C++ | mehulthakral/logic_detector | /backend/CDataset/isValidBST/isValidBST_63.cpp | UTF-8 | 512 | 3.140625 | 3 | [] | no_license | class Solution {
public:class TreeNode{
public:
TreeNode* left;
TreeNode* right;
int val;
};
bool isValidBST(TreeNode* root) {
return helper(root, numeric_limits<long long int>::min(), numeric_limits<long long int>::max());
}
bool helper(TreeNode* root, long ... | true |
4104c5f417e42904c24d122adda82382beb4a2d3 | C++ | rack-leen/qt-example | /myproject/ExtensionDialog/ExtensionDialog/dialog.cpp | UTF-8 | 3,261 | 2.921875 | 3 | [] | no_license | #include "dialog.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QLineEdit>
#include <QComboBox>
#include <QHBoxLayout>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QGridLayout>
Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(tr("ExtensionDialog")); //设置窗口标题
create... | true |
e5d98c01a76c6c39350de6c8b24e76667e7219f3 | C++ | SoilRos/dune-copasi | /dune/copasi/common/factory.hh | UTF-8 | 1,028 | 2.9375 | 3 | [] | no_license | #ifndef DUNE_COPASI_FACTORY_HH
#define DUNE_COPASI_FACTORY_HH
#include <memory>
#include <dune/common/typetraits.hh>
namespace Dune::Copasi {
/**
@defgroup Factory Factory
@{
@brief Class instance creator
A factory should be able to create an instance of a type out of @ref DataContext.
This is done by the de... | true |
e5336c52c4b661f75d882286ddb96f8731b23fdd | C++ | farqnyy8/C-Practice-1 | /for loop class.cpp | UTF-8 | 1,013 | 3.546875 | 4 | [] | no_license | /*
Write a C++ program to create the following
menu:
Please select form the menu:
1. French Fries.................$5.00
2. Caesar Salad...............$8.00
3. Mushroom Soup........$10.00
Enter you choice here=>
Then find the total cost for the meal.
*/
#include <iostream>
using namespace std;
int main()
... | true |
5033cd977f028b23a50a56945864f509444a9f0d | C++ | Neomer/pathfinder | /game_server/game/cards/armors/MagicChainMail.cpp | UTF-8 | 967 | 2.640625 | 3 | [] | no_license | //
// Created by vinokurov on 29.06.2019.
//
#include "MagicChainMail.h"
std::string_view MagicChainMailMetadata::getCardTitle() const {
return "Волшебная кольчуга";
}
const char *MagicChainMailMetadata::getTypeName() const {
return "MagicChainMail";
}
const char *MagicChainMailMetadata::getDescription() co... | true |
2fb274930c0b2a9e57fb1162000f5547da797cb8 | C++ | TinyCowry/MySTL | /dataStuct/BinarySearchTree.cpp | UTF-8 | 6,996 | 3.703125 | 4 | [] | no_license | /*
*二叉搜索树
*http://www.cnblogs.com/skywang12345/p/3576373.html
*/
#ifndef _BINARYSEARCHTREE_
#define _BINARYSEARCHTREE_
#include <iostream>
using namespace std;
template<class T>
struct TreeNode{
T val;
TreeNode* left;
TreeNode* right;
TreeNode* parent;
TreeNode(T val, TreeNode* left, TreeNode* ... | true |
58e2c218fe6d2eece3baab504b35fe58601513f7 | C++ | wwwwodddd/Zukunft | /CF/1228C.cpp | UTF-8 | 604 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
typedef long long ll;
int x;
ll n, z = 1;
ll pw(ll x, ll y)
{
ll re = 1;
for (; y > 0; y >>= 1)
{
if (y & 1)
{
re = re * x % mod;
}
x = x * x % mod;
}
return re;
}
ll gao(ll n, int p)
{
ll re = 0;
while (n > 0)
{
n /= p;
re... | true |
ca550924bf73d29004af910655cc200d8fb0ec8c | C++ | former7/7j523game-developing- | /server/seat.h | UTF-8 | 686 | 2.65625 | 3 | [] | no_license | #include <inttypes.h>
#include <map>
class seat {
public:
seat();
seat(int8_t n);
void newRound();
int8_t getNumber() { return seatNumber; };
int getRemainingChips() { return remainingChips; };
void wins(int n);
void setFD(int n) { fd = n; };
int getFD() { return fd; };
void... | true |
2c412d6b47ae2c80ede3c84ba721a42a551650a1 | C++ | DragonClawz/RC_Cars | /big_rc_car.ino | UTF-8 | 10,849 | 2.546875 | 3 | [] | no_license | #include <LiquidCrystal.h>//For the LCD I2C
#include <Wire.h>
#include<LCD.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
SoftwareSerial BT(10, 11); //TX, RX respetively
String readdata;
//LiquidCrystal lcd(8,9,4,5,... | true |
d3fb76ad8848c10ff0bd70635f0418b4d0201047 | C++ | lb2616/all_descriptions_of_pdfs | /各种pdf/上嵌/C++上课内容/c++第5天/720上午/虚拟继承顺序.cc | UTF-8 | 647 | 3.375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class A1
{
public:
A1()
{
cout <<"A1"<<endl;
}
~A1()
{
cout << "~A1"<<endl;
}
};
class A2
{
public:
A2()
{
cout <<"A2"<<endl;
}
~A2()
{
cout<< "~A2"<<endl;
}
};
class A3
{
public:
A3()
{
cout <<"A3"<<endl;
}
~A3()
{
cout<<... | true |
564e78a82bb622bdd2ab374332e8c8d516bfd97f | C++ | grayd4/Arduino-PC-Monitor | /monitor/monitor.ino | UTF-8 | 6,596 | 2.703125 | 3 | [] | no_license | //www.elegoo.com
//2016.12.9
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This... | true |
8b1d35a49f6ca4b2f6893996206c7768db129e4e | C++ | SanyaAttri/LeetCode | /00895. Maximum Frequency Stack.cpp | UTF-8 | 2,808 | 3.1875 | 3 | [] | no_license | //
// main.cpp
// LeetCode
//
// Created by 郭妙友 on 17/2/5.
// Copyright © 2017年 miaoyou.gmy. All rights reserved.
//
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <cmath>
#include <vector>
#include... | true |
aa7b8ff0ee7205e3fc5f970426f3bc2fe748dc74 | C++ | lootsy/sputnik-win | /Sputnik/StudioLinkAPIConnector/StudioLinkAPIConnector.h | UTF-8 | 890 | 2.765625 | 3 | [] | no_license | #pragma once
using namespace System;
using namespace System::Collections::Generic;
namespace StudioLinkAPI {
public ref class Device
{
public:
Device(const int channels, const double sampleRate, const String^ name);
inline int Channels();
inline double SampleRate();
inli... | true |
89773ed1c13da9fac812f0f927fdf742eacb2845 | C++ | simonsayspark/arduino-library | /samples/lcd/sample_lcd.ino | UTF-8 | 2,433 | 3.703125 | 4 | [] | no_license | /**
* This file is a small sample showing some basic setup and functionality for the
* LCD display. The setup() function sets up the LCD display, and the loop()
* function shows how many iterations have been performed on the display.
*
* Be sure to check the wiring guide for how to hook up the LCD.
*
* IMPORTA... | true |
aa05151fc92a348d9d847f8ed025208d0d03b4a9 | C++ | 15831944/liuwanbing | /棋牌/PlatForm/Client/MainFrame/Socket32.cpp | GB18030 | 9,827 | 2.515625 | 3 | [] | no_license |
#include "stdafx.h"
#include "Socket32.h"
#include <assert.h>
#include <Tlhelp32.h>// DWORD GetProcessIdFromName(LPCTSTR name) 2012.08.16 yyf
// ܵ߳ ͣĶϢ.
DWORD WINAPI SimpleSocketThread(LPVOID param)
{
CSocket32 * SimpleSocket = (CSocket32 *)param;
BYTE BYTE_Read[10240] ;
while(NULL != SimpleSocket &... | true |
84dc589ab5ca63df322f5611b20acc518ac89cfc | C++ | BTHStoraSpelprojektet/Stora-Spelprojektet | /Shurikenjutsu/Shurikenjutsu/PointOfInterest.h | UTF-8 | 827 | 2.515625 | 3 | [] | no_license | #ifndef POINTOFINTEREST_H_
#define POINTOFINTEREST_H_
#include "MovingObject.h"
class ParticleEmitter;
class PointOfInterest :
public MovingObject
{
public:
PointOfInterest();
~PointOfInterest();
bool Initialize(POINTOFINTERESTTYPE p_type, const char* p_filepath, DirectX::XMFLOAT3 p_pos, DirectX::XMFLOAT3 p_dir... | true |
8a771e2a17756fe556685984e30d8774f87d69be | C++ | tzach420/SPLFLIX | /include/User.h | UTF-8 | 2,582 | 3.28125 | 3 | [] | no_license | #ifndef USER_H_
#define USER_H_
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <map>
class Watchable;
class Session;
class LengthRecommenderUser;
class User{
public:
User(const std::string& name);//constructor.
virtual~User();//destructor.
... | true |
f5d4f8368f0ce2d056658b7fc7c2893e32b4aed8 | C++ | kornel-schrenk/DiveIno | /PoC/DiveInoTouch/DiveInoTouch/Components/PressureDisplay.h | UTF-8 | 418 | 2.546875 | 3 | [
"MIT"
] | permissive | #ifndef PRESSUREDISPLAY_H_
#define PRESSUREDISPLAY_H_
#include <Adafruit_ILI9341.h> // Hardware-specific library
#include "..\Utils\ScreenUtils.h"
class PressureDisplay {
public:
PressureDisplay(Adafruit_ILI9341* adafruitTft);
void init(float pressureInMilliBar);
void update(float pressureInMilliBar);
int curre... | true |
23f2e2e34bde9aeceff22f6cabe01a08c806646e | C++ | DHaoYu/ali_cloud | /IO/Select/SelectTest/SelectTest.cc | UTF-8 | 626 | 2.78125 | 3 | [] | no_license | #include<iostream>
#include<sys/select.h>
#include<unistd.h>
using namespace std;
int main()
{
fd_set rfd;
FD_ZERO(&rfd);
FD_SET(0, &rfd);
for(;;)
{
int ret = select(1, &rfd, NULL, NULL, NULL);
if(ret < 0)
{
cerr<<"select error"<<endl;
continue;
}
if(FD_ISSET(0, &rfd))
{
... | true |
3522215715bf84905301b92f54c2390fb32287ae | C++ | bjakubie/Kraj | /Kraj-2/Polityka.cpp | UTF-8 | 1,171 | 3.109375 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <fstream>
#include "Polityka.h"
using namespace std;
string nazwa_pliku_p = "Polityka.txt"; //<Nazwa pliku do zapisu stanu obiektu
//konstruktor
Polityka::Polityka()
{
#ifdef DEBUG
cout << "Wywolano konstruktor Param_urzadzenia" << endl;
#endif
zadlozenie_kraju = 83... | true |
9eb58489296a96a14a8d4bd89a050bebfa67673b | C++ | bruceoutdoors/CG-Assignment | /OpenGL-Utilities/utilities/GlutManager.hpp | UTF-8 | 935 | 2.671875 | 3 | [
"MIT"
] | permissive | /********************************************
Course : TGD2151 Computer Graphics Fundamentals /
TCS2111 Computer Graphics
Session: Trimester 2, 2015/16
ID and Name #1 : 1141125087 Hii Yong Lian
Contacts #1 : 016-4111005 yonglian146@gmail.com
ID and Name #2 : 112272848 Lee Zhen Yong
Contacts #2 : 016-3188... | true |
b49526d1a6633b557f63fa4b7ecb2410f29ee5bf | C++ | linkhack/Molecular_VIS | /Molecular_VIS/src/Light/Light.h | UTF-8 | 902 | 2.828125 | 3 | [] | no_license | #pragma once
#include "../Shader/Shader.h"
/*!
* \brief Base class for lights
*
*/
class Light
{
protected:
/*!
* Uniforms to update for a particular light and shader. Has to be overwritten.
*
* \param shader shader to be updated.
* \param index index index of the light among lights of the same type (use... | true |
6571047818d85c7d5fc472e2e1178f59ee241fa6 | C++ | chronics/PhysX | /PhysXed togeather/MyPhysicsEngine.h | UTF-8 | 13,349 | 2.5625 | 3 | [] | no_license | #pragma once
#include "BasicActors.h"
#include "MyActors.h"
#include <iostream>
#include <iomanip>
namespace PhysicsEngine
{
using namespace std;
//a list of colours: Circus Palette
static const PxVec3 color_palette[] =
{
PxVec3(255.f / 255.f,.0f / 255.f,.0f / 255.f), //red 0
PxVec3(255.f / 255.f,255.f ... | true |
f81476b9e70bcb8f349983de44b0fae978a64ff7 | C++ | AugustoCalaca/competitive-programming | /codeforces/981A.cpp | UTF-8 | 631 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
void fast() {
cout.sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
int main() {
fast();
string s;
cin >> ... | true |
e24364af0087a23944325f7b9bcdf1c8c832a271 | C++ | haruponponpopon/MAC_cpp_Samples | /string/src/string_upper.hpp | UTF-8 | 1,124 | 3.71875 | 4 | [] | no_license | #pragma once
/**
* C++ string sample
* 2020-03-01 K.OHWADA
*/
// convert string to uppercase / lowercase
// reference : https://en.cppreference.com/w/cpp/algorithm/transform
#include<iostream>
#include <algorithm>
#include <cctype>
// protytype
char char2upper(char c);
char char2lower(char c);
void str2upper(std:... | true |
cd454f0e4733bdee05a02784aa1a9fe5c3dae825 | C++ | Mahonghui/AmNet | /src/net/iobuffer.cpp | UTF-8 | 1,086 | 2.71875 | 3 | [] | no_license | //
// Created by amisher on 18-12-10.
//
#include <sys/uio.h>
#include <unistd.h>
#include <stdint.h>
#include <errno.h>
#include "iobuffer.h"
const size_t IOBuffer::PREPEND_SIZE;
const size_t IOBuffer::INITIAL_SIZE;
const char IOBuffer::CRLF[] = "\r\n";
ssize_t IOBuffer::ReadIntoFd(int fd, int *saved_errno) {
... | true |
9036cd5cb1142a7bc0a5ae3048f934a603154cf0 | C++ | ray7yu/cses | /Introductory Problems/two-sets.cpp | UTF-8 | 874 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
long n;
int count = 0;
cin >> n;
vector<bool> elems(n+1, false);
long sum = n * (n+1) / 2;
if(sum % 2 != 0){
cout << "NO";
} else {
cout << "YES" << endl;
sum /= 2;
long temp = n;
... | true |
4550e9ac972f91cc45a6f7744a27be140a9b5617 | C++ | SiliGuo/RCC | /CSC-17A/Project 2/Player.cpp | UTF-8 | 4,336 | 3.296875 | 3 | [] | no_license | /*
* File: Player.cpp
* Author: siliguo
*
* Created on December 8, 2016, 11:08 AM
*/
#include <cstring>
#include "Player.h"
int Player::Tbet = 0;
Player::Player() {
rank = 0;
money = 1000;
bet = 0;
card = NULL;
}
void Player::setCard(PlyNum p) {
card = new Card[3];
for (int i = 0; ... | true |
5081fdaf593d55c3a3f61d663a3b4d1eb083a35a | C++ | yuzec/luogu | /P1032/main.cpp | UTF-8 | 998 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <queue>
#include <map>
using namespace std;
int n;
string a,b,orginal[6],translated[6];
struct node{
string str;
int step;
}ans;
queue<node> q;
map<string,int> m;
node bfs(string a) {
int i,pos;
node s,t;
s.str=a;
s.step=0;
q.push(s);
whi... | true |
c115439a045d8018946c60d8da9f8a9d65dccf9b | C++ | kuerina/persistent_unordered_map | /persistent.h | UTF-8 | 3,425 | 2.84375 | 3 | [] | no_license | #include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/unordered/unordered_map.hpp>
#include <boost/functional/hash.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/fusion/support/pair... | true |
c2ace39469faaed587bafe792049f5995c8a606f | C++ | LittleVolcano/MY-PAT | /A1093.cpp | UTF-8 | 513 | 2.609375 | 3 | [] | no_license |
#include <algorithm>
#include<stdio.h>
#include <cstring>
using namespace std;
char str[100010];
int main()
{
int countp[100010];
int len;
int num=0;
long long ans = 0;
gets(str);
len = strlen(str);
for(int i = 0;i < len; ++i)
{
if(str[i] == 'P')
{
countp[i+1] = countp[i]+1;
num++;
}
else countp... | true |
f009211affaab8db6351d6c51ad57be696281665 | C++ | ithsarasak/Programming | /Compettitive programming/BUU camp #14/camp#2/Problem/Daily#3/NC_optimization.cpp | UTF-8 | 1,732 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
long long t, st[3] = { 14,15,63 };
struct A{
long long mat[4][4];
A operator*(const A &o){
A temp;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
temp.mat[i][j] = 0;
for(int k=0;k<3;k++){... | true |
e7c2f3e1d584c7695f0ff02d1135d6a290a0cd1d | C++ | harudes/Unlimited-Bit-Works-IV | /listas enlazadas ppp.cpp | UTF-8 | 1,044 | 3.390625 | 3 | [] | no_license | #include <iostream>
using namespace std;
template <class T>
class nodo{
public:
T valor;
nodo *next;
nodo(){}
nodo(T val):valor(val){next=NULL;}
nodo(T val, nodo* siguiente):valor(val),next(siguiente){}
};
template <class T>
class lista{
private:
nodo<T> *head;
public:
lista(){head=NULL;}
l... | true |
b8e2320824c6c9c66d26000ed6584206f11ecac9 | C++ | imulan/procon | /atcoder/abc015/c.cpp | UTF-8 | 564 | 2.609375 | 3 | [] | no_license | #include <cstdio>
#include <cmath>
#include <iostream>
using namespace std;
int n, k, t[5][5];
int nums[5000];
int ct=0;
void dfs(int a, int b){
if(a==n-1)
for(int i=0; i<k; ++i) nums[ct++]=b^t[a][i];
else
for(int i=0; i<k; ++i) dfs(a+1, b^t[a][i]);
}
int main(){
scanf(" %d %d", &n, &k);
for(int i=0; ... | true |
0743f75057a12fe277ae56f3b4d1efedf81f8d89 | C++ | danilotuzita/programacao-cientifica | /Aula1/Aula1/main.cpp | UTF-8 | 5,092 | 3.234375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "Stack.hpp"
#include "Queue.hpp"
#include <time.h>
#include <stack>
#include <queue>
using namespace std;
int stackManual()
{
cout << "Teste STACK\n";
Stack<string> boolStack;
string val;
cout << "Digite um valor (0 para parar): ";
cin >> val;
while (val != "0"... | true |
d07c2c0a004f6a7b234f37708dc5e842e2f96ca2 | C++ | vglad/Reference-User-DLL | /User_DLL/Table.inl | UTF-8 | 13,440 | 2.71875 | 3 | [] | no_license | #pragma once
#include "Table.h"
inline Table::Table() = default;
inline Table::~Table() = default;
//inline std::string Table::evaluate_equity_result(const double hand_equity, const double break_even_equity) {
// std::string message;
// if (hand_equity > break_even_equity) {
// message.append(".......... | true |
db4e1904f7e4bcfb36ed30b8a702af77d14bb382 | C++ | gascensio/GordonAscensio_CIS_17a_Spring_2018 | /HomeWork/Project1401/numbers.h | UTF-8 | 835 | 2.953125 | 3 | [] | no_license | /*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: numbers.h
* Author: Gordon
*
* Created on May 1, 2018, 2:16 PM
*/
#ifndef NUMBERS_H
#define NUMB... | true |
c2b40a9f67f96902d9707c21263e8c1b85348ef6 | C++ | hyperpace/study_algo_gangnam | /CNK/codePlus_basic/day01/03_10799_main.cpp | UTF-8 | 540 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <stack>
using namespace std;
/*
쇠막대기
https://www.acmicpc.net/problem/10799
*/
int main() {
stack<int> stk;
string line;
getline(cin, line);
int cnt = 0;
for (int i = 0; i < line.size(); i++) {
if (line[i] == '(') {
stk.push(i);
} else {
if (i - stk.top() ... | true |
95541ccde3d86dc134c58afcc3aaee87e2de386e | C++ | guker/utility | /buffer/CircularBuffer.cpp | UTF-8 | 2,896 | 3.125 | 3 | [] | no_license | #include "CircularBuffer.h"
#include <cstdio> //for fopen
namespace BaseLib
{
void CircularBuffer::append(const char *data,size_t len)
{
m_circular_buffer_.insert(m_circular_buffer_.end(),data,data+len);
}
void CircularBuffer::append(const std::string &sData)
{
m_circular_buffer_.insert(m_circular_buffer_.end(... | true |
3fd5e0e91c795fdf88f87d3868be6d1728beb853 | C++ | Chen-Dixi/Leetcode | /1143-longest-common-subsequence.cpp | UTF-8 | 950 | 3.21875 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstring>
#include <utility>
#include <algorithm>
using namespace std;
class Solution {
public:
//注意问题是公共子序列
int longestCommonSubsequence(string text1, string text2) {
int len1=text1.size();
int len2=text2.size();
if(len1==0 || len2==0){
... | true |
8f54151cf652d387d89df9d66a112a40788ed3d8 | C++ | merak1t/uniq_counter | /array_checker/array_checker.cpp | UTF-8 | 2,446 | 3.375 | 3 | [] | no_license | //
// Created by damm1t on 4/30/19.
//
#include <vector>
#include <iostream>
#include <unordered_map>
#include <assert.h>
#include <algorithm>
#include "array_checker.h"
namespace {
struct item_holder {
item_holder() = default;
void add(int value) {
cnt_small[value]++;
}
... | true |
392a966465b13b3b88b7b25a3d760297e89dae4c | C++ | bmvskii/DataStructuresAndAlgorithms | /Common data structures/8/lab8_1.cpp | WINDOWS-1251 | 673 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include "integer_vector.hpp"
int main()
{
IntegerVector * pVector = new IntegerVector;
IntegerVectorInit(*pVector);
IntegerVectorReadTillZero(*pVector,std::cin);
IntegerVector v = *pVector;
int p;
std::cin >> p;
// ,
for (int i = v.m_nUsed - 1; i >= p - 1; i--) std::cout << v.m_p... | true |
bd5019d6afb44bc7f25ed76c6d4559e03a2e6d32 | C++ | nitinchaube/Algorithms-and-problems | /codingNinjas/dynamicProgramming1/coinChangeProblem.cpp | UTF-8 | 2,092 | 3.796875 | 4 | [] | no_license | /*Coin Change Problem
Send Feedback
For the given infinite supply of coins of each of denominations, D = {D0, D1, D2, D3, ...... Dn-1}. You need to figure out the total number of ways W, in which you can make the change for Value V using coins of denominations D.
Return 0 if the change isn't possible.
Input Format
The ... | true |
739de7a2afb8cdaf863e83f5b4d0d68405845d55 | C++ | jeff916121/cpluspluspractice | /2018.12.03/NoPointerClass/Complex.h | UTF-8 | 182 | 2.609375 | 3 | [] | no_license | //Complex.h
#pragma once
class Complex
{
private:
int real;
int img;
public:
Complex();
Complex(int real, int img);
Complex(const Complex &c1);
void display();
~Complex();
}; | true |
51302705e3eab3a33d4ecd5b0281799c6a740d75 | C++ | Wendelize/Derp-fix-code | /GameProject/GameProject/src/Header Files/Player.h | UTF-8 | 532 | 2.765625 | 3 | [] | no_license | #pragma once
#include "Include.h"
class Player
{
private:
string m_name;
int m_health;
int m_controllerID;
float m_weight;
float m_speed;
public:
Object* m_object;
Player();
~Player();
string GetName();
void SetName(string name);
int GetHealth();
void SetHealth(int health);
float GetS... | true |
b3bb3ee7c47a2d9aa1886b44851cb0e88eab1dcb | C++ | GabeMillikan/CSGO_INTERNAL_BASE | /QAngle.hpp | UTF-8 | 1,227 | 2.59375 | 3 | [] | no_license | #pragma once
#include <math.h>
#include "Vector.hpp"
namespace SDK
{
class QAngle
{
public:
QAngle(void);
QAngle(float X, float Y, float Z);
QAngle(const float* clr);
QAngle(Vector From, Vector To);
QAngle(Vector Offset);
void Init(float ix = 0.0f, float iy = 0.0f, float iz = 0.0f);
float operator[]... | true |
849cb636ee8feff6650b7583cbbe564177e8a0cd | C++ | idris/katamari | /Quaternion/Vector3D.cpp | UTF-8 | 5,953 | 3.53125 | 4 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | //-----------------------------------------------------------------------
// File: Vector3D.cpp
// Description: Vectors and Points in 3D
// Programmer: Dave Mount
// For: CMSC 427 - Fall 2009
//-----------------------------------------------------------------------
#include "Vector3D.h"
using namespace ... | true |
59c53fb2db22fd4a05f210145e98c618ce783612 | C++ | steptosky/XplnObj | /src/sts/geometry/templates/AxisAngle.inl | UTF-8 | 9,307 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
** Copyright(C) 2017, StepToSky
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
**
** 1.Redistributions of source code must retain the above copyright notice, this
** list of conditions and the following di... | true |
bc73e1f666acb595a01511ac25337fa22e5c66aa | C++ | kdlqudrb/Exercise | /tutorial/그래프, 산수, 수학/braveduck.cpp | UTF-8 | 1,841 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
int jump, ret;
struct point{
int x;
int y;
int color = 0;
};
point queue[200];
point nonvisit[200];
int qindexf, qindexl, nindexf, nindexl;
bool is_jump(point brave, point m){
if ((brave.x - m.x)*(brave.x - m.x) + (brave.y - m.y)*(brave.y - m.y) <= jump * jump) return 1;
else return 0;
}
void ac... | true |
25a22ecf378ced00fc5608e67e12d6d25894257c | C++ | arifkhan1990/UVa-accepted-solutions | /Uva 11364.cpp | UTF-8 | 360 | 2.546875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
while(n--){
int ma = 0, mi = 100;
int t,p;
cin >> t;
while(t--){
cin >> p;
ma = max(ma,p);
mi = min(mi,p);
}
cout << (ma * 2) - (mi ... | true |
ac1080c689f7fd0d4e3a5c51d0f5aa4cd1e784b4 | C++ | tsopronyuk/RCpp_And_Boost_Library | /findIntersectionsPolygons.cpp | UTF-8 | 5,024 | 3.21875 | 3 | [] | no_license | // // [[Rcpp::interfaces(r, cpp)]]
// // [[Rcpp::plugins("cpp11")]]
// #include <Rcpp.h>
// #include <vector>
// // put any other includes you need here.
//
// using namespace Rcpp;
// //' intersectPolygons
// //'
// //' Takes a set of 5 convex polygons from R and returns the intersection of each pair.
// /... | true |
de1bf472953fec46f129aa6ce43af721d79ca029 | C++ | Naoki95957/CPPCS300 | /graph_traversal/Stack.h | UTF-8 | 1,354 | 3.4375 | 3 | [] | no_license | //============================================================================
// Name : StachADT.h
// Author : Fatma C Serce
// Version : 1.0
// Description : Stack Abstract Data Type
//============================================================================
#ifndef STACK_ADT
#define STACK_ADT
te... | true |
4c04370c1d3e1470ab2ddd079e51c6409f5c96fd | C++ | davi97zi/ProgettoPAO | /Interfacce/magicInterface.cpp | UTF-8 | 1,179 | 2.96875 | 3 | [] | no_license | #include "magicInterface.h"
//usato da increaselevel
void MagicInterface::increaseMaxMana(unsigned int addVal){
maxMana = addVal;
}
unsigned int MagicInterface::getMaxMana() const {return maxMana;}
unsigned int MagicInterface::getMana() const {return mana;}
bool MagicInterface::isThrowable(unsigned int m) const... | true |
3c9e674e0844b7208399b842e6ee547566781383 | C++ | marco-park/problemSolving | /PROGRAMERS/여행경로.cpp | UTF-8 | 898 | 2.703125 | 3 | [] | no_license | #include <string>
#include <vector>
#include <iostream>
#include <map>
using namespace std;
map<pair<string,string>,int>visited;
vector<string> answer;
int ticketSize;
bool foo(string now,map<string,vector<string>>&p){
if(answer.size() == ticketSize+1)return true;
for(auto next:p[now]){
if(!visited[{... | true |
e5ff6ae8d41eef8c0bc18e8a2e28eccd1633e682 | C++ | Awaluda/Testing | /main.cpp | UTF-8 | 2,921 | 3.046875 | 3 | [] | no_license | /*muhammad iqbal awaluda
*20.if 02
* 20.11.3418
* gak selesai buk,mumet,masih nub:(,stelah ngikutin yg di jurnal,saya coba ngerjain fungsi malah gk selesai
*/
#include <iostream>
using namespace std;
int main()
{
string nama[100];
string mk[100];
int jmlmk;
char nilaihuruf[100];
int nilai;
int sks[100];
int jml... | true |
93a8e5d64b71a844e6a581578c2d7da6ddbd4e88 | C++ | unionyy/samsung-algorithm-21 | /bp-greedy-dp/basic-problems/room/main.cpp | UTF-8 | 912 | 2.96875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(int argc, char** argv)
{
int test_case;
int T;
freopen("input.txt", "r", stdin);
cin>>T;
int road[200];
for(test_case = 1; test_case <= T; ++test_case)
{
for(int i = 0; i < 200; i++) road[i] = 0;
int N;
cin >> N;
for(int i ... | true |
0153f7af97d99409d9237f35b62f63078a94e9a1 | C++ | Kanto065/AIUB_CS | /Courses/Data Structures/Linked list/singly.cpp | UTF-8 | 4,441 | 4.0625 | 4 | [] | no_license | //singly linked list
#include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
//node insert at end
void insert(node *s, int data){
while(s->next != NULL){
s = s->next;
}
s->next = new node();
s->next->data = data;
s->next->next = NULL;
}
//node insert at beginni... | true |
a2d83c03088b9562680721b0b01c259eaaceea6d | C++ | samcragg/Autocrat | /tests/Bootstrap.Tests/tests/ReferenceScannerTests.cpp | UTF-8 | 5,028 | 3.265625 | 3 | [
"MIT"
] | permissive | #include "managed_interop.h"
#include <algorithm>
#include <array>
#include <unordered_map>
#include <gtest/gtest.h>
#include "ManagedObjects.h"
struct ObjectCounter : autocrat::detail::reference_scanner
{
std::optional<void*> get_moved_location(void* object) override
{
auto it = moved_objects.find(ob... | true |
0ee07037147c23ce990e5010c7030427e1cbf7a5 | C++ | nyccowgirl/Starting-Out | /C10/C10_10/C10_10.cpp | UTF-8 | 532 | 3.25 | 3 | [] | no_license | /*
Program illustrates C-strings.
C10_10.cpp
Starting Out/C10
Created by nyccowgirl on 10/6/20.
Copyright © 2020 nyccowgirl. All rights reserved.
*/
#include <iostream>
#include <cstring>
using namespace std;
int main(int argc, const char * argv[]) {
char place[] = "The Windy City";
if (strst... | true |
d37ac18a462f5be05b6834c0fc9876925418d47d | C++ | gvaxx/CPP | /04/ex03/Character.cpp | UTF-8 | 1,714 | 3.171875 | 3 | [] | no_license | #include "Character.hpp"
Character::Character(std::string const &name):
_name(name), _count(0)
{
for (int i = 0; i < 4; i++)
this->_materia[i] = NULL;
}
Character::Character(Character const &src):
_name(src._name), _count(0)
{
for (int i = 0; i < src._count; i++)
if(src._materia[i])
this->equip(sr... | true |
3f6a731a7d87f1f7a107ed07e37b9982fd338e56 | C++ | shinyawhy/Graphical-SoC-Performance | /graphic/graphicarea.cpp | UTF-8 | 1,769 | 2.71875 | 3 | [] | no_license | /*
* @Author: MRXY001
* @Date: 2019-11-29 14:46:24
* @LastEditors: MRXY001
* @LastEditTime: 2019-11-29 18:04:20
* @Description: 添加图形元素并且连接的区域
* 即实现电路图的绘图/运行区域
*/
#include "graphicarea.h"
GraphicArea::GraphicArea(QWidget *parent) : QWidget(parent)
{
setAcceptDrops(true);
}
/**
* 添加一个形状
* 注意:添加这一类型的形状,而不是添... | true |
216b34af9256a749228c707ba40fdd3cf4b73796 | C++ | visit-dav/visit | /src/visit_vtk/full/vtkAccessors.h | UTF-8 | 10,290 | 2.5625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers. See the top-level LICENSE file for dates and other
// details. No copyright assignment is required to contribute to VisIt.
#ifndef VTK_ACCESSORS_H
#define VTK_ACCESSORS_H
#include <vtkType.h>
#include <vtkPoints.h>
#in... | true |
54a4979c2aa00f240dded51d4411e04bcb7d3f4a | C++ | severinglion/School-Projects | /GameProgrammingA1/src/Utilities/EngineMath.cpp | UTF-8 | 190 | 2.59375 | 3 | [] | no_license | #include "EngineMath.h"
double distance2d(int x1, int y1, int x2, int y2)
{
int diffx = x2 - x1;
int diffy = y2 - y1;
return sqrt((double) (diffx * diffx) + (diffy * diffy));
} | true |
b4003e749309baad947f9653ee91dd99b6d6684b | C++ | ash-maheriya/mlp-multiclass | /apps/train_model_main.cc | UTF-8 | 1,148 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <ostream>
#include "core/network.h"
using neural_net::Network;
int main(int argc, char** argv) {
Network network(28);
std::string img_dir = "/home/ash/UIUC/CS126/Cinder/my_projects/final-project-ash-maheriya/mnist/train/img/";
std::string lbl_dir = "/home/ash/UIUC/CS126/Cinder/my... | true |
ce1410063c149e62c748f9dfea053be99a6c5a30 | C++ | gs0622/leetcode | /missingNumbers.2.cc | UTF-8 | 477 | 3.390625 | 3 | [] | no_license | /*https://leetcode.com/problems/missing-number/description/*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int missingNumber(vector<int>& nums) {
int sum1 = accumulate(nums.begin(), nums.end(), 0);
int sum2 = (nums.size()+0)*(nums.size()+1)/2;
return sum2-sum1;
}
};
int main(){
Soluti... | true |
22ddd339fac2a6b63793a678156f64699f665a16 | C++ | yusufRahmatullah/apaan | /m3dmap.cpp | UTF-8 | 3,993 | 2.703125 | 3 | [] | no_license | #include "FrameBuffer.h"
#include "Polygon.h"
#include "header.h"
#include "Keyboard.h"
Polygon vsumatra, vjawa, vkalimantan, vsulawesi, vpapua;
Polygon vsumatra2, vjawa2, vkalimantan2, vsulawesi2, vpapua2;
void handleInput(){
if(Keyboard::isKeyPressed()){
int move = 20;
if(Keyboard::getKeyCode() == 'w'){
vsu... | true |
8e16213c0e1dc7a4b9381542b7ea18653c2d3f4f | C++ | jyk2244/project1 | /project1/resource.cpp | UTF-8 | 1,260 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
//#include <boost/lexical_cast.hpp>
#include "resource.h"
#include "member.h"
using namespace std;
resource::resource(){
}
resource::resource(string t, string n){
name = n;
type = t;
ret = 1;
}
string resource::show_name(){
return name;
}... | true |
8993ba3c63b39163c16bfa458ae64e0a1f2f2740 | C++ | CristianERAU/PSP | /component.hpp | UTF-8 | 1,824 | 2.78125 | 3 | [] | no_license | ///////////////////////////////
// CS225 Spring 2016 //////////
// Cristian Garcia ////////////
///////////////////////////////
///////////////////////////////
#ifndef PA3COMPONENT_HPP_
#define PA3COMPONENT_HPP_
// Include Directives /////////
#include <iostream>
#include <string>
using std::ostream;
// Decleration S... | true |
125ab9d5e3feb529d7d9cfc60c75315d1880bf40 | C++ | jye210/OSS-1 | /99dan.cpp | UTF-8 | 246 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int dan;
for(int dan = 2; dan < 10; dan++)
for (int i = 1; i < 10; i++)
{
cout << dan << " * " << i << " = " << dan * i << endl;
}
return 0;
}
| true |
73af4a69ffec0ceaf4ef3a1b5e8d8d5ad0c1a00c | C++ | ssw1991/FE-Applications | /FELibraries/Roots/NewtonMethodMod.cpp | UTF-8 | 930 | 3.4375 | 3 | [] | no_license | /*
Author Shilo Wilson
Implementation of Newtons Method without directly passing derivative
*/
#include <functional>
#include "NewtonMod.hpp"
NewtonMethodMod::NewtonMethodMod(std::function<double(double)> &f, double tol) : m_function(f), m_tol(tol)
{};
NewtonMethodMod::NewtonMethodMod(const NewtonMethodMod &p): ... | true |
d26615f784ac1222fefadec1df214118a64c9a87 | C++ | familymrfan/fanfei | /dp/Mediator/mediator.cpp | UTF-8 | 1,645 | 3.375 | 3 | [] | no_license | #include "stdio.h"
class Colleage;
class Mediator
{
public:
virtual void Send(char* msg, Colleage* colleage) = 0;
};
class Colleage
{
public:
Colleage(Mediator* mediator):mediator_(mediator) {
}
virtual void Send(char* msg) = 0;
protected:
Mediator* mediator_;
};
class ConcreteColleageA : public... | true |
e12e46879c0cb1fdf4bb482ce7e714fb23ad70eb | C++ | PhamKhoa96/DataStructure_Algorithm | /OOP/C-Tutorial-master/Bai11.cpp | UTF-8 | 759 | 3.84375 | 4 | [] | no_license | /* Cấu trúc rẽ nhánh trong C++
if(điều kiện){
// Nội dung thực hiện nếu đk đúng
} else {
// Nội dung thực hiện nếu điều kiện sai
}
Sinh viên A có điểm trung bình môn là t, điểm để qua môn đó là 4.0
Viết chương trình kiểm tra xem anh A có qua môn hay không.
*/
#include <iostream>
using namespace std;
#define... | true |
f624cd64d644fa73f86c026b1be28ed40356f448 | C++ | evenleo/leo | /test/HttpServer_test.cpp | UTF-8 | 845 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "http/HttpConnection.h"
#include "TcpServer.h"
#include "Scheduler.h"
#include "Log.h"
#include <stdio.h>
using namespace leo;
using namespace leo::http;
int main() {
Singleton<Logger>::getInstance()->addAppender("console", LogAppender::ptr(new ConsoleAppender()));
Scheduler scheduler;
scheduler.startAs... | true |
e2241d1ed3b86e6dda2577cb0ead34931aff376b | C++ | zouxiaoliang/redox | /src/cluster.cpp | UTF-8 | 12,492 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | #include "cluster.hpp"
#include <string.h>
redox::cluster::Cluster::Cluster(std::ostream &log_stream, redox::log::Level log_level):
m_logger(log_stream, log_level),
m_log_stream(log_stream),
m_log_level(log_level),
m_connection_callback(nullptr)
{
// do nothing
}
redox::cluster::Cluster::~Cluster... | true |
54ddf14cc80b26811ea8b6293cb88b69bf1b2a5d | C++ | alexandraback/datacollection | /solutions_5631572862566400_1/C++/Sharph/codejam_2016_1a_c.cpp | UTF-8 | 1,059 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <deque>
#include <cassert>
#include <vector>
#include <map>
#include <tuple>
using namespace std;
int F[1024];
int idx[1024];
tuple<int, int, int, int> xd(int v) {
fill(idx, idx + 1024, -1);
int i = 0;
while(idx[v] == -1) {
idx[v] = i++;
v = F[v];
}
int m = 1024;
int s = v;
do... | true |
1f67055f794640391ad901b455ac1c0e578a5498 | C++ | Goodii/Graphics | /aieBootstrap-master/Graphics/MyApplication.h | UTF-8 | 606 | 2.5625 | 3 | [
"MIT"
] | permissive | #pragma once
#include <glm/glm.hpp>
#include <glm/ext.hpp>
struct GLFWindow;
class MyApplication
{
public:
MyApplication();
virtual ~MyApplication();
void run(const char* title, int width, int height, bool fullscreen);
virtual bool startup() = 0;
virtual void update(float deltaTime) = 0;
virtual void draw() =... | true |
0c9c8345a10a0df01b54414f4657053e5e7bbf51 | C++ | HaoLiSky/EON | /client/potentials/Water/potential_base.cpp | UTF-8 | 23,840 | 2.890625 | 3 | [] | no_license | /** @file
Basic tools to write potentials.
@author Jean-Claude C. Berthet
@date 2006-2008
University of Iceland
*/
#include <cmath>
#include <iostream>
#include <cassert>
#include <cstdlib>
#include "potential_base.hpp"
/** @class forcefields::PotentialBase
@brief Functions and tools commonly used by potentials.
Cont... | true |
2c2f951d331bffacb451b748626e1a2bd7c56a7f | C++ | Aleksey-Devyataikin/libbitmap | /libbitmap.h | UTF-8 | 778 | 3.09375 | 3 | [] | no_license | #ifndef ___LIB_BITMAP_H___
#define ___LIB_BITMAP_H___
#include <cstdint>
#include <string>
class Bitmap
{
public:
uint8_t * m_buffer;
size_t m_width, m_height;
public:
Bitmap(void) : m_buffer(nullptr), m_width(0), m_height(0)
{}
virtual ~Bitmap(void)
{
clear();
}
public:
bool load(const char * file_nam... | true |
874b3ae14f0a0fc72ce850d2b38d28a0c365dfaa | C++ | tg9963/CPP_files | /C and C++/SORTING/matrix_chain_multi.cpp | UTF-8 | 563 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<stdlib.h>
using namespace std;
void MCM(int p[],int n)
{
int c[n][n],s[n][n];
for(int i=1;i<n;i++)
{
c[i][i]=0;
}
for(int l=2;l<n;l++)
{
for(int i=1;i<n-l;i++)
{
int j=i+l;
for(int k=i;k<j-1;k++)
{
int q=c[i][k]+c[k+1][j]+p[i-1]*p[k]*p[j];
if(q<c[i][j])
{
... | true |
8291c836553236207b92d99bc77f6057d94eaba9 | C++ | sguzmanm/sshpc | /code_handson/exercise_2/write_to_file.cpp | UTF-8 | 491 | 3.84375 | 4 | [
"MIT"
] | permissive | /*
* Write a function "prime" that recieves an integer "n" and
* writes all the prime numbers which are < n to a file
* called "prime_numbers.txt"
*/
#include <stdio.h>
using namespace std;
/*
* Write the prototype of the function
*/
int main(){
int n = 1000;
prime(n);
return 0;
}
/*
* Write the i... | true |
24d1bfddda3dc9b47b84406eed60ee09668798d8 | C++ | devlipe/INF110 | /5Aula/zica.cpp | UTF-8 | 413 | 3.390625 | 3 | [] | no_license | /* Programa para calcular o tempo ate a populacao de mosquitos chegar a 1 000 000
Felipe P Ferreira
02/10/2020
*/
#include <iostream>
using namespace std;
int main(void)
{
long long int P = 0, G = 0, pop = 0, tempo = 0;
cin >> P >> G;
while (pop < 1000000000)
{
pop = (... | true |
321f168d2d4b25765fe066b731aae5d84813f318 | C++ | Legend-sky/vscode | /Tempter_of_the_Bone.cpp | UTF-8 | 1,716 | 2.75 | 3 | [] | no_license | /*
* @Author: Whx
* @Date: 2020-11-25 16:01:20
* @LastEditTime: 2020-11-25 16:35:39
*/
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int n, m, t, sx, sy, ex, ey;
bool f;
int dir[4][2] = {0, -1, -1, 0, 0, 1, 1, 0};
int vis[10][10];
char maze[10][10];
void dfs(int x, int y, int time... | true |
5160e11b75a275b0891507f95b818bf690a9300c | C++ | WhiZTiM/coliru | /Archive/017395f447e2650549f16fdc5219e234-f674c1a6d04c632b71a62362c0ccfc51/main.cpp | UTF-8 | 1,911 | 3.40625 | 3 | [] | no_license | #include <array>
#include <iostream>
#include <stdexcept>
#include <string>
#include <memory>
#include <type_traits>
//
// Get index of T in Args
//
template<typename T, typename ...Args>
struct GetIndex;
template<typename T, typename ...Args>
struct GetIndex<T, T, Args...>
{
enum { value = 0 };
};
template<typ... | true |
c87619844478d820781ff04b75c76ee4cabc9159 | C++ | AntisocialButterfly/algo-cpp | /flapjacks-120/main.cpp | UTF-8 | 1,036 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
using namespace std;
void flip(vector<int>& v, size_t n, bool& first) {
reverse(v.begin() + n, v.end());
if (!first) cout << " ";
cout << n;
first = false;
}
int main(int argc, const char * argv[]) {
string line;
while (getline... | true |
2855307dfe22719d25c6929800304ad7a8e46b2e | C++ | idokka/ukrnet-test | /src/memcached/memcached.hpp | UTF-8 | 3,298 | 2.703125 | 3 | [] | no_license | #pragma once
#include <map>
#include <deque>
#include <mutex>
#include <memory>
#include "../include/server.hpp"
#include "../include/client.hpp"
#include "../include/factory.hpp"
#include "../include/sighandler.hpp"
namespace ukrnet
{
// test MemCached server
class MemCached
{
public:
// server command
enum ... | true |
18281f11939db1ebd57d0d60e86501d767874ee1 | C++ | ma1371sao/Leetcode-CPP | /LC581.cpp | UTF-8 | 385 | 3 | 3 | [] | no_license | class Solution {
public:
int findUnsortedSubarray(vector<int>& nums) {
vector<int> sorted = nums;
sort(sorted.begin(), sorted.end());
int start = 0;
for (; start < nums.size() && sorted[start] == nums[start]; start++);
int end = nums.size() - 1;
for (; end >= 0 && nums[end] == sorted[end]; end--);
... | true |
752a94304533e60acbd26fafa9991b805ca95f19 | C++ | programmerQI/CSCI2270 | /hw7/main.cpp | UTF-8 | 1,262 | 3.65625 | 4 | [] | no_license | #include "MovieTree.cpp"
#include <iostream>
using namespace std;
void printMenu()
{
cout << "======Main Menu======" << endl;
cout << "1. Print the inventory" << endl;
cout << "2. Delete a movie" << endl;
cout << "3. Quit" << endl;
}
int readFile(std::string filename, MovieTree& t)
{
std::ifstream ... | true |
f73c615d81fce085017f6320f7f28effa87ba22f | C++ | sunmike2002/MCF | /Unconverted/EventHandlerClass.cpp | GB18030 | 2,981 | 2.546875 | 3 | [] | no_license | // ļ MCF һ֡
// йؾȨ˵ MCFLicense.txt
// Copyleft 2012 - 2013. LH_Mouse. All wrongs reserved.
#include "StdMCF.hpp"
#include "EventHandlerClass.hpp"
#include "Memory.hpp"
using namespace MCF;
// 캯
EventHandlerClass::EventHandlerClass(ReadWriteLock *prwlExternalLock) :
xm_prwlExternalLock(prwlExternalLock)
{
}
EventHand... | true |
484de374f12347042bf78566420f6e9c0f2e5f32 | C++ | westerly/fps | /jeu/arme.cpp | ISO-8859-1 | 4,913 | 2.859375 | 3 | [] | no_license | #include "arme.h"
arme::arme(std::string fichierTexture)
{
this->fichierTextureCouranteDisplayed = fichierTexture;
this->ajouterTexture(this->fichierTextureCouranteDisplayed);
}
// Constructeur qui charge la fois le fichier de texture reprsentant l'arme mais aussi les textures
// permettant d'afficher l'animatio... | true |
aad05e980e50d8d5488d15b87cf2248085134fc5 | C++ | Ionsto/Hunt | /NeuralBrain.h | UTF-8 | 3,780 | 2.828125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <fstream>
#include <string>
#include "math.h"
#include <functional>
#include "NeuralNet.h"
#include <vector>
template
<int Inputs, int Nodes>
class NeuralBrain : public NeuralNet {
public:
std::vector<float> Outputs;
int ActivationFunction = 0;
static constexpr int Stride ... | true |
01ea10dd8206dc4d30df9c69740e5f44a565f693 | C++ | hawkproject/hawkproject | /HawkUtil/HawkFolder.h | GB18030 | 2,247 | 2.859375 | 3 | [] | no_license | #ifndef HAWK_FOLDER_H
#define HAWK_FOLDER_H
#include "HawkRefCounter.h"
#include "HawkXmlFile.h"
namespace Hawk
{
/************************************************************************/
/* ϵͳļв */
/************************************************************... | true |
d2ade41fa60fd9697970fa784e0f682123f863eb | C++ | qingshuidoufu/data_structure | /单链表/单链表_综合运用.cpp | GB18030 | 9,394 | 3.71875 | 4 | [] | no_license | /* Ҫݣ
1>
2>ӷ
3>ԭ
4>鲢
5>ɾظԪ
6>ͷڵ㵥Ƿ ཻཻأ-12345
ƬΡ */
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#define MaxSize 100
typedef int ElemType;
typedef struct SingleNode {
ElemType data;
struct SingleNode* next;
}SingleNodeList, * Linklist;
void LinkedListInit(SingleNodeList** head) {//1ʼͷڵĵ
Lin... | true |
d60109c8130164dc9931c30b949a3ebfb2d7584f | C++ | tf2keras/image-computer-processing | /icpl/brightness_mapings.cpp | UTF-8 | 7,097 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <opencv2/opencv.hpp>
#include <icpl/brightness_mapings.h>
#include <icpl/utils.h>
namespace icpl {
std::vector<uchar> build_LUT(const std::function<uchar(uchar)> &func) {
std::vector<uchar> LUT(256);
for (auto i = 0; i < 256; i++) {
LUT[i] = func(i);
}
return LUT;... | true |
ef2a3552ada24b6417f525300c692c474114d6ba | C++ | Kiritow/OJ-Problems-Source | /POJ/3040_hankcs.cpp | UTF-8 | 2,201 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <functional>
#include <algorithm>
#include <limits>
using namespace std;
typedef pair<int, int> Coin; // 硬币 面值和数量
Coin coin[20];
int need[20];
///////////////////////////SubMain//////////////////////////////////
int main(int argc, char *argv[])
{
#ifndef ONLINE_JUDGE
freopen("in.txt... | true |
33d0b1359cbb149f8397ab68fa281c493714ff1a | C++ | Kodiey/CS2A | /assignment_9/fraction.cpp | UTF-8 | 4,695 | 3.890625 | 4 | [] | no_license | /*
CS 2A
Professor Harden
7/30/2018
fraction.cpp
This is an implementation file of the Fraction class. All the methods and
members of this class are in fraction.h. The purpose of this program is to
compute fractions (+, -, *, /).
*/
#include <iostream>
#include "fraction.h"
using namespace std;
// This is the Fr... | true |
86fc56eddb3aa166ec981cc7726825cce0473e36 | C++ | dariusjlukas/ENES100 | /NavSimSimple/Enes100Libraryexamples/Debris.ino | UTF-8 | 990 | 2.75 | 3 | [
"MIT"
] | permissive | #include "Enes100.h"
void setup() {
// Initialize Enes100 library
// Team Name, Mission Type, Marker ID, RX Pin, TX Pin
Enes100.begin("Duhbree", DEBRIS, 3, 8, 9);
Enes100.print("Destination is at (");
Enes100.print(Enes100.destination.x);
Enes100.print(", ");
Enes100.print(Enes100.destinat... | true |
5be549972f424997a4652c9b1e036fe7024f116b | C++ | wtrnash/LeetCode | /cpp/210课程表 II/210课程表 II.cpp | UTF-8 | 3,023 | 3.8125 | 4 | [] | no_license | /*
现在你总共有 n 门课需要选,记为 0 到 n-1。
在选修某些课程之前需要一些先修课程。 例如,想要学习课程 0 ,你需要先完成课程 1 ,我们用一个匹配来表示他们: [0,1]
给定课程总量以及它们的先决条件,返回你为了学完所有课程所安排的学习顺序。
可能会有多个正确的顺序,你只要返回一种就可以了。如果不可能完成所有课程,返回一个空数组。
示例 1:
输入: 2, [[1,0]]
输出: [0,1]
解释: 总共有 2 门课程。要学习课程 1,你需要先完成课程 0。因此,正确的课程顺序为 [0,1] 。
示例 2:
输入: 4, [[1,0],[2,0],[3,1],[3,2]]
输出: [0,1,2,3] ... | true |