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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8b4be9ee9a84f403019a49d43935c8c93744f290 | C++ | DukeLaze/kattis | /pot/app.cpp | UTF-8 | 325 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
int main(){
int n;
std::cin >> n;
unsigned long sum = 0;
for(int i = 0; i < n; i++){
int mangled;
std::cin >> mangled;
//remove last digit, use last digit
sum += std::pow(mangled/10, mangled%10);
}
std::cout << sum << std::en... | true |
b4ced84b700e6f4668d2ead5fa774a0af0a53d90 | C++ | silent-silence/CodeRefactor | /Errors/TypeError.hpp | UTF-8 | 565 | 2.953125 | 3 | [] | no_license | //
// Created by 17271 on 2019/5/25.
//
#ifndef CODEREFACTOR_TYPEERROR_H
#define CODEREFACTOR_TYPEERROR_H
#include <string>
#include <exception>
/// @brief Throw this while type specifiers are illegal
class TypeError : public std::exception {
public:
explicit TypeError(const char *error)
: m_msg{error}
{}
expl... | true |
ef690397c82c4e456ddd771fc800fa44417af98a | C++ | Taxiway/TC_Codes | /QuadraticLaw.cpp | WINDOWS-1252 | 4,447 | 3.28125 | 3 | [] | no_license | // Orz AekdyCoin 侰
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <sstream>
#include <functional>
#include <cctype>
#include <string>
using namespace std;
#define all(X) (X).be... | true |
901c58056e09473226655f94af4e95ed7a9373d0 | C++ | MasterLeen/cpp- | /C++String类实现/MyString.h | GB18030 | 674 | 2.96875 | 3 | [] | no_license | #ifndef MYSTRING_H
#define MYSTRING_H
#include <string.h>//cԵstring
#include <iostream>
class MyString {
public:
MyString(const char* str = NULL);
MyString(const MyString& rhs);
MyString& operator = (const MyString& rhs);
MyString& operator = (MyString&& str) noexcept;
MyString(MyString&& str)noexcept;//ƶ캯
~MyStr... | true |
7e4476f428b2d4017b865a4382f601b73af1c011 | C++ | Cyberpatinho/OBI | /Soluções/Jogo de Tabuleiro.cpp | UTF-8 | 1,047 | 2.640625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
int mat[105][105];
int main(){
ios_base::sync_with_stdio(0);
int n; cin >>n;
for(int i = 1; i<=n; i++){
for(int j = 1; j<=n; j++){
cin >>mat[i][j];
}
}
int arr[2];
for(int i = 2; i<=n; i++){
a... | true |
cc58f5993c18cf47b4dc3d16e7ba1598a4da47e7 | C++ | gvma/Computer-Graphics | /cube/cube.h | UTF-8 | 5,128 | 3.25 | 3 | [] | no_license | #include <time.h>
#include <string>
using namespace std;
// 0 - face, 1 - top, 2 - back, 3 - down, 4 - left, 5 - right
const double colorMap[6][3] = {{1, 1, 1}, {0, 0, 1}, {1, 241 / 255.0, 25 / 255.0}, {0, 1, 0}, {253 / 255.0, 126 / 255.0, 0}, {1, 0, 0}};
const int n = 3; const int cycleSize = 2*n + 2*(n - 2);
struct C... | true |
4365ea855839f01e6dfee313a986ef60065e903b | C++ | abdalimran/Online_Judge_Solutions | /URI Solutions/1020.cpp | UTF-8 | 295 | 2.640625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int ind,y,m,d;
cin>>ind;
y=ind/365;
ind=(ind%365);
m=ind/30;
ind=(ind%30);
d=ind;
cout<<y<<" ano(s)"<<endl;
cout<<m<<" mes(es)"<<endl;
cout<<d<<" dia(s)"<<endl;
return 0;
}
| true |
981f814a1c43c569243346569687fb5b960980bc | C++ | ldcduc/leetcode-training | /cpp/find-the-difference.cpp | UTF-8 | 412 | 2.984375 | 3 | [] | no_license | /* Problem url: https://leetcode.com/problems/find-the-difference
* Code by: ldcduc
* */
class Solution {
public:
char findTheDifference(string s, string t) {
char result = 0;
for (auto c : s) {
result -= c;
}
for (auto c : t) {
result += c;
}
... | true |
2005e54baf8b69ce939a59c817185fabc43cca19 | C++ | Alankvuong/A12-DFS_and_BFS_directed_edges | /main.cpp | UTF-8 | 4,446 | 3.34375 | 3 | [] | no_license | /***************************************************
* Programmed by : Ethan Bockler, Tim Diersing, *
* Alan Vuong *
* Assignment : A11 : DFS and BFS *
* *
* This program will demonstrate a depth - first *
* and breadth - first search of a directed g... | true |
24b06c93e3795f40244948b11d6d73cbfe1b1ff0 | C++ | fsilvestrim/saliency_map | /src/main.cpp | UTF-8 | 10,290 | 2.65625 | 3 | [] | no_license | #include "OrientedPyr.h"
#include "argparse.hpp"
#include "fusion_methods.hpp"
#include "boost/filesystem.hpp"
#include "boost/regex.hpp"
//#define VISUAL
//#define SHOW_FINAL
//#define SHOW_ORIENTATION
struct hyperparams {
int num_layers = 4;
int center_sigma = 2;
int surround_sigma = 5;
int orienta... | true |
c26408637e29477b10b92fc88720ed241822a223 | C++ | zjnu-acm/judge | /judge-site/src/test/resources/sample/program/re/1002.cpp | UTF-8 | 246 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #include<stdio.h>
int main() {
char c1, c2, c3, c4, c5;
c1 = 'C', c2 = 'h', c3 = 'i', c4 = 'n', c5 = 'a';
c1 = c1 + 4, c2 = c2 + 4, c3 = c3 + 4, c4 = c4 + 4, c5 = c5 + 4;
printf("%s%s%s%s%s", c1, c2, c3, c4, c5);
return 0;
}
| true |
fb4606a5f5b18d2e510681794fb56d47bc67b7ec | C++ | samratnagarjuna/CodeSamples | /C++/Robo Kabaddi Game/Game/Libraries/Agents/Agent/agent.cpp | UTF-8 | 2,168 | 2.9375 | 3 | [] | no_license | //
// agent.cpp
// XbeeInterface
//
// Created by Samrat Nagarjuna Pasila on 12/09/14.
// Copyright (c) 2014 Samrat Nagarjuna Pasila. All rights reserved.
//
#include "agent.h"
#include <iostream>
#include <stdlib.h>
Agent::Agent() {
init();
}
Agent::Agent(int x,int y) {
init();
pos = new Pos2d(x,y);... | true |
1508d3a24a0ddd715d5c6fd3e1c9de122dc0ae6f | C++ | amendy/UrlaubOsnabrueck | /UrlaubOsnabrueck/Graph.cpp | UTF-8 | 6,806 | 3.359375 | 3 | [] | no_license | #include "Graph.h"
#include <list>
#include <fstream>
#include <algorithm>
#include <limits>
#include <map>
//---------------------------------------------------------------------------------------------------------------------
Graph::~Graph()
{
for (std::list<Edge*>::iterator it = m_edges.begin(); it != m_edges.en... | true |
da9511551e8ec3bc645e9ac768e591e5baa1fcf8 | C++ | mava4233/Pac-Man-Example | /Arkanoid/Map.h | UTF-8 | 599 | 2.640625 | 3 | [] | no_license | // Map.h
#pragma once
#include "State.h"
#include "Collider.h"
class Tile;
class Pellet;
class Map
{
public:
Map(System& system);
~Map();
Collider* GetWallCol();
Collider* GetPelletCol();
std::vector<Tile*> GetTileList(){ return TileList; };
std::vector<Pellet*> GetPelletList() { return PelletList; };
priv... | true |
af730f825c9ddae806d3eebf9938e30652cd76ef | C++ | sopyer/Shadowgrounds | /ui/AmbientSoundManager.h | UTF-8 | 1,208 | 2.53125 | 3 | [] | no_license | #ifndef AMBIENT_SOUND_MANAGER_H
#define AMBIENT_SOUND_MANAGER_H
namespace sfx {
class SoundLooper;
} // sfx
namespace game
{
class GameUI;
}
namespace ui
{
struct AmbientSoundManagerData;
class AmbientSoundManager
{
public:
AmbientSoundManager(game::GameUI* gameUI_, sfx::SoundLooper* looper_);
virt... | true |
ce055ac1b9e33157dc9fa0489f4669b8f8214f4b | C++ | winash12/VPTree | /purec++/Test.cpp | UTF-8 | 2,380 | 3.25 | 3 | [] | no_license | // Example of using the GeographicLib::NearestNeighbor class. Read lon/lat
// points for coast from coast.txt and lon/lat for vessels from vessels.txt.
// For each vessel, print to standard output: the index for the closest point
// on coast and the distance to it.
// This requires GeographicLib version 1.47 or later... | true |
e16583353b4154861359044e6ed2fd9a8325326d | C++ | cmf41013/Algorithms | /Graph/Shortest-path Algorithms/Bellman Ford/main.cpp | UTF-8 | 982 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include "WeightedSparseGraph.h"
#include "ReadWeightedGraph.h"
#include "BellmanFord.h"
using namespace std;
// 测试Bellman-Ford算法
int main() {
string filename = "test.txt";
int V = 5;
// 有向图
WeightedSparseGraph<int> g = WeightedSparseGraph<int>(V, true);
ReadWeightedGraph<Wei... | true |
76d9781fa66149f8a0b08f4b33e8e6c37f72e9be | C++ | dtdsouza/URI | /1006.cpp | UTF-8 | 314 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <locale.h>
#include <iomanip>
using namespace std;
int main()
{
setlocale(LC_ALL,"Portuguese");
double A,B,C,MEDIA;
cin >> A >> B >> C;
MEDIA = (A*2/10) + (B*3/10) + (C*5/10);
cout << "MEDIA = " <<fixed<<setprecision(1)<<MEDIA<<endl;
cin.get();
return 0;
}
| true |
cc8c05f2b75e58e61ff9f130a672a59910ce6c02 | C++ | ArgentumHeart/mipt-1st-term | /sem02/010.cpp | UTF-8 | 554 | 3.515625 | 4 | [] | no_license | #include <iostream>
using namespace std;
char unleveling(char c);
char get_a_letter();
//-------------------------------------------------------------
char get_a_letter() {
char input;
do {
cin >> input;
} while ( !(((input >= 'a') && (input <= 'z')) || ((input >= 'A') && (input <= 'Z'))));
r... | true |
2cac3fb6d0bb82caba65f71d79ccd1e257b63df9 | C++ | sheldak/IntroductionToComputerScience | /Agnieszka/6_1_2.cpp | UTF-8 | 465 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
const int N = 6;
bool odwaz(int t[N], int masa, int frst=0){
if(frst==N){
return false;
}
for(int i=frst;i<N;i++){
if(masa-t[i]==0) return true; // masa zostala osiagnieta
if(masa-t[i]<0)
continue; // odwaznik za duzy
... | true |
3b6832c77a72746012dd05d667985449c83357c0 | C++ | bhankey/webserver | /RequestHandler/Envp.cpp | UTF-8 | 1,673 | 2.9375 | 3 | [] | no_license | //
// Created by sergey on 22.03.2021.
//
#include "../includes/Envp.hpp"
Envp::Envp(char **_envp) {
for (int i = 0; _envp[i] != NULL; i++) {
envp.push_back(splitNameVal(_envp[i]));
}
}
Envp::Envp(const Envp &environment): envp(environment.envp) {
}
Envp &Envp::operator=(const Envp &environment) {
if (this ... | true |
6be1a3158a5bd38868d706d83757bfee7701183b | C++ | suumquique/obfuscator | /config.cpp | UTF-8 | 2,594 | 3.21875 | 3 | [] | no_license | #include "main.hpp"
BOOL getCurrentFlagValue(wstring fullString) {
// Конец строки, показывающий, что значение флага установлено как true
wstring endings[] = { L"=true", L"=1" };
// Проходим все строки из массива endings
for (wstring ending : endings) {
// Каждую строку сравниваем с концом полной строки конфиг... | true |
fea90bc40ea874762b963f2dfaa90f22654ff4e9 | C++ | adechan/School | /Undergrad/First Year/Programming in C/Elementary Algorithms/nFactorial.cpp | UTF-8 | 313 | 3.4375 | 3 | [] | no_license | // It displays the factorial of a n number.
#include "stadfx.h"
include <iostream>
int factorialNumber(int n)
{
if (n == 0 || n == 1) return 1;
else
return n * factorialNumber(n - 1);
}
int main()
{
int n;
std::cout << "Spune un numar: ";
std::cin >> n;
std::cout << factorialNumber(n);
return 0;
}
| true |
c1bf9d4ba5d29bd6c25b2e846bc44904ef223c1f | C++ | morleyxjtu/Web-crawler | /DiskMultiMap.cpp | UTF-8 | 8,326 | 3.109375 | 3 | [] | no_license | #define _CRT_SECURE_NO_DEPRECATE
#include "DiskMultiMap.h"
#include <functional>
using namespace std;
DiskMultiMap::DiskMultiMap(){}
DiskMultiMap::~DiskMultiMap(){
//close all open file
bf.close();
}
bool DiskMultiMap::createNew(const std::string& filename, unsigned int numBuckets) {
//if the object has been cal... | true |
f35fa1b348c347dd61535e99aa22474c97e69373 | C++ | OSLL/ground-truth-builder | /hedge_pos_publisher/src/pos_publisher.cpp | UTF-8 | 1,678 | 2.640625 | 3 | [] | no_license | #include <ros/ros.h>
#include <hedge_pos_publisher/hedge_pos.h>
extern "C" {
#include "hedge_pos_publisher/hedgehog_proxy.h"
}
using hedge_pos_publisher::hedge_pos; // hedge position message
bool terminateProgram = false;
void CtrlHandler(int signum)
{
terminateProgram=true;
}
hedge_pos get_hedge_pos(HedgehogP... | true |
7da63cf7272eae3b0439081df14185703dc52f87 | C++ | alaneos777/club | /codeforces/547C.cpp | UTF-8 | 1,175 | 2.53125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using lli = long long int;
const int MX = 5e5;
auto divsSieve(int n){
vector<vector<int>> divs(n);
for(int i = 1; i <= n; ++i){
for(int j = i; j <= n; j += i){
divs[j].push_back(i);
}
}
return divs;
}
auto muSieve(int n){
vector<int> mu(n+1, -1);
mu[0] = 0, ... | true |
cae78d05019dd9ca63f49c6b5be03de0a51d7418 | C++ | radovan-wagner/Filip_DateTime | /DateTime_Lib/Test.cpp | UTF-8 | 1,334 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include "DateTime_Lib.h"
int main()
{
DateTime d0("13.10.1998 03:02:01", ".", " ", ":");
d0.show();
DateTime d1(10, 9, 2020, 23, 22, 23);
d1.show();
// DateTime d2(10, 9, 2020, 23, 22, 23);
DateTime d2(11, 11, 2019, 22, 23, 22);
d2.show();
system("pause");
system("cls");
... | true |
6d1aa9dc89eb2c1e2b1026ecb686f294b73e31b5 | C++ | Alaxe/noi2-ranking | /2019/solutions/E/AVD-Plovdiv/odd.cpp | UTF-8 | 387 | 2.515625 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
int a,b,i,k,br=0,br2=0,br3=0;
cin>>a>>b;
for(i=a;i<=b;i++)
{
for(k=1;k<=i/2;k++)
{
br++;
}
br2=br;
if(br2%2!=0)
{
br3++;
... | true |
f84a708700afcc45393962e7b81a7925d41a2eb7 | C++ | RubisetCie/mario-constructor-master | /Headers/Core/placeable.hpp | UTF-8 | 683 | 2.5625 | 3 | [] | no_license | /* Creator : Matthieu (Rubisetcie) Carteron
Language: C++
*/
#ifndef PLACEABLE_INCLUDED
#define PLACEABLE_INCLUDED
#include <SFML/Graphics.hpp>
enum ID {ID_USELESS, ID_PLAYER, ID_CHECKPOINT, ID_INVISIBLE, ID_ENEMY, ID_WONTFALL, ID_SHELL, ID_STOMPABLE};
class Placeable : public sf::Drawable
{
public :
... | true |
d5ba0b5e64da9df1a8b7ee4af9e9b5f3dfd6aa8e | C++ | MdAman02/problem_solving | /search/ternary_search/codeforces/F1355E/Solution.cpp | UTF-8 | 2,639 | 2.984375 | 3 | [
"MIT"
] | permissive | // problem name: Restorer Distance
// problem link: https://codeforces.com/contest/1355/problem/E
// contest link: https://codeforces.com/contest/1355
// time: (?)
// author: reyad
// other_tags: binary search, greedy, math, sorting
// difficulty_level: medium
// note: this problem can also be solved using... | true |
3e527944deb5ead114887d28371ef85db3b91095 | C++ | leohfigueiredo/Arduino | /TESTE_SENSOR_HC/TESTE_SENSOR_HC.ino | UTF-8 | 1,168 | 2.75 | 3 | [] | no_license | /*
* created by Rui Santos,
http://randomnerdtutorials.com
*
* Complete Guide for Ultrasonic Sensor
HC
-
SR04
*
Ultrasonic sensor Pins:
VCC: +5VDC
Trig : Trigger (INPUT)
-
Pin11
Echo: Echo (OUTPUT)
-
Pin 12
GND: GND
*/
int trigPin = 8; //Trig - green Jumper
int echoPin = 9; //Echo - yellow Jumper
long duration, cm... | true |
ab06e40d3817694da5e5de7aa717bb71354a5d66 | C++ | Alex-Nabu/ftp | /src/auth.cpp | UTF-8 | 758 | 3.03125 | 3 | [] | no_license | #include "../includes/auth.h"
auth::auth()
{
cur_user_index = -1;
ifstream fin("auth");
userInfo user;
while(fin >> user.username >> user.password >> user.directory)
{
users.push_back(user);
}
}
bool auth::login(string name, string passwd)
{
if(name == "anonymous")
{
cur_user_index = 0;
return true;
... | true |
f608c63f8be5f7d6a7b00257f605e1ea71e2ec7c | C++ | DeepCoreSystem/Nextion-LCD-library | /src/drawing.cpp | UTF-8 | 8,508 | 2.9375 | 3 | [] | no_license | /* drawing.cpp
*
* Arduino platform library for Itead Nextion displays
* Instruction set : https://nextion.tech/instruction-set/
*
* Library implements almost of the basic and ehnached display function
* but none (yet) of the professional ones.
*
* Please read nxt_lcd.h for some more info
*
* (c) Guarguag... | true |
3611d0f6bc68edeb2ec97c67fc6e5d832ab6f82c | C++ | Tha-Davong/CS205Project-MatixLibrary | /Project/templateUtil.h | UTF-8 | 672 | 2.734375 | 3 | [] | no_license | //
// Created by Vithlaithla Long on 7/6/21.
//
#ifndef CS205PROJECT_TEMPLATEUTIL_H
#define CS205PROJECT_TEMPLATEUTIL_H
#include <type_traits>
#include <complex>
#define IF(...) typename std::enable_if< (__VA_ARGS__), bool >::type = true
template< class T, class U >
constexpr bool is_same_t = std::is_same<T, U>::v... | true |
a4761cbbab649dd28cc03cc541db5570589765f0 | C++ | paniwani/ImageProcessing | /ImageArray/src/ImageArray.cxx | UTF-8 | 1,326 | 2.75 | 3 | [] | no_license | #include "itkImage.h"
#include "itkImageFileWriter.h"
#include "itkImageRegionIterator.h"
#include <iostream>
typedef itk::Image< int, 3 > ImageType;
void WriteITK(ImageType::Pointer image, std::string name) {
typedef itk::ImageFileWriter< ImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
... | true |
35604d618a2875a4097fd03b783774eec270f637 | C++ | Anshuman-UCSB/Advent-of-code-2020 | /Day 16/main.cpp | UTF-8 | 5,243 | 3 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <fstream>
#include <vector>
#include <sstream>
#include <utility>
using namespace std;
void p1();
void p2();
struct Rule{
string name;
vector<pair<int, int>> ranges;
Rule(){};
Rule(vector<pair<int, int>> range, string n):ranges(range), name(n){}... | true |
9e0008cf7dc9c344e0eb2106743170e71f30a91e | C++ | Jthompson715/github.io | /Data Structures/Lab 8b Queue/Thompson_Jeremy_Lab8b_QueueDriver.cpp | UTF-8 | 3,812 | 3.75 | 4 | [] | no_license | // QueueDriver.cpp : Defines the entry point for the console application.
//"Lab 8b, The \"QueueDriver.cpp\" Program \n";
//"Programmer: JEREMY THOMPSON\n";
//"Editor(s) used: JNotePad\n";
//"Compiler(s) used: VC++ 2013\n";
#include <iostream>
#include "Thompson_Jeremy_Lab8b_Queue.h"
#include "Thompson_Jeremy_Lab8b_Qu... | true |
5ad74abf25578f4cae301423c18f3de5a41e5453 | C++ | CleverWang/VisualStudioProjects | /DesignPatterns/Flyweight/ShapeFactory.cpp | UTF-8 | 444 | 3.421875 | 3 | [] | no_license | #include "ShapeFactory.h"
#include <iostream>
std::unordered_map<std::string, Shape*> ShapeFactory::circleMap;
Shape * ShapeFactory::getCircle(const std::string & color)
{
auto iter = circleMap.find(color);
if (iter == circleMap.end())
{
Circle *circle = new Circle(color);
circleMap.insert({ color, circle });
... | true |
d68d232b274cf86f90aed22e08be95d6e9b9f0ba | C++ | RobertKraaijeveld/GrandeOmegaVisualization | /lib/DataProcesser/src/StatisticalAnalyzer/Point/IClusteringPoint.h | UTF-8 | 1,182 | 3.0625 | 3 | [] | no_license | #ifndef IClusteringPoint_H
#define IClusteringPoint_H
#include "../GenericVector/GenericVector.h"
#include <map>
#include <numeric>
#include <iostream>
class IClusteringPoint
{
public:
//const makes sures the getters dont modify the derived object, which is required for the operator overload
virtual Generic... | true |
4be42df65cbe7d0c7d269218d985c852dd558a47 | C++ | ssmktr/Algorism_Study | /Algorism_Study/Step001/Question01/Question01.cpp | UTF-8 | 629 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
vector<int> solution(vector<int> heights)
{
vector<int> answer;
answer.resize(heights.size());
for (int j = 0; j < answer.size(); ++j)
{
int value = heights[j];
answer[j] = 0;
for (int i = j; i >= 0; --i)
{
if (value < heights[i])
{
va... | true |
776a694ee44751c835bf362af8e9abbe965cb00b | C++ | willytai/LogicRegression | /src/myUsage.cpp | UTF-8 | 699 | 3.140625 | 3 | [] | no_license | #include "myUsage.h"
void MyUsage::report(bool repTime, bool repMem) {
cout << endl;
if (repTime) {
setTimeUsage();
cout << "Period time used : " << setprecision(4)
<< _periodUsedTime << " seconds" << endl;
cout << "Total time used : " << setprecision(4)
<< _t... | true |
b17fae5491bb6ab1f61b68bc83dda5420028776e | C++ | kylechiu3201/CS-225-Final-Project | /test.cpp | UTF-8 | 11,330 | 3.125 | 3 | [] | no_license | #define CATCH_CONFIG_MAIN
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include "airport/airport.h"
#include "airports/airports.h"
#include "catch/catch.hpp"
#include "graph/edge.h"
#include "graph/graph.h"
using std::vector;
void printGraph(Airports airports) {
// Vertices are fi... | true |
4cc1828986d536c901d4026cdfbbf98e9db51346 | C++ | MohammadAlhourani/GamesEngineeringPathfindingProject | /GamesEngineeringProject/GamesEngineeringProject/ThreadPool.cpp | UTF-8 | 1,684 | 3.25 | 3 | [] | no_license | #include "ThreadPool.h"
ThreadPool::ThreadPool() {
numThreads = std::thread::hardware_concurrency() - 1;
for (int i = 0; i < numThreads; i++)
{
m_threads.push_back(std::thread(&ThreadPool::infiniteLoopFunc, this));
}
}
ThreadPool::~ThreadPool()
{
}
void ThreadPool::push(std::function<void()>... | true |
d68f6571b97fb312e01138c2a2755047189d03fc | C++ | jaspermacnaughton/Mandelbrot-Set | /src/main.cpp | UTF-8 | 1,314 | 2.984375 | 3 | [] | no_license | #include "complex.h"
double getInput(string displayString) {
double x;
cout << displayString;
cin >> x;
cin.ignore();
return x;
}
int main() {
const int n = 10; // Number of iterations to check if number in mandlebrot
double startx = getInput("Enter start X point: ");
double stopx = getInput(... | true |
92bc7338f85e7c7c883598be97140b4b0b384c50 | C++ | JonasKnarbakk/Snake | /src/SDL/SDLManager.cpp | UTF-8 | 3,600 | 3.34375 | 3 | [] | no_license | /*
* @file: SDLManager.cpp
* @author: Stig M. Halvorsen <halsti@nith.no>
* @version: 1.0.0 <11.02.2013>
*
* @description: Singleton class to be used for SDL initialization,
* window management, and rendering (blit'ing).
* NB: Ment for games, so it's containing a Master/Main
* window.
*/
#include <... | true |
de7bd10d5b26790af81600225fa757215bef4af2 | C++ | DrChenXX/homework | /大一/实验5/4.松雅的旅馆.cpp | UTF-8 | 331 | 2.703125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int n,d;
cin >> n >> d;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
int ans = 2;
for (int i = 1; i < n; i++)
{
if (a[i] - a[i - 1] > 2 * d)
{
ans = ans + 2;
}
if (a[i] - a[i - 1] == 2 * d)
{
ans = ans + 1;
}
}
cout << ans;
r... | true |
1dc56e182996d022bda2ce723f977d75801ce0e2 | C++ | adityasunny1189/C-PlusPlus_Basics | /C++ STL/vector2.cpp | UTF-8 | 492 | 3.75 | 4 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
vector<int> v;
cout << "Insert Elements:" << endl;
for(int i = 0; i < 5; i++) {
int num;
cin >> num;
v.push_back(num);
}
cout << "Arrays Elements are: " << endl;
for(auto x: v) {
... | true |
7c89d966cbeb19182cb4e64da44cdcba4a09f77d | C++ | Whatop/Pord | /Pord_/SpaceEngine-master/Space/UI.h | UTF-8 | 724 | 2.546875 | 3 | [] | no_license | #pragma once
class UI : public Singleton<UI>, public Object
{
Sprite* m_BGHpBar;
Sprite* m_HpBar;
Sprite* m_DashUI;
Sprite* m_DashBlind;
Sprite* m_HealUI;
Sprite* m_HealBlind;
Sprite* m_Karma;
Sprite* m_State;
Sprite* m_StateBar;
Sprite* m_BGStateBar;
Sprite* m_State_RGB;
Sprite* m_State_Fire;
Sprite*... | true |
817bb1cc6983d97e7adf1192dec0142938905623 | C++ | vivekkj123/C-with-DS | /All About C/Arrays/3. Max element from Array.cpp | UTF-8 | 340 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | // You can take input from user. Also can solve directly if you are sure.
#include<iostream>
using namespace std;
int main(){
int max=0;
int a[5]={5, 6, 7, 4, 3};
for(int i=0; i<5; i++){
if(a[i]>max)
max=a[i];
}
cout<<max<<" is the maximum number in this arr... | true |
dc01d75c132cbb0abbdae9291c76c293e359ee82 | C++ | mahaveer-rulaniya/7dc | /function programiz/sumofnatural.cpp | UTF-8 | 277 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int sum(int n){
if(n!= 0){
return n + sum(n-1);
}
}
int main(){
int a;
cout<< "please input the number upto which sum is to be calculated : \n";
cin >> a;
cout << "Sum is :: "<< sum(a)<< endl;
} | true |
b0d271de66390ef3723ab5c1a0fa8f41a2a922d3 | C++ | aznboystride/ricefryer | /main.cpp | UTF-8 | 686 | 3.25 | 3 | [] | no_license | #include <Windows.h>
#include "Fryer.h"
int main()
{
Fryer fryer;
while (1) {
cout << "\n----------Current State----------: " << fryer.GetState() << endl;
cout << "\t1. Cook" << endl;
cout << "\t2. Stop Cook" << endl;
cout << "\t3. Lock Lid" << endl;
cout << "\t4. Unlock Lid" << endl;
cout << "\tEnter ch... | true |
96f6ca896f8382a9297ceb7c062ef653bcea9959 | C++ | Damokenl/TwoDRender | /TwoDRender/TwoDRender.cpp | UTF-8 | 7,502 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
//Note: always include before gl or glfw
#include <GL/glew.h>
//GLEW handles the keyboard and window
#include <glfw3.h>
GLFWwindow* window;
#include <glm/glm.hpp>
using namespace glm;
#include "common\shader.hpp"
#include <common\texture.hpp>
int main( v... | true |
022cb2bc52c04ee34c9e98bec763fdbaf07da364 | C++ | HyangRim/Algorithm_Back | /2455.cpp | UHC | 549 | 2.640625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int remax = -987654321;
int arr[4][2];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 2; y++) {
cin >> arr[x][y];
}
}
int ans = 0;
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 2; y++... | true |
6375782f10c85a79f5f491168ae9e437c94559c6 | C++ | Tempoblink/cxxp | /ch07_Classes/exercise_7_01.cpp | UTF-8 | 1,416 | 3.765625 | 4 | [] | no_license | /*
* 使用2.6.1节练习定义的Sales_data类为1.6节(第21页)的交易处理程序编写一个新版本。
*/
#include <iostream>
#include <string>
struct Sales_data {
std::string bookNo;
unsigned units_sold = 0;
double revenue = 0.0;
};
std::istream &read(std::istream &is, Sales_data &book) {
double price = 0.0;
is >> book.bookNo >> book.units... | true |
552130db7b5bffd2f159c330af67c989fe7dd72e | C++ | AAI1234S/cpp | /function/function_over.cpp | UTF-8 | 418 | 3.171875 | 3 | [
"MIT"
] | permissive | #include<iostream>
void display(int ch, float len)
{
std::cout<<"ch="<<ch<<std::endl;
std::cout<<"len="<<len<<std::endl;
}
void display(float ch, float len)
{
std::cout<<"ch="<<ch<<std::endl;
std::cout<<"len="<<len<<std::endl;
}
void display(char ch, double len)
{
std::cout<<"ch1="<<ch<<std::endl;
std::cout<<"l... | true |
8741f4a4e69fed9790bf10d71ddee3cd5a97511e | C++ | suyuan945/LeetCode | /173_BSTIterator/173_BSTIterator.cpp | UTF-8 | 2,525 | 3.625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
TreeNode *BuildTree(vector<int> preorder){
TreeNode dummy(0);
TreeNode* root = &dummy;... | true |
c09d4944acd22d6687bf5bccbdbbe58b443c8548 | C++ | chloro-pn/raft | /asio_wrapper/timer.h | UTF-8 | 1,149 | 3.015625 | 3 | [] | no_license | #ifndef TIMER_H
#define TIMER_H
#include "asio.hpp"
#include "log.h"
#include <memory>
#include <functional>
namespace puck {
class TimerHandle {
public:
TimerHandle():cancel_(false) {
}
bool Canceled() const {
return cancel_;
}
void Cancel() {
cancel_ = true;
}
private:
bool cancel_;
};
tem... | true |
05654977833fd33fdee69109ba8b2a6b361d2f3c | C++ | zztttt/LeetCode | /0059. Spiral Matrix II/sol.cpp | UTF-8 | 1,034 | 2.796875 | 3 | [] | no_license | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>> ret(n, vector<int>(n, -1));
int count = 1;
int rlow = 0, rhigh = n - 1, clow = 0, chigh = n - 1;
while(rlow <= rhigh && clow <= chigh){
// top row
for(int i = clow; i <= ... | true |
67d7330849205930a3dcb8337010ecf372373424 | C++ | RallyWRT/ppsocket | /TUDT/P2PUdtTest/P2PUdtTest.cpp | GB18030 | 2,915 | 2.75 | 3 | [] | no_license | // P2PUdtTest.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <string>
#include <iostream>
#include <vector>
using namespace std;
#include "udt.h"
//#include "TNetworkListener.h"
#include "StrFuns.h"
//#include "TConn.h"
class ConnHandler:
public UDT::TConnection
{
public:
ConnHandler(UDT::TConnect... | true |
ff1140f47c9b46a68f0177cad28b94811c9b6138 | C++ | jsj2008/Three.cpp | /Three.cpp/three/others/Utils.cpp | UTF-8 | 2,618 | 2.828125 | 3 | [] | no_license | //
// Utils.cpp
// Three.cpp
//
// Created by Saburo Okita on 30/06/14.
// Copyright (c) 2014 Saburo Okita. All rights reserved.
//
#include "Utils.h"
#include <sstream>
#include <glm/gtc/quaternion.hpp>
using namespace std;
namespace three {
string Utils::toString( const vector<int>& vec ) {
... | true |
391e594e42d3b6f656bf5bb66e0562b68219bce6 | C++ | haichangyang/xd0615 | /lesson7/code2.c.ino | UTF-8 | 960 | 2.578125 | 3 | [] | no_license | #include <MsTimer2.h> //定时器库的头文件
int pinInterrupt=7;
int income=0;
//中断服务程序
void onChange()
{
if ( digitalRead(pinInterrupt) == LOW )
income=0;
}
void onTimer()
{
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
digitalWrite(2,income&0x1);
digitalWrite(3,(income>>1)&0x1);
dig... | true |
2631e949f6acb1169814f6a4457d876f44b44918 | C++ | Arganancer/SideScrollingFighter | /9_1_TP2_SideScrollingFighter/delete_account.cpp | UTF-8 | 3,197 | 2.875 | 3 | [
"MIT"
] | permissive | #include "delete_account.h"
#include "input_manager.h"
#include "account_controller.h"
#include "game.h"
delete_account::delete_account()
{
// Confirmation View
delete_confirmation_message_ = text("", Vector2f(0, 0), text::placeholder);
yes_ = button( "Yes", Vector2f(0, 0),text::normal);
yes_.set_position(sf::Vec... | true |
2d1f5f9e03ac597dfe7bc00d507a0b23d806bcbe | C++ | shadowmydx/leetcode | /Valid Sudoku.cpp | UTF-8 | 1,897 | 3.328125 | 3 | [] | no_license | class Solution {
public:
bool isValidSudoku(vector<vector<char> > &board) {
int len1 = board.size();
if (!len1)
return true;
int len2 = board[0].size();
for (int i = 0;i < len1;i++)
for (int j = 0;j < len2;j++)
{
if (board[i][j] != ... | true |
7c88ff7d364a40790e989d7ebc846e34b50ec427 | C++ | aratius/OFBeginer | /src/utils/Ground.cpp | UTF-8 | 294 | 2.53125 | 3 | [] | no_license | //
// Ground.cpp
// beginner
//
// Created by 松本新 on 2020/12/15.
//
#include "Ground.hpp"
void Ground::init(float _radius, float _y) {
radius = _radius;
yPos = _y;
}
void Ground::display () {
ofSetColor(0, 0, 0);
ofDrawCircle(ofGetWidth()/2, yPos, radius);
}
| true |
3e3336ba3a3f6c0823829e7060bca01c9b0cc1ce | C++ | john15518513/leetcode | /cpp/constructtherectangle.cpp | UTF-8 | 211 | 2.578125 | 3 | [] | no_license | class Solution {
public:
vector<int> constructRectangle(int area) {
int target = int(sqrt(area));
while (area%target != 0) target--;
return vector<int> {area/target,target};
}
};
| true |
43e8f9c32f495497b0b766ced77dffb3981d1fb6 | C++ | EdwinJosue16/Proyecto_Integrador_Redes-SO | /src/Green/RespondHeartbitRequest.cpp | UTF-8 | 5,020 | 2.703125 | 3 | [] | no_license | #include "RespondHeartbitRequest.hpp"
#include "Payloads/LinkLayerPayload.hpp"
#include "Payloads/HeartbeatPayload.hpp"
#include "Log.hpp"
RespondHeartbitRequest::RespondHeartbitRequest()
{
// This module will receive messages of awake neighbors only.
this->wakeUpStatus.status = NeighbourStatus::WAKE_UP;
}
Re... | true |
a6a23aeb4ddf82849abc15489495ae179b83b2ad | C++ | swolka/zadania | /01/main.cpp | UTF-8 | 705 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{ int a, b, c;
cout << "Wpisz kolejno 3 dowolne liczby calkowite" << endl;
cout << "do obliczenia sredniej arytmetycznej z nich." << endl;
cout << " "<< endl;
cout << "Wpisz pierwsza liczbe:" << endl;
cout << "a= ";
cin >> a;
cou... | true |
3145440d26f9c09993537165ba793b398ea29a14 | C++ | emrul-chy/Competitive-Programming | /UVa/10929 - You can say 11.cpp | UTF-8 | 478 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
int main()
{
int i,j,s;
char n[1050];
while(1)
{
s=0;
scanf("%s",&n);
i=strlen(n);
for(j=0; j<i; j++)
{
s=s*10+n[j]-'0';
s=s%11;
}
if(s==0 && i==1) break;
else... | true |
de1250bb4237fbdad57742902cd153ed5dc1f6b5 | C++ | MoritzGue/Klangsynthese_JaMo | /src/OneZero.cpp | UTF-8 | 486 | 2.8125 | 3 | [] | no_license | #include "OneZero.h"
#include <cmath>
OneZero :: OneZero( double theZero ){
this->setZero( theZero );
z_1 = 0.0;
}
OneZero :: ~OneZero( void ){
}
void OneZero :: setZero( double theZero ){
// Normalize coefficients for unity gain.
if ( theZero > 0.0 )
b_0 = 1.0 / ((double) 1.0 + theZero);
... | true |
49914a5f482cb173d382cfbaeccdbb83ec5be6ab | C++ | gizmore/yabfdbg | /util/GizStr.cpp | UTF-8 | 1,360 | 3.234375 | 3 | [
"MIT"
] | permissive | #include "GizStr.h"
#include "string.h"
#include "stdio.h"
GizStr::GizStr(int size)
{
buffer = new char[size+1];
length = 0;
buffer[length] = 0;
buf_len = size;
}
GizStr::GizStr(const char *s)
{
length = strlen(s);
buf_len = length + 1;
buffer = new char[buf_len];
memcpy(buffer, s, buf_len);
}
GizStr::GizSt... | true |
5260ae552c3b6e091db164b651abb16865e142a6 | C++ | szxie/CS308-Compiler | /P2T/node.h | UTF-8 | 1,007 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <llvm/IR/Value.h>
class CodeGenContext;
class NStatement;
class NExpression;
typedef std::vector<NStatement*> StatementList;
class Node {
public:
virtual ~Node() {}
virtual llvm::Value* codeGen(CodeGenContext& context)
{ return NULL; }
};
class NExpression : public... | true |
b9d9ce8a66884d4eceb001369776b3cbc533f0c7 | C++ | jimmy801/UVA | /UVA 10268 498'.cpp | BIG5 | 732 | 3.359375 | 3 | [] | no_license | // 1P-31 498'
// J@ӥNx
// ۿJ@sƦrNa_0,a_1....a_n
// Xa_0 * n * x^(n-1) + a_1 * (n-1) * x^(n-2) + ... + a_(n-1)
#include <iostream>
using namespace std;
int main()
{
int x; char a[1000];
while (cin >> x)
{
cin.ignore();
cin.get(a, 1000, '\n'); cin.ignore();
int int_a[1000] = { 0 };
int an... | true |
6fd7644eafbf563ded25fb4b1aa0e40f0fdd3317 | C++ | Yhatoh/Programacion_competitiva | /codeforces/276C-Little_Girl_And_Maximum_Sum.cpp | UTF-8 | 1,150 | 2.984375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector< ll > FT;
void fenwickTree(int n){
FT.assign(n + 1, 0);
}
ll query(int n){
int i;
ll sum = 0;
for(i = n; i; i -= (i & (-i)))
sum += FT[i];
return sum;
}
void update(int i, ll x){
for(; i < FT.size(); i += (i & (-i... | true |
5f88e5ea4a051fefc4337cd4f6e63129f4d57268 | C++ | sandilya28/spoj | /PSYCHON.cpp | UTF-8 | 1,440 | 2.765625 | 3 | [] | no_license | #include <cstdio>
#include <cmath>
#include <vector>
using namespace std;
int MAX = 10000000;
vector <bool> prime(MAX+1,1);
vector <int> p;
int main()
{
int limit = sqrt(MAX),size=0;
for (int i = 0; i < 3164; i++)
{
prime[i] = 1;
}
prime[0] = 0;
prime[1] = 0;
for(int i=2;i<limit;i++... | true |
453856592de0de34797d88ced25d8242b05d157c | C++ | Wirgiliusz/FlyAndShoot | /oknoprzegranej.h | UTF-8 | 1,436 | 2.921875 | 3 | [] | no_license | #ifndef OKNOPRZEGRANEJ_H
#define OKNOPRZEGRANEJ_H
/*!
* \file
* \brief Definicja klasy OknoPrzegranej.
*
* Plik zawiera definicję klasy OknoPrzegranej,
* która odpowiada za okno zakończenia gry.
*/
#include <QDialog>
namespace Ui {
class OknoPrzegranej;
}
/*!
* \brief Implementacja obiektu okna przegranej.
*
* Klas... | true |
6a41ffb78e263592a0b7cf721dace6f9a7ccf6ad | C++ | xUser5000/competitive-programming | /A/A. Pouring Rain/main.cpp | UTF-8 | 282 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
double d, h, v, e; cin >> d >> h >> v >> e;
double area = (d / 2) * (d / 2) * (22 / 7);
if (e * area > v) cout << "NO";
else printf("YES\n%.8f", area * h / (v - e * area));
return 0;
}
| true |
c54c80eefaa09e2fd03f1f29d74163ee4348a4fc | C++ | sigvebs/StandardCI | /src/MainApplication.cpp | UTF-8 | 10,164 | 2.578125 | 3 | [] | no_license | /*
* File: MainApplication.cpp
* Author: sigve
*
* Created on December 26, 2012, 3:26 PM
*/
#include "MainApplication.h"
//------------------------------------------------------------------------------
MainApplication::MainApplication(int* argc, char*** argv, string configFileName) : argc(argc), argv(argv) {
... | true |
07feb538e83337d292b00cbc2fc1f8450c008142 | C++ | sherrymou/CS240-CPP | /Lab3/Lab3.cpp | UTF-8 | 415 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
#include <cstdlib>
#include "Bank.h"
using namespace std;
int main(int argc, char *argv[]) {
if (atoi(argv[1])>1000){
cout << "Maximum 1000 customers" << endl;
return 1;
}else{
if (argc == 2){
Bank bank = Bank(atoi(argv[1]));
bank.menu();
}else if (... | true |
964db0ce65f16bedf5bf89da73e7842207d42d6a | C++ | Sidebail/KnittedAndInflatable | /Plugins/SceneFusion/ThirdParty/SceneFusionAPI/Includes/ksQuaternion.h | UTF-8 | 17,637 | 2.609375 | 3 | [] | no_license | /*************************************************************************
*
* KINEMATICOUP CONFIDENTIAL
* __________________
*
* Copyright (2017-2020) KinematicSoup Technologies Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of KinematicSoup ... | true |
0893cd06c4e7819d1f25e1d14d69d94ddc2a99e6 | C++ | Haar-you/kyopro-lib | /Mylib/Geometry/Float/intersect_segments.cpp | UTF-8 | 1,661 | 2.734375 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Mylib/Geometry/Float/ccw.cpp"
#include "Mylib/Geometry/Float/geometry_template.cpp"
namespace haar_lib {
namespace intersect_segments_impl {
enum status_t { INTERSECTED,
OVERLAPPED,
NOT_INTERSECTED,
SAME };
t... | true |
78457fd53cc4bc18ff9ee6cf67a7377e0afc3cdd | C++ | JesusandMechaGodzilla/CS270P4 | /prog4/prog4/msh.cpp | UTF-8 | 5,641 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <unistd.h>
#include <sys/wait.h>
#define DN "0"
using namespace std;
map<string, string> sub = { { "ShowTokens", "0" },{ "PATH", "/bin:/usr/bin" } };
int glob;
vector<string> procs, dprocs;
vector<int> pids;
void myHandle... | true |
706a234777a90de5ab03d1074b4e5d57f23cd0a4 | C++ | tt-jsr/VMEngine | /Assembler.cpp | UTF-8 | 24,273 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "Assembler.h"
#include "Machine.h"
#include "Instructions.h"
#include "Data.h"
#include <iostream>
namespace
{
struct ParseContext;
void Throw(ParseContext& ctx, const char *msg);
struct ParseContext
{
std::string line;
int pos;
int lineno;
... | true |
a0e6329abeaeb998ba87c8a440f2c310a055500b | C++ | limoiie/my-oj | /problems/leetcode035.h | UTF-8 | 505 | 2.96875 | 3 | [] | no_license | //
// Created by limoi on 2018/1/25.
//
// LeetCode 035 search insert position
#include <vector>
using namespace std;
class SolutionLeetCode035 {
public:
int searchInsert(vector<int> & nums, int target) {
int lt = 0, rt = static_cast<int>(nums.size()) - 1;
while (lt <= rt) {
int md = ... | true |
9320d3732a99a1b5f5e9a7e5ffd6d89652e3b7fb | C++ | OS2World/DEV-SAMPLES-VisualAgeCPP4_Samples | /ioc/graph/curve.h | UTF-8 | 4,500 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | /******************************************************************************
* .FILE: curve.h *
* *
* .COPYRIGHT: *
... | true |
994b1361e0aec8b1509ae951fdaaa72b216c8df6 | C++ | cache-tlb/problem_solving | /leet_code/212.Word.Search.II.cpp | UTF-8 | 1,993 | 2.625 | 3 | [] | no_license | class Solution {
public:
bool dfs(int mat_i, int mat_j, int w_pos) {
if (mat[mat_i][mat_j] == str[w_pos] && w_pos == str.length() - 1) return true;
// if (w_pos >= str.length()) return true;
if (mat[mat_i][mat_j] != str[w_pos]) return false;
vis[mat_i*m+mat_j] = 1;
if (mat_i ... | true |
6272457c02958a0bb6ad88d2cdb97d807c98aa2c | C++ | HadrienMarcellin/ProDroneTasks | /task2/src/main.cpp | UTF-8 | 1,197 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include "logger.hpp"
#include <chrono>
using namespace std;
// On utilise typename et non pas classe pour eviter les confusions
template<typename Type> Type calculerSomme(Type operande1, Type operande2)
{
Type resultat = operande1 + operande2;
return resultat;
}
int main(int argc,... | true |
e8e601d2d012fad9ca7f57cdddc352be0788356e | C++ | pointer20qt/wudi | /2-16test/autoptr.cpp | GB18030 | 738 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include"autoptr.h"
using namespace std;
class tool{
public:
int value = 0;
tool(){
cout << "tool" << endl;
}
tool(int t){
cout << ",t" << t << endl;
}
tool(const tool&){
cout << "tool" << endl;
}
tool(tool&&){
cout << "toolƶ" << endl;
}
~tool(){
cout << "tool" << endl;
}
to... | true |
b924b59db86f9af5827ad9a1f7f94a9e68d0c7e0 | C++ | YichengZhong/Top-Interview-Questions | /剑指OfferII072.求平方根/mySqrt.cpp | UTF-8 | 180 | 2.75 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int mySqrt(int x) {
long res = x;
while (res * res > x) {
res = (res + x / res) / 2;
}
return res;
}
}; | true |
6ed789a98bcd0890c26debf653c9583409e55c8c | C++ | emilianotca/Realocacao_Interplanetaria | /include/Linked_Queue.h | UTF-8 | 926 | 2.921875 | 3 | [] | no_license | //
// Created by emilianotca on 10-Jul-21.
//
#ifndef REALOCACAO_INTERPLANETARIA_LINKED_QUEUE_H
#define REALOCACAO_INTERPLANETARIA_LINKED_QUEUE_H
#include "../include/Queue.h"
#include "../include/Queue_Cell.h"
#include <string>
class Linked_Queue : public Queue
{
public:
Linked_Queue();
~Linked_Queue();
... | true |
755969704ede16b420bd3e03ff131038b76f6f5b | C++ | reenboog/cross_platform_client_crud_sample | /Classes/FilteredResultCell.cpp | UTF-8 | 1,845 | 2.734375 | 3 | [] | no_license | //
// FilteredResultCell.cpp
// ttt_c_tracker
//
// Created by Alex Gievsky on 30.10.15.
//
//
#include "FilteredResultCell.h"
using namespace cocos2d;
using namespace std;
FilteredResultCell::FilteredResultCell() {
_back = nullptr;
_labelCalories = nullptr;
_labelDate = nullptr;
}
FilteredResultCell... | true |
bd998ffbe5ebe3a5397968aba5d157e641412b12 | C++ | Futaba-Kosuke/algorithm | /atcoder/educational_dp/1/e_knapsack2.cpp | UTF-8 | 1,073 | 2.53125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
const int MAX_V = 100001;
typedef struct product {
ll w;
ll v;
} product;
ll solve (ll N, ll W, vector<product> products) {
vector<vector<ll>> dp_table(N+1, vector<ll>(MAX_V, INF));
ll result = 0;
dp_table.at(0).... | true |
34933bc9f8cd1d5759ecefd58ff2fe296ccaf133 | C++ | asmith-git/utilities | /include/asmith/utilities/id_holder.hpp | UTF-8 | 1,757 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2017 Adam Smith
// 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 applicable law or agreed to in writing... | true |
d51b92dbe157063fb0facf1a0aecbac390a69f4d | C++ | SubhrojyotiRoy271/friendly-octo-doodle | /CPP DS/Stackquestions.cpp | UTF-8 | 3,796 | 3.40625 | 3 | [] | no_license | //1.
//Nearest Greater Element to the right
#include<bits/stdc++.h>
using namespace std;
vector<int> solve(int arr[],int n)
{
vector<int> v;
stack<int> st;
for(int i=n-1;i>=0;i--)
{
if(st.empty())
v.push_back(-1);
else if(!st.empty() && st.top()>arr[i])
v.push_back(st.top());
else
{... | true |
0179cee19410683f9a19713eb21c9b4f45854e3e | C++ | Greeninguy/Hash-Table | /Project4/Students.h | UTF-8 | 825 | 3.203125 | 3 | [] | no_license | #pragma once
#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
#define STUDENTPTR StudentNode*
/*
Students Object is a linked list of StudentNodes used to store and organize Students.
*/
class Students
{
public:
/*
StudentNode Object holds Student information and ... | true |
efd2e30ae2ac4078d7a07ec7b2836770d007ad15 | C++ | danildudchenko/Fifteens | /Hw1903fifteens/Source.cpp | UTF-8 | 3,486 | 3.328125 | 3 | [] | no_license | #include "Header.h"
void main()
{
cout << "You are playing fifteens!!!\n"
<< "Press w/a/s/d for making some turns\n";
srand(time(0));
char arr[ROWS][COLS] =
{
{ '1','2' ,'3' },
{ '4', '5', '6'},
{ '7',' ','8' },
};
char win[ROWS][COLS] =
{
{ '1','2' ,'3' },
{ '4', '5', '6'},
{ '7','8',' ' },
};
int ... | true |
a32a4e56bf0e95add0c5ac948e4fd4ec4e8ad676 | C++ | CharlesBaudelaire/code | /数组的储存用法.cpp | UTF-8 | 509 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int main(){
int num;
double a[5];
int count=0;
for (int i=0;i<5;i++){
scanf("%d",&num);
if(num==0) break;
else {
switch(num){
case 1:a[i] = 3.00;break;
case 2:a[i] = 2.50;break;
case 3:a[i] = 4.10;break;
case 4:a[i] = 10.20;break;
defa... | true |
e1f76023bc96bdd6b11ce8b8ea2294a759ec3e3a | C++ | Scarlehh/Data_Structures_Cpp | /ArrayList/src/main.cpp | UTF-8 | 253 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include "ArrayList.h"
int main() {
char arr[3] = {'a', 'b', 'c'};
ArrayList<char> list(arr, 3);
std::cout << list.remove(4) << "\n";
list.add('d');
list.add('d');
std::cout << list << "\n";
list.removeAll('d');
return 0;
}
| true |
c84fb03538f482bc7c5ba41d57b4ad9c788c4096 | C++ | paulin-mipt/hot-pursuit-game | /CarGame/CarGame/UI/Coord.h | UTF-8 | 836 | 2.5625 | 3 | [] | no_license | #pragma once
#include "GlobalDefinitions.h"
namespace UI {
// координаты в игре
struct CCoordinates {
float x;
float y;
float angle;
CCoordinates( float _x, float _y, float _angle = 0 ) :
x( _x ),
y( _y ),
angle( _angle )
{}
CCoordinates& operator=( const Core::CCoordinates ... | true |
a4b04f1448ffcb9bffe604d1f46dad58685329ae | C++ | CZXHenry/Digital-Image-Processing | /hw1/hw1/main.cpp | GB18030 | 3,903 | 2.984375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <stdio.h>
#include <Windows.h>
#include <fstream>
#include <opencv2\opencv.hpp>
#include "DigitalImageProcessing.h"
using namespace cv;
using namespace std;
const string FilePath = "44.png";
const string FileName = "44";
int UI();
stru... | true |
c4d4af681bf1bcac7b755b9e55e1dd6258b70029 | C++ | vankenobi/my_first_examples | /haftanin_gunleri.cpp | UTF-8 | 553 | 2.71875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char harf;
cout << "A,B,C,D,E harflerinden birini giriniz: ";
cin >> harf;
if (harf == 'A'){
cout << "bugun gunlerden pazartesi.\n";
}
else if (harf == 'B'){
cout << "bugun gunlerden sali."<<endl;
}
else if (harf == 'C'){
cout << "bugun gunlerden carsa... | true |