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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8a3d9ccbdd10c05232d4b31292528dbf1dc2997a | C++ | sasaki-seiji/ProgrammingLanguageCPP4th | /part3/ch27/27-4-1-binary-tree/src/user.cpp | UTF-8 | 494 | 3.15625 | 3 | [] | no_license | /*
* user.cpp
*
* Created on: 2016/10/01
* Author: sasaki
*/
#include "binarytree.h"
#include <vector>
#include <iostream>
using namespace std;
using My_node = Node<double>;
void user(const vector<double>& v)
{
My_node root{1.5};
int i = 0 ;
for (auto x : v) {
auto p = new My_node{x};
if (i++%2)
... | true |
21808c238564b1dd3c26f30fb458bf4bd9a17309 | C++ | rodribat/algorithms | /find_digits.cpp | UTF-8 | 930 | 3.296875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
//version avoiding string conversions
int findDigits(int n) {
int divisors = 0;
int d = n;
while (d>0)
{
int divisor = d%10;
d /= 10;
if(divisor!=0 && n%divisor==0)
divisors++;
}
return divisor... | true |
c2384cf1c15d22ed73d4a1711ab2c0e8392ec99c | C++ | Yaboi-Gengarboi/cs201 | /homework/hw2/Money/money.cpp | UTF-8 | 1,840 | 4.15625 | 4 | [] | no_license | /*
money.cpp
Justyn P. Durnford
Created on 9/18/2019
Finished on 9/20/2019
This program asks the user for an amount for each unit of currency
and then prints the units back before adding them up and printing
the total value.
*/
#include <iostream>
#include <string>
using std::cout;
using std::cin;
using std::endl;
usi... | true |
11de79c5cb405ff2c6eeb4408006dacef80c7ee9 | C++ | longjianjiang/LeetOJ | /addition/offer_19.cpp | UTF-8 | 1,122 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
using namespace std;
/*
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
--------------
1,2,3,4,8,12,16,15,14,13,9,5,1,6,7,11,10
*/
// 给定矩阵,从外向里以顺时针的顺序依次打印;
//... | true |
ded8214b246a3ee7bf832ccba7e5b27cf2bd3b68 | C++ | guffi8/OPERATING_SYSTEMS | /Block Chain/Block.cpp | UTF-8 | 2,268 | 2.84375 | 3 | [] | no_license | /*
* Block.cpp
*
* Created on: Apr 27, 2015
* Author: Yuval & Eric
*/
#include <unistd.h>
#include <iostream>
#include <cstdlib>
#include <signal.h>
#include <pthread.h>
#include <queue>
#include <list>
#include "Block.h"
#include <stdlib.h>
/**
* The constructor. construct new block. get the block's numb... | true |
8c2c51954645ecaff762bac2fb8b34ea081161f4 | C++ | arangodb/arangodb | /3rdParty/boost/1.78.0/libs/locale/examples/conversions.cpp | UTF-8 | 1,708 | 2.59375 | 3 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"Zlib",
"GPL-1.0-or-later",
"OpenSSL",
"ISC",
"LicenseRef-scancode-gutenberg-2020",
"MIT",
"GPL-2.0-only",
"CC0-1.0",
"LicenseRef-scancode-autoconf-simple-exception",
"LicenseRef-scancode-pcre",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | //
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#include <boost/locale.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <iostream>
#in... | true |
7691a58d1632bd53b7b7ddda487738cd3c6ca244 | C++ | rafael-radkowski/HCI-557-CG | /gl_common/GLSurface.cpp | UTF-8 | 4,112 | 3 | 3 | [
"MIT"
] | permissive |
#include "GLSurface.h"
#include <algorithm>
GLSurface::GLSurface( vector<glm::vec3> &vertices, vector<glm::vec3> &normals):
_vertices(vertices), _normals(normals)
{
}
GLSurface::~GLSurface()
{
}
/*!
Init the geometry object
*/
void GLSurface::init(void)
{
initShader();
initVBO... | true |
00170888f96799cc8c846ff011a159633abccfe6 | C++ | mavd09/notebook_unal | /Strings/Z algorithm.cpp | UTF-8 | 329 | 2.8125 | 3 | [] | no_license | /// Complexity: O(|N|)
/// Tested: https://tinyurl.com/yc3rjh4p
vector<int> z_algorithm (string s) {
int n = s.size();
vector<int> z(n);
int x = 0, y = 0;
for(int i = 1; i < n; ++i) {
z[i] = max(0, min(z[i-x], y-i+1));
while (i+z[i] < n && s[z[i]] == s[i+z[i]])
x = i, y = i+z[i], z[i]++;
}
ret... | true |
5509f55fb20692a62a5e61e46c00db1b1ce66a96 | C++ | interestingLSY/intServer | /src/world/dim/chunk/block/block.hpp | UTF-8 | 930 | 2.921875 | 3 | [] | no_license | #pragma once
#include "base/common.hpp"
namespace IntServer{
enum class BlockType : int{
GRASS_BLOCK,
STONE
};
class BlockProperties{
public:
BlockType type;
string name;
};
BlockProperties blockProperties[16384];
class Block{
public:
BlockType type;
BlockProperties& GetProperties(){
return blockProperties... | true |
ff48df3f6d2d75f0e7083d48e85a28cd50efa4f0 | C++ | MohammadAliAfsahi/p.r.s. | /saver.cpp | UTF-8 | 8,586 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include<stdlib.h>
#include <string.h>
void teams(int b[32],int n);
int main() {
FILE *saved_game = fopen("c:\\Users\\eli\\Desktop\\teams2.txt","rb");
int i=0,j=0,s1=0,s2=0,s3=0,s4=0,s5=0,s6=0;
char name[100];
char name_country[32][100]={NULL};
char group[32][100];
char num[32][10... | true |
63851bbfc3b877739a93fd8189b6362b34f4c6a2 | C++ | fly8wo/Code---- | /c&c++/Code/12m5d/求阶乘和.cpp | WINDOWS-1252 | 275 | 2.984375 | 3 | [] | no_license | //׳˵ĺ
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
cin >> n;
int sum =0 ;
int fac=1;
for (int i=1;i<=n;++i){
// int fac=1;
// for(int j = 1 ; j <=i;++j)
fac *=i ;
sum +=fac;
}
cout<<sum;
return 0;
}
| true |
9e6198865b4e6bfec1cb0e855477e74104c3bc92 | C++ | yangdongzju1976/c_language | /code_其他班级/20200410/12.cpp | GB18030 | 578 | 3.078125 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int score = 0;
printf("\n:");
scanf("%d", &score);
if(score<30)
printf("\n30֣");
if(score<60&&score>=30)
printf("30֣С 60 ֣ϲ \n");
if (score >= 60&&score <= 80)
printf("60С80еˮƽ\n");
if (score > 80 && score < 90)
pri... | true |
a5decacf7a8f3010802a2b3595793ab86b62dbae | C++ | sirzooro/RakeSearch | /RakeSearchV1/Square/Square/DLX_DLS.cpp | UTF-8 | 17,454 | 2.875 | 3 | [] | no_license | #include "DLX_DLS.h"
void orth_mate_search::generate_permutations(int n, vector<vector<int>> &perm, bool diag)
{
vector<int> seed;
for (int i = 0; i < n; i++) {
seed.push_back(i);
}
do {
bool acc = true;
if (diag == true) {
int md = 0;
int ad = 0;
for (int j = 0; j < n; j++) {
if (seed[j] == j... | true |
f552be53afa8ce613039346926c1bf38d95064bd | C++ | TysonGomes/C---Facu | /C++ facu/Salario.cpp | UTF-8 | 253 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
float sl(float s1 ){
//float s1;
s1=s1-(s1*12/100);
return s1;
}
int main() {
float s1;
printf ("digite seu salario: ");
scanf ("%f",&s1);
s1=sl(s1);
printf("seu salario liquido e %.2f",s1);
getch();
}
| true |
2959271222b1ce1b27f879a3fd287422edc6b16e | C++ | bangiao/c_plus_plus_11 | /保持与C99兼容/保持与C99兼容/[2]_Pragma.cpp | GB18030 | 380 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
//1. #pragma _Pragma Чһ
//2. _Pragma Ǻ궨, Ǻ sizeof һIJ
//3. ʹ÷: _Pragma ("once"); // Ч #pragma once һ
//4. ŵ: һЩ궨
/*
#define PRAGMA(x) _Pragma(#x)
*/
// int main(void)
// {
//
//
// system("pause");
// return 0;
// } | true |
791f4393e1b62747c981257939f58d7a89ee408a | C++ | kalderman/demo | /app/include/openglwindow.hpp | UTF-8 | 1,946 | 2.625 | 3 | [
"MIT"
] | permissive | #ifndef __OPENGLWINDOW_H__
#define __OPENGLWINDOW_H__
#include <optional>
#include <variant>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <glbinding/gl/gl.h>
#include <glbinding/glbinding.h>
using namespace std;
using namespace gl;
struct InitializationFailed {};
struct WindowOrOpenGlContextCreationFa... | true |
004f2ac73291bc31d834778a279055367618db65 | C++ | simeongbolo/prog-contests | /acm/solved/2005/answer.cpp | UTF-8 | 921 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <algorithm>
using namespace std;
int main(void) {
int matrix[5][5];
for (int i = 0; i < 5; i++)
for (int j = 0; j < 5; j++)
cin >> matrix[i][j];
int p1 = matrix[0][1] + matrix[1][2] + matrix[2][3] + matrix[3][4];
int p2 = matrix[0][2]... | true |
757038129990abe74417587b3eef15733dce04d0 | C++ | astanin/notch | /test/test_notch_pre.cpp | UTF-8 | 4,475 | 2.71875 | 3 | [
"MIT"
] | permissive | #include "catch.hpp"
#define NOTCH_ONLY_DECLARATIONS
#include "notch.hpp"
#include "notch_io.hpp"
#include "notch_pre.hpp"
using namespace std;
using namespace notch;
TEST_CASE("OneHotEncoder single-column encoding-decoding", "[pre]") {
Dataset five {{5}, {1}, {4}, {3}, {2}}; // labels in range 1..5
OneHot... | true |
91e4c2a401e6c19cf431d48b088d5a659bad9a84 | C++ | Aman-mangu/IntermediateCpp | /assignmentsFolder/CodingTasksAssignment/Task3_Points/collection.h | UTF-8 | 620 | 2.609375 | 3 | [] | no_license | #ifndef __COLLECTION_H_
#define __COLLECTION_H_
#include "points.h"
#include <list>
#include <vector>
class collection
{
private:
std::list<Points> points;
public:
void addPoint(int x,int y);
void addPoint(const Points& ref);
void DisplayAll();
int CountPointsInQuadrant(int quadrant);
int Count... | true |
fd30c8a20337f761cccb5fac1cfaaa48c0383ec5 | C++ | dovanduy/cppTopics | /Loops/8-bitCodeTable.cpp | UTF-8 | 130 | 2.515625 | 3 | [
"MIT"
] | permissive | // To print 8-bit code table
#include <cstdio>
int main()
{
int i=0;
for(i=0;i<256;i++)
printf("%d %c\n",i,i) ;
return 0;
}
| true |
7b569837cc468f8ac79761e8d00f0a90dd76d4f0 | C++ | vimday/PlayWithLeetCode | /每日一题 6-8 月/Day0824_repeated-substring-pattern.cpp | UTF-8 | 631 | 2.5625 | 3 | [] | no_license | /*
* @Author :vimday
* @Desc :
* @Url :
* @File Name :Day0824_repeated-substring-pattern.cpp
* @Created Time:2020-08-24 23:08:35
* @E-mail :lwftx@outlook.com
* @GitHub :https://github.com/vimday
*/
#include <bits/stdc++.h>
using namespace std;
void debug() {
#ifdef LOCAL
freo... | true |
1ba36f2737d0c84064dd944f0b771bd64b864755 | C++ | sorphin/DC25 | /firmware/src/RgbAnimations.h | UTF-8 | 1,920 | 2.640625 | 3 | [] | no_license |
#ifndef __RGB_ANI_H
#define __RGB_ANI_H
#include <stdint.h>
#include <Arduino.h>
#define NUM_RGB (8) // Number of WS281X we have connected
#define NUM_BYTES (NUM_RGB*3) // Number of LEDs (3 per each WS281X)
#define DIGITAL_PIN (PD2) // Digital port number
#define PORT (PORTD) ... | true |
1fece33212e2fa8e565cdb4f26c0ee5d8847e200 | C++ | achieverForever/Raytracer | /Util.cpp | UTF-8 | 2,117 | 2.96875 | 3 | [] | no_license | #include "Util.h"
#include "Variables.h"
Light::Light() : type(POINT), position(0.0f), color(0.0f), attenuation(1.0f, 0.0f, 0.0f) { }
Light::Light(LightType t, float x, float y, float z, float r, float g, float b, float konst/* =1.0f */, float linear/* =0.0f */, float quad/* =0.0f */)
{
type = t;
position = vec3(x... | true |
4a4002f0e8387d002ee2d47ec38bd27f2e876a2e | C++ | jbriede/Compiler | /source/Access.h | UTF-8 | 557 | 2.671875 | 3 | [] | no_license | #ifndef Access_h
#define Access_h
#include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>
#include "Operation.h"
using namespace std;
class Access : public Operation
{
public:
Access(Id* array, Expression* index, Type* type, int line): Operation(new Word("[]", ARRAY, line), type, line)
{
... | true |
7b0005645368d3fceca2561ec8595f0f77400524 | C++ | atu-guda/stm32oxc | /inc/oxc_outstr.h | UTF-8 | 1,184 | 2.640625 | 3 | [] | no_license | #ifndef _OXC_OUTSTR_H
#define _OXC_OUTSTR_H
#include <oxc_io.h>
//* Class to use OutStream feature for string buffer
//* Used external buffer, no locks - only for simple local usage
class OutStr: public DevOut {
public:
OutStr( char *ext_buf, unsigned buf_sz ) :
buf( ext_buf ), bsz( buf_sz ) { buf[0] = '\0... | true |
b7782aee937387c081ef036fb401a03481d29fae | C++ | taichuai/cpp_practice | /code/函数的分文件编写.cpp | UTF-8 | 740 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | # include<iostream>
# include<string>
# include "swap.h"
using namespace std;
//函数的分文件编写
//实现两个数字的交换
// void swap(int a, int b);
// void swap(int a, int b)
// {
// int temp = a;
// a = b;
// b = temp;
// cout << "a= " << a << endl;
// cout << "b= " << b << endl;
// }
// //1、创建 .h后缀名的头文件
// /... | true |
0c811d11de66b933d6a528de170713e420d7dba2 | C++ | OminousBlackCat/leetcode_algorithm_prac | /leetcode_32_longestParentheses_stack/leetcode_32_longestParentheses_stack/leetcode_32_longestParentheses_stack.cpp | UTF-8 | 1,779 | 3.171875 | 3 | [] | no_license | // leetcode_32_longestParentheses_stack.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int longestValidPatentheses(string s) {
vector<int> stack;
vector<int> produce;
int answer = 0;
int previous_success = 0;
... | true |
86cbff5b10160fc5affa08037ef6371ede81c128 | C++ | AdamGray31/Programming | /Stage 3/CSC3223 - Graphics for Games/OpenGL Rasteriser/OpenGLGraphics/Renderer.h | UTF-8 | 1,220 | 2.625 | 3 | [] | no_license | #pragma once
#include "../nclgl/OGLRenderer.h"
#include "RenderObject.h"
#include <vector>
using std::vector;
struct Light {
Vector3 position;
float radius;
Vector3 colour;
};
class Renderer : public OGLRenderer {
public:
float time;
GLuint brickTex;
GLuint brokenBrickTex;
GLuint heightMap;
float tessLe... | true |
7231c2abba31807d8bc4f4a895dc04113a88184b | C++ | wxywxywxy921/wxywxywxy921 | /8.data_structure/implement_stack/implement_stack.h | UTF-8 | 1,180 | 3.921875 | 4 | [] | no_license | struct Node
{
int val;
Node *next;
Node *prev;
};
class Stack {
public:
Node *curr;
Stack()
{
curr = NULL;
}
// Push a new item into the stack
void push(int x) {
// Write your code here
if(curr == NULL)
{
curr = new Node;
curr->val = x;
curr->prev = NULL;... | true |
4b214e78595bfb3cbab509dd10b95c6c4d81d63b | C++ | watsonix/brainbotcode | /arduino/hrv_low_detect/hrv_low_detect/hrv_low_detect.ino | UTF-8 | 4,816 | 2.546875 | 3 | [] | no_license | /*
motor on every heartbeat
rohan dixit 2014
ECG
// baseline is the moving average of the signal - the middle of the waveform
// the idea here is to keep track of a high frequency signal, HFoutput and a
// low frequency signal, LFoutput
// The HF signal is shifted downward slightly (heartbeats are negative peaks... | true |
d51dee8a5bdd0f49907aa9ae38cea6712a815f6f | C++ | joshru/Maze_Generator_CPP_Port | /main.cpp | UTF-8 | 378 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include "Maze.h"
//struct Cell {
//
//};
int main() {
using namespace std;
// Maze m(5, 5, false);
// m.display();
// cout << "Hello, World!" << endl;
// Maze maze = Maze(5, 5, true);
// maze.display();
Maze maze = Maze(10, 10, true);
maze.display();
// maze = Ma... | true |
8c8ec62bc0301318affd3a0acc1f746b52e84ce8 | C++ | ravikr126/Data-Structures-And-Algorithms-Hacktoberfest18 | /cpp/algorithms/substring_occurences.cpp | UTF-8 | 2,002 | 3.4375 | 3 | [] | no_license | /*Найдите все вхождения шаблона в строку. Длина шаблона – p, длина строки – n. Время O(n + p), доп. память – O(p).
-> Вариант 1. С помощью префикс-функции;
Вариант 2. С помощью z-функции.
Формат входного файла
Шаблон, символ перевода строки, строка.
Формат выходного файла
Позиции вхождения шаблона в строке.
Время: ... | true |
97b068bf4e7f0dbeb33775a0e14f3299e6b8936b | C++ | ultramagnus007/Matrix | /Tree/OddEvenDiff.cpp | UTF-8 | 648 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include "BST.h"
using namespace std;
void OddEvenSum(node *ptr, int &OS, int &ES, int level)
{
if(ptr == NULL)
return;
if(level%2==0)
ES+=ptr->key;
else
OS+=ptr->key;
OddEvenSum(ptr->left, OS, ES, level+1);
OddEvenSum(ptr->right, OS, ES, level+1);
}
int main()
{
BST bst;
bst.... | true |
9fb29a11d0a3cf117fa01d3db6bade95a02265ca | C++ | acton393/incubator-weex | /weex_core/Source/include/wtf/DeprecatedOptional.h | UTF-8 | 1,468 | 2.609375 | 3 | [
"Apache-2.0",
"MIT",
"BSD-3-Clause"
] | permissive | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | true |
925b42875d34a0909cb8a18ff87125955b04a2c6 | C++ | strengthen/LeetCode | /C++/256.cpp | UTF-8 | 1,205 | 3.265625 | 3 | [
"MIT"
] | permissive | __________________________________________________________________________________________________
class Solution {
public:
int minCost(vector<vector<int>>& costs) {
if (costs.empty() || costs[0].empty()) return 0;
vector<vector<int>> dp = costs;
for (int i = 1; i < dp.size(); ++i) {
... | true |
b2d92cac6b23fdeed73a3993b3c5f97ffadc12fb | C++ | rishabkr/Competitive-Programming | /interviewbit_random/path_with_good_nodes.cpp | UTF-8 | 802 | 2.59375 | 3 | [] | no_license | int result;
int num;
void dfs(int v, int count, vector<int> &A, vector<bool> vis, vector<vector<int>> &adj){
vis[v]=1;
for(int child: adj[v]){
if(vis[child]==0){
if(A[child-1]) dfs(child, count+1, A, vis, adj);
else dfs(child, count, A, vis, adj);
}
}
... | true |
3962b6db47b2a8e0abe3782bec1fc99c2e7caab4 | C++ | pazamelin/balanced-trees | /treelib/include/detail/splay.tpp | UTF-8 | 9,637 | 3.0625 | 3 | [] | no_license | #pragma once
#include <exception>
#include <iostream>
namespace tree
{
template <typename Key, typename Compare>
splay<Key, Compare>::splay() = default;
template <typename Key, typename Compare>
void splay<Key, Compare>::clear_cache() const
{
cmp_cache.clear();
while (!path_cache.empty())
{
path_cache... | true |
db76a3787d8edb8cd299db463bd399d586984777 | C++ | Yac836/leetcode | /139.wordBreak.cpp | UTF-8 | 650 | 2.640625 | 3 | [] | no_license | //
// Created by zhaohongyan on 2020/6/26.
//
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
bool wordBreak( string s, vector<string>& wordDict) {
vector<bool> dp(s.size()+1);
dp[0] = true;
for (int i = 1; i <= s.size(); ++i) {
for(int j = 0; j < i... | true |
50c64cb0dda2db8fe7a2ab6a420610d206be8a3f | C++ | kothiga/ACM-ICPC | /NARMR2011/5736/5736.cc | UTF-8 | 4,233 | 3.015625 | 3 | [] | no_license | //
// Solution for ACM-ICPC 5736 - Contour Tracing
// (North America - Rocky Mountain Regional 2011)
//
// Compile : g++11 -std=c++11 -o 5736 5736.cc -Wall
// Written by : Austin Kothig
// Semester : SPRING 2017
// Problem : Given an 'image', trace any contours, then
// compile a list of the... | true |
0db5c4cba29a7a3b4b65ca55ee78a8541724262d | C++ | AnimeGirl110/wasm-asteroids | /src/Asteroid.cpp | UTF-8 | 477 | 2.65625 | 3 | [] | no_license | #include "Asteroid.hpp"
#include <stdio.h>
#define NUM_SIZES 4
#define SIZE_FACTOR 40
Asteroid::Asteroid()
: size(NUM_SIZES),
dimX(size * SIZE_FACTOR),
dimY(dimX),
posX(0),
posY(0)
{
printf(" Asteroid::Asteroid()\n");
}
Asteroid::Asteroid(Asteroid *parent)
: size(parent->GetSize(... | true |
a08e713315f9c862f5f600695a8914339a630cae | C++ | Rexagon/cybr | /app/GUI.h | WINDOWS-1251 | 1,421 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <memory>
#include <vector>
#include <string>
#include <map>
#include "Layout.h"
#include "VerticalLayout.h"
#include "HorizontalLayout.h"
#include "Widget.h"
#include "Label.h"
class GUI
{
public:
enum Alignment
{
AlignLeft = 1 << 0,
AlignRight = 1 << 1,
AlignHCent... | true |
79affd0b85e1187a0b305180c3076cf335d8b0a8 | C++ | vxd7/labs | /Histogrammer/F/hgram.h | UTF-8 | 2,720 | 3.53125 | 4 | [] | no_license | #include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
struct __barInfo
{
std::string name;
int freq;
};
class Histogram {
public:
/* Number of bars in the Histogram */
int barCount;
/* Block type to print */
char block;
/* Standart constructor */
Histogram();
/*
* User Interfac... | true |
2e47655a281fd0faadb66323f819471c91931941 | C++ | gsol10/r2p2 | /linux-apps/lucene-r2p2/inc/lucene++/OpenBitSet.h | UTF-8 | 8,516 | 2.703125 | 3 | [
"MIT"
] | permissive | /////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
// Distributable under the terms of either the Apache License (Version 2.0)
// or the GNU Lesser General Public License.
////////////////////////////////////////////////////////////... | true |
1fddb5c1957ee904585907dda457daa5988c241f | C++ | jt396/XOF-WolfX | /Audio/XOF_AudioRequest.hpp | UTF-8 | 2,393 | 2.75 | 3 | [] | no_license | /*
===============================================================================
XOF
===
File : XOF_AudioRequest.hpp
Desc : Allows game objects to make requests of the audio system,
used to implement basic batched upating. Objects submit
requests then the game loop tells the audio system to
processe... | true |
f4b32686e89062be01a97131092381bb9324c4d5 | C++ | aishoot/CAPSolutions | /CCF201312/T3/main.cpp | UTF-8 | 516 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
using namespace std;
int main()
{
int num,i,j;
ifstream cin("test.txt");
while(cin>>num)
{
int area, max_area=0, t;
vector<int> height;
for(i=0;i<num;i++)
{
cin>>t;
height.push_back(t);
for(j=i;j>=0;j-... | true |
9573af95c9c774fa2e0f267ea474f26c5f18870f | C++ | xingfeT/c-practice | /day-001-100/day-012/problem-2/main.cpp | UTF-8 | 997 | 3.96875 | 4 | [] | no_license | /*
* Write, compile, and execute a C program that calculates the distance
* between two points whose coordinates are (7, 12) and (3, 9). use the
* fact that the distance between two points having coordinates (x1, y1)
* and (x2, y2) is distance = sqrt((x1 - x2)^2 + (y1 - y2)^2).
*/
#include <stdio.h>
#include <ma... | true |
b8938be4d32d30c90e7c075d22f6d53d9e66534c | C++ | isysoi3/Programming | /c++/1 сем/english_money/english_money/english_money.cpp | WINDOWS-1251 | 1,562 | 3.578125 | 4 | [] | no_license | // english_money.cpp: .
//
#include <iostream>
#include "money.h"
using namespace std;
void input(long int *pound, int *shilling, double *pence) {
long int a;
int b;
double c;
cout << "Enter pounds ";
cin >> a ;
*pound = a;
cout << "Enter shilings ";
cin >> b;
*shilling = b;
cout << "Enter pences ";... | true |
9ee0b8f077aa68d891c80aa1ce63b12ce1852861 | C++ | liecn/algorithms | /CSE_830/hw2/hw2_1.cpp | UTF-8 | 614 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <new>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int n;
int a, b;
cin >> n;
// read input matrix
int *p = new int[n];
for (int i = 0; i < n; i++)
{
cin >> a >> b;
p[i] = a - b;
}
int i,j = 0;
for (i ... | true |
f6bb31c982013513acd5d8400302eaefdfc48720 | C++ | jpan127/esp32-drivers | /main/tasks/TemperatureReadTask.hpp | UTF-8 | 1,010 | 2.859375 | 3 | [] | no_license | #pragma once
#include "DS18B20.hpp"
#include <freertos/FreeRTOS.h>
#include <esp_log.h>
#include <driver/gpio.h>
#define SENSOR_PIN (GPIO_NUM_23)
void TemperatureReadTask(void *p)
{
DS18B20 sensor(SENSOR_PIN);
ESP_LOGI("TemperatureReadTask", "Starting task...");
while (1)
{
v... | true |
fe3afd3eaaaccdf07953fdd6f5e8d92381522717 | C++ | enaim/Competitive_Programming | /CodeChef/Smallest Numbers of Notes.cpp | UTF-8 | 648 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
// freopen("in.txt","r",stdin);
// freopen("output.txt","w",stdout);
int tks,ks=1,cnt,n,x;
scanf("%d",&tks);
while(tks--)
{
cnt=0;
scanf("%d",&n);
x=n/100;
n = n%100;
... | true |
87be9ef59b110fdebab78303278929e17aea9674 | C++ | redcapital/algo | /timus/1924.cpp | UTF-8 | 566 | 3.5625 | 4 | [] | no_license | // It doesn't matter if you put plus or minus sign between numbers, the overall
// parity won't change.
// Every pair will be reduced to either odd or even number. You'll get odd
// if one of the numbers is odd and one is even, otherwise you get even number.
//
// In order for overall parity to be odd, the number of od... | true |
bb80be0806e4741515681f1c8e12bff952844688 | C++ | LauraDiosan-CS/lab8-11-polimorfism-Teona09 | /Lab 8-11/UI.cpp | UTF-8 | 3,350 | 3.28125 | 3 | [] | no_license | #include "UI.h"
void UI::menu() {
cout << endl;
cout << '\t' << "Menu:" << endl;
cout << '\t' << "1.Log in" << endl;
cout << '\t' << "2.Operating Menu" << endl;
cout << '\t' << "3.Log out" << endl;
cout << '\t' << "4.Exit" << endl;
cout << '\t' << "Your option:" << endl;
}
void UI::logIn() {
if (service.logge... | true |
33a9959556cbe47453d629efa0494c7c2eab40ce | C++ | marcinlos/zephyr | /Zephyr/src/zephyr/core/Task.hpp | UTF-8 | 1,136 | 3.140625 | 3 | [] | no_license | /**
* @file Task.hpp
*/
#ifndef ZEPHYR_CORE_TASK_HPP_
#define ZEPHYR_CORE_TASK_HPP_
#include <memory>
namespace zephyr {
namespace core {
/** Pointer type holding the task */
typedef std::shared_ptr<class Task> TaskPtr;
/**
* Base class for tasks scheduled for execution in the main loop. Each
* iteration, `upd... | true |
a1d0846a68c1552c633bea4c5b35195d62007830 | C++ | miglesias91/herramientas_desarrollo | /utiles/source/Stemming.cpp | UTF-8 | 1,549 | 2.703125 | 3 | [
"MIT"
] | permissive | #include <utiles/include/Stemming.h>
// stl
#include <locale>
#include <codecvt>
using namespace herramientas::utiles;
stemming::spanish_stem<> Stemming::stem_spanish;
Stemming::Stemming()
{
}
Stemming::~Stemming()
{
}
void Stemming::stemUTF8(std::string & string_a_hashear)
{
std::wstring_... | true |
e4e907724a2b1498f9cbe03ab3512c70828c01e7 | C++ | XiaotaoChen/coding-interview | /swordfingeroffer/sum_in_bits.cc | UTF-8 | 298 | 2.78125 | 3 | [] | no_license | #include "../swordfingeroffer.h"
namespace sword_finger_offer
{
int sum_in_bits(int num1, int num2) {
while(num2 != 0) {
int cal = (num1 & num2) <<1; // 进位
num1 = num1 ^ num2; // 本位结果
num2 = cal;
}
return num1;
}
} // namespace sword_finger_offer
| true |
2678325f859004105bcb4775e6fa1ed67ffe0f4c | C++ | BilalAli181999/Programming-Fundamentals-in-C_Plus_Plus | /Float to Binary/Float to Binary/IEEE.cpp | UTF-8 | 2,758 | 2.703125 | 3 | [] | no_license | #include<iostream>
#include<math.h>
#include"IEEE.h"
using namespace std;
void binaryMant(int bin[],float mant,int i)
{
float c = mant;
while (c != 0 && i<32)
{
bin[i] = c * 2;
c = (c * 2) - (int)(c * 2);
i++;
}
}
int *binaryExp(int exp,int &i)
{
int *bin = new int[33];
while (exp != 0)
{
bin[i] = ex... | true |
9698b21ed78e980f142720753febbc92052e8e71 | C++ | Munvik/Tower-Defense | /iceTower.cpp | UTF-8 | 8,524 | 2.8125 | 3 | [] | no_license | #include "pch.hpp"
#include "iceTower.hpp"
#include "mainGame.hpp"
iceTower::iceTower()
{
textureName = "iceTower";
loadTexture();
setAttributes();
}
iceTower::~iceTower()
{
}
void iceTower::setAttributes()
{
cost = 150;
power = 0;
slow = 0.10f;
range = 160.f;
speed = 400.f;
levelA... | true |
eebcc9010946ecc4980bbaa2877b4d3a3043f538 | C++ | clambassador/seasick | /csv_filter_len.cc | UTF-8 | 1,145 | 2.828125 | 3 | [] | no_license | #include <cassert>
#include <iostream>
#include <set>
#include <string>
#include "ib/fileutil.h"
#include "ib/logger.h"
#include "ib/tokenizer.h"
using namespace ib;
using namespace std;
int main(int argc, char** argv) {
if (argc != 4) {
Logger::error("usage: % colnum op len", argv[0]);
return -1;
}
size_t co... | true |
a641e08b6555451a7d5e253905c2305651ab9b5c | C++ | Yobretaw/AlgorithmProblems | /Leetcode/Stack&Queue/evaluateReversePolishNotation.cpp | UTF-8 | 1,746 | 3.859375 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <string.h>
#include <sstream>
#include <stack>
#include <queue>
#include <utility>
#include <unordered_map>
using namespace std;
int eval(int a, int b, string op);
/* Evaluate the value of an arthimetic expression in
* Reverse Polish Notation.
*
* V... | true |
a906c311ce63827cc745c353d2350587f0e2431c | C++ | KhanhMachinLearning/Coding-Inteview | /Amazon/PythagoreanTriplet.cpp | UTF-8 | 646 | 3.203125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool Check_Pythagrean_Triplet(int a[],int n);
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
if(Check_Pythagrean_Triplet(a,n))
cout<<"Yes"<<endl;
else
cout<<"No"<<endl;
}
retu... | true |
7fe8576ed8532c7aae1618a9b8673a9e186e7268 | C++ | muhammadhasan01/lembar-contekan-HMF | /DS/Bit Fenwick Tree.cpp | UTF-8 | 426 | 2.625 | 3 | [] | no_license | int BIT[1000], a[1000], n;
void update(int x, int val){
for(; x<=n ; x+=x&-x){
BIT[x] += val;
}
}
void update2(int x, int val){
for(; x<0 ; x|=(x+1)){
BIT[x] += val;
}
}
int query(int x){
int sum = 0;
for(; x>0 ; x-=x&-x){
sum += BIT[x];
}
return sum;
}
int qu... | true |
418cae285ecf0c28d6e4d4bd171c81786e1436d3 | C++ | DvnOshin/ACM_CONTEST_QUESTIONS | /Append_And_Delete.cpp | UTF-8 | 3,672 | 4 | 4 | [] | no_license | You have a string of lowercase English alphabetic letters. You can perform two types of operations on the string:
Append a lowercase English alphabetic letter to the end of the string.
Delete the last character in the string. Performing this operation on an empty string results in an empty string.
Given an integer, k, ... | true |
024f26035441a532f701af59b8c057d4b1ff2355 | C++ | RichardAth/Projects | /Int128/int128.h | UTF-8 | 64,322 | 2.859375 | 3 | [] | no_license | #pragma once
#undef _CRT_SECURE_NO_WARNINGS // prevent warning message
#define _CRT_SECURE_NO_WARNINGS 1
typedef struct {
uint64_t i[2];
} _S2;
typedef struct {
unsigned int i[4];
} _S4;
typedef struct {
unsigned short s[8];
} _S8;
typedef struct {
unsigned char b[16];
} _S16;
#define HI64(n) (n).s2.i[1]
... | true |
b2b13efecb8aa37531de5dfb1cbfd6c46a8c1808 | C++ | GarryLiuN/CS343-Project | /src/nameserver.h | UTF-8 | 1,520 | 2.890625 | 3 | [] | no_license | #ifndef __NAMESERVER_H__
#define __NAMESERVER_H__
#include <vector>
#include "printer.h"
#include "vendingmachine.h"
_Task NameServer {
private:
// reference
Printer& prt;
// attributes
unsigned int numVendingMachines;
unsigned int numStudents;
/** @brief studentIndex vector is used to sto... | true |
19a9a4cfe780e3f912e8d50605cd7a4b2792fc2c | C++ | wlc123456/fsmlite | /tests/test_scoped.cpp | UTF-8 | 839 | 3.1875 | 3 | [
"MIT"
] | permissive | #include <cassert>
#include <type_traits>
#include "fsm.h"
enum class State { Init, Exit };
class state_machine: public fsmlite::fsm<state_machine, State> {
friend class fsmlite::fsm<state_machine, State>; // base class needs access to transition_table
public:
struct event {};
private:
using transition... | true |
e345ac70f9773fb6d51aab18cf1a074402dec092 | C++ | Caroline-Wendy/Beauty-of-Programming | /BoP_2.7_gcd.cpp | UTF-8 | 981 | 3.515625 | 4 | [
"BSD-3-Clause"
] | permissive | /*From Beauty of Programming, By C.L.Wang*/
#include <iostream>
using namespace std;
typedef unsigned long long int ULLI;
bool isEven(const ULLI& x){
unsigned int temp;
temp = x%2;
if(temp == 0){
return true;
}else{
return false;
}
}
ULLI gcd(const ULLI& x, const ULLI& y){
if(x < y) return gcd(y, x);
if... | true |
d0aebde07b510860897c90ec2020df12c957d9aa | C++ | HuangZhiChao95/Data-Structure-HW | /homework2_2.cpp | UTF-8 | 1,132 | 3.15625 | 3 | [] | no_license | struct SNode{
int data;
SNode *next;
SNode():data(0),next(NULL){}
};
void mergeList(LinkList &HA,LinkList &HB,LinkList &HC){
/*第一个表的指针*/
SNode *fir=HA.head;
/*第二个表的指针*/
SNode *sec=HB.head;
/*结果表的指针,临时建立一个表头指针*/
SNode *res=new SNode();
/*保存表头指针*/
SNode *head=res;
/*存储临时需要保存的下一节点*/
SNode *temp=0;
while (... | true |
331ab68f07a33b51c7d889003cb520b7ea040c04 | C++ | hiragisorah/seed-engine | /seed-engine/texture.h | UTF-8 | 348 | 2.65625 | 3 | [] | no_license | #pragma once
namespace Seed
{
class Texture
{
public:
virtual unsigned int width(void) { return 0; }
virtual unsigned int height(void) { return 0; }
public:
template<class _Type> void width(void) { return static_cast<_Type>(this->width()); }
template<class _Type> void height(void) { return static_cast<_Ty... | true |
391c650916a15242cf129953a45abb0c4ed8ce14 | C++ | nurnaff/logika_c | /inputarra.cpp | UTF-8 | 205 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
main() {
int nilai[5];
for(int i=0;i<5;i++){
printf("Nilai ke-%d",i+1);printf(":");scanf("%d",&nilai[i]);
}
for(int i=0;i<5;i++){
printf(" %d",nilai[i]);
}
getch();
}
| true |
ed95b92b4be9ea1fd54feae664cfb0e913fb90bd | C++ | yogitaghadage/c- | /Bitwiseoperations.cpp | UTF-8 | 1,815 | 3.75 | 4 | [] | no_license | #include<stdio.h>
typedef unsigned int UINT;
/*1.Write a program which accept one number from user and off 7th bit of that
number. Return modified number.*/
UINT OffBit(UINT iNo)
{
UINT iresult=0;
UINT mask=0x00000040;
mask=~mask;
iresult=iNo & mask;
return mask;
}
//2. Write a program which... | true |
ea6799d4edd83fc6c7486a17efd3436b3a6ce4a4 | C++ | mayotte203/Baka-Floppy | /Baka Keys/Baka_Keys.ino | UTF-8 | 1,930 | 2.59375 | 3 | [] | no_license | #include <MIDI.h>
//const byte rowsPins[6] = {12, 11, 10, 13, 14, 15};
const byte rowsPins[6] = {15, 14, 13, 10, 11, 12};
const byte columnsPins[6] = {9, 8, 7, 6, 5, 4};
bool buttonsStates[36] = {};
MIDI_CREATE_DEFAULT_INSTANCE();
int noteON = 144;//144 = 10010000 in binary, note on command
int noteOFF = 128;//128 =... | true |
c2d27da08567784c3d154e2ab5d2de50222db4e6 | C++ | weicse/CS446 | /Project 01/ConfData.h | UTF-8 | 1,504 | 2.984375 | 3 | [] | no_license | /**
* @file ConfData.h
* @brief Definition file for ConfData class
* @author Wei Tong
* @details Specifies all members of ConfData class
* @version 1.00
* Wei Tong (7 February 2018)
* Initial development, functions will possibly
* be used in the future
*/
#include <string>
#include <iostream>
#include ... | true |
c31fa3c281c4ff6afeec2f7e08147e0e51abf4e2 | C++ | kckwan5/code_test_1 | /order_book.h | UTF-8 | 2,292 | 2.890625 | 3 | [] | no_license | #include <unordered_map>
#include <mutex>
#include <queue>
#include <memory>
namespace UnitTest
{
class Tester;
}
class OrderBookInterface
{
public:
typedef uint64_t qty_type;
typedef uint64_t stock_id_type;
typedef uint64_t client_id_type;
typedef uint64_t order_id_type;
typedef uin... | true |
78d9fd54b434f0127a651203de8b7b386f115562 | C++ | jamesmagnus/light_of_paladin | /Light_of_Paladin/ClassConsommable.cpp | UTF-8 | 969 | 2.65625 | 3 | [] | no_license | #include "StdLibAndNewOperator.h"
#include "ClassConsommable.h"
#include "ExceptionPerso.h"
using namespace std;
Consommable::Consommable(Ogre::SceneNode *pNode, EShape shapeType, int prix, float poid, std::string const& nom, bool IsUnique, bool IsVisible) :Item(pNode, shapeType, prix, poid, nom, IsUnique, IsVisible... | true |
303805926fbdf2c3de282f8a8a5665600919f276 | C++ | Capri2014/math | /stan/math/prim/mat/fun/inv_square.hpp | UTF-8 | 880 | 3.015625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #ifndef STAN_MATH_PRIM_MAT_FUN_INV_SQUARE_HPP
#define STAN_MATH_PRIM_MAT_FUN_INV_SQUARE_HPP
#include <stan/math/prim/mat/vectorize/apply_scalar_unary.hpp>
#include <stan/math/prim/scal/fun/inv_square.hpp>
namespace stan {
namespace math {
/**
* Structure to wrap inv_square() so that it can be vectorized.
* @param ... | true |
fc4256ed08caf8df4590dfae594a6600a7eff1c7 | C++ | coollama11/cpp | /tests/DDanh5.cpp | UTF-8 | 6,527 | 3.390625 | 3 | [] | no_license | //=============================================================//
// Name: Diana Danh
// CSc 103
// Project 5 > Matching Game
//=============================================================//
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <ctime>
#... | true |
a942b8f652845154ec3acad1bf99acc404ee2c1f | C++ | Tanjim131/Problem-Solving | /UVa/301.cpp | UTF-8 | 2,064 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <tuple>
#include <vector>
#include <algorithm>
class Order{
public:
int source, destination, passangers;
friend std::istream& operator >> (std::istream&, Order&);
bool operator < (const Order &order) const{
return std::tie(source, destination, passan... | true |
1d7eebeb67eae9d9f95ee8dce818cf83937ba5b0 | C++ | jsunlove/wangdao-data-structure | /ch2/static-link/with.cpp | UTF-8 | 375 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define MaxSize 10
struct Node
{
int data;
int next;
};
typedef struct
{
int data;
int next;
} SLinkList[MaxSize];
int main()
{
struct Node x;
printf("sizeX=%d\n", sizeof(x));
struct Node a[MaxSize];
printf("sizeA=%d\n", sizeof(a));
SLinkList b... | true |
99f21dc1f7cedbca4c22c96c8a511b090e7671a6 | C++ | tyszek00/DodatekDoEmerytury | /main.cpp | UTF-8 | 3,685 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <math.h>
#include <conio.h>
using namespace std;
bool sprawdzPoprawnoscWprowadzonegoZnaku(char znak);
bool sprawdzPoprawnoscWprowadzonegoZnakuDlaKapitalizacji(char znak);
int main() {
float pozadanaMiesiecznaEmerytura;
float oprocentowanieLokaty;
... | true |
3d18eeb975f844fc7cdfd19f8fc3bc5b8f918636 | C++ | rustysec/fuzzypp | /Roll.h | UTF-8 | 887 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef ROLL_H_
#define ROLL_H_
#include "FuzzyConstants.h"
#include <vector>
namespace FuzzyPP {
class Roll {
std::vector<unsigned char> _window = std::vector<unsigned char>(FuzzyConstants::I().RollingWindow);
unsigned int _h1;
unsigned int _h2;
unsigned int _h3;
unsigned ... | true |
366797fe53dcfe52e0b3fb600985fec710129895 | C++ | JoaoBarros93/AEDA | /src/area.cpp | UTF-8 | 947 | 3.265625 | 3 | [] | no_license | #include "area.h"
Area::Area(){
}
Area::Area(stringstream& s) {
string newAreaName, newSubAreaName, newAreaNameSigla, newSubAreaNameSigla;
if (!getline(s, newAreaName, ';'))
cout << "Error reading area name" << endl;
this->areaName = newAreaName;
if (!getline(s, newSubAreaName, ';'))
cout << ... | true |
69466771763d1494a357b1de3034e2e0bd622614 | C++ | matgrz/GenAlgorithm | /GenAlgorithm/dataplotting/DataWriter.cpp | UTF-8 | 1,185 | 3 | 3 | [] | no_license | #include "DataWriter.h"
#include <ctime>
#include <fstream>
namespace dataplotting
{
DataWriter::DataWriter(const std::string& path) : appPath{path}
{
if (!std::filesystem::exists(path + dataDirName))
std::filesystem::create_directory(path + dataDirName);
}
void DataWriter::saveData(const algorithm::type... | true |
fadf0a5e82f6f59feb6134834f69807b877a21e4 | C++ | karaketir16/competitive | /karaketir16/tst.cpp | UTF-8 | 2,445 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define pb push_back
#define fi first
#define sc second
#define inf 1000000000000000LL
#define MP make_pair
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define dbg(x) cerr<<#x<<":"<<x<<endl
#define N 100005
#define MOD 1000000007
#define orta ((a+b)/2)
... | true |
f0d24012a0bbdf8db261537c6b02dbc290b13d65 | C++ | kunichan9292/Programing-contest | /AtCoder/APG4b/B-Minesweeper.cpp | UTF-8 | 1,019 | 2.53125 | 3 | [] | no_license | #include<iostream>
#define _GLIBCXX_DEBUG
using namespace std;
int main(){
int H,W;
int c[30][50];
string S;
cin >> H >> W;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
c[i][j]=0;
}
}
for(int i=0;i<H;i++){
cin >> S;
for(int j=0;j<W;j++){
if(S[j]=='#' && (i!=0 || i!=W-1)){
c[i]... | true |
bc0f2ded19fc619788167982ce2d1248c949ffee | C++ | strengthen/LeetCode | /C++/736.cpp | UTF-8 | 6,121 | 3.4375 | 3 | [
"MIT"
] | permissive | __________________________________________________________________________________________________
sample 8 ms submission
#define DEBUG 0
class LispExpr {
private:
unordered_map<string, int> data; // store the data for current expression; a better name is "context"
public:
LispExpr () {}
LispExpr (unordered... | true |
f620e155123273fc04eb64c9ed0f2b56ad387df0 | C++ | laravignotto/books_exercises | /Programming_Principles_and_Practice_Using_C++/chapter-4/ch4-ex6.cpp | UTF-8 | 884 | 3.953125 | 4 | [] | no_license | #include "std_lib_facilities.h"
int main()
{
vector<string> v = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
char choice = {' '};
cout << "Would you like to convert digits to words ('d') or words to digits ('w')?" << endl;
cin >> choice;
if (choice == 'd') {... | true |
03d10b07b263e66023ce664040634de862c6259c | C++ | TheRoD2k/SquareCalculator | /Test/SquareCalculator.h | UTF-8 | 943 | 3 | 3 | [] | no_license | #pragma once
#include <variant>
#include "Figure.h"
class SquareCalculator {
public:
// SquareCalculator(Figure fig, ...); - other possible realization
SquareCalculator(Figure fig, double x0, double y0, double radius);
SquareCalculator(Figure fig, double x1, double y1, double x2, double y2, double x3, double y3, do... | true |
1d8a3f4d71bd77096161608dcaece345279322ba | C++ | idadue/ComputationalPhysics | /project1/main.h | UTF-8 | 8,958 | 3.1875 | 3 | [] | no_license | #ifndef MAIN_H
#define MAIN_H
#include <fstream>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <armadillo>
#include <time.h>
/*
* This part checks during pre proccessing what system the user is using. If the user is using windows, they should have
* direct.h and io.h located on t... | true |
aa84e8594e392b21c4134c0adcd12467106ab626 | C++ | dedowsdi/journey | /gl4/demo/parallaxmap/parallaxmap.cpp | UTF-8 | 9,355 | 2.703125 | 3 | [] | no_license | /*
* Parallax map.
*
* Normalmap tried to use coarse grained geometry instead of fine grained
* geometry, it reserved normals of fined grained geometry in normal map(tangent
* space), but it doesn't reserve the surface detail, tangent space surface is
* always flat, which means the vertex point you look at in a c... | true |
e8f7a74a0d77493e11efa47560cf4df9fde57e2a | C++ | Gregory-Meyer/polymorphic-allocator | /include/pool_allocator.hpp | UTF-8 | 11,286 | 2.875 | 3 | [] | no_license | #ifndef GREGJM_POOL_ALLOCATOR_HPP
#define GREGJM_POOL_ALLOCATOR_HPP
#include "polymorphic_allocator.hpp" // gregjm::PolymorphicAllocator,
// gregjm::MemoryBlock,
// gregjm::PolymorphicAllocatorAdaptor,
// gre... | true |
81be886dbe3e737af3ee3835cfd91b6089c4003e | C++ | zhaocc1106/my-leetcoding | /c++/translateNum.cpp | UTF-8 | 2,527 | 3.921875 | 4 | [] | no_license | /**
* 把数字翻译成字符串
*
* 给定一个数字,我们按照如下规则把它翻译为字符串:0 翻译成 “a” ,1 翻译成 “b”,……,11 翻译成 “l”,……,25 翻译成 “z”。一个数字可能有多
* 个翻译。请编程实现一个函数,用来计算一个数字有多少种不同的翻译方法。
*
* https://leetcode-cn.com/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
in... | true |
a82041771217b24f60a9ca26a6fb792d1dcc8435 | C++ | mugisaku/gamebaby-20180928-dumped | /libgbsnd/object.hpp | UTF-8 | 4,392 | 2.765625 | 3 | [] | no_license | #ifndef LIBGBSND_OBJECT_HPP
#define LIBGBSND_OBJECT_HPP
#include<cstdint>
#include<cstdio>
#include<memory>
#include"libgbstd/string.hpp"
#include"libgbsnd/shared_string.hpp"
#include"libgbsnd/device.hpp"
#include"libgbsnd/list.hpp"
namespace gbsnd{
class execution_context;
namespace stmts{
class stmt;
class st... | true |
f0f3e6547bab0eb324409a05e1a896aedceb1b38 | C++ | helderdantas/dca1202-sculptor3D_parte-2 | /sculptor3D_parte2/cutbox.cpp | UTF-8 | 563 | 2.796875 | 3 | [] | no_license | #include "cutbox.h"
cutBox::cutBox(int x0, int x1, int y0, int y1, int z0, int z1)
{
x0_=x0;y0_=y0;z0_=z0;
x1_=x1-1 ;y1_=y1-1;z1_=z1-1;
}
/*
//Liberar a memória.
cutBox::~cutBox(){
}
*/
// Desativa todos os voxels no intervalo x∈[x0,x1], y∈[y0,y1], z∈[z0,z1] e atribui aos mesmos a cor atual d... | true |
c58d9ec78f5cc6f03eafdd0005716ebc797c8869 | C++ | YuLian-yl/LeetCode | /027. Remove Element.cpp | UTF-8 | 1,826 | 4.1875 | 4 | [] | no_license | //
// Created by yulian on 2019-01-23.
//
/*题目:
* 给定一个数组 nums 和一个值 val,你需要原地移除所有数值等于 val 的元素,返回移除后数组的新长度。
不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成。
元素的顺序可以改变。你不需要考虑数组中超出新长度后面的元素。
示例 1:
给定 nums = [3,2,2,3], val = 3,
函数应该返回新的长度 2, 并且 nums 中的前两个元素均为 2。
你不需要考虑数组中超出新长度后面的元素。
示例 2:
给定 nums = [0,1,2,2,3,0,4,2], val... | true |
2ccb5138d04a5b434489fb071356fd40e7b72516 | C++ | tectronics/infinite-bounty | /InfiniteBounty_Game/InfiniteBounty_Project/Source/Message.h | UTF-8 | 6,092 | 2.640625 | 3 | [] | no_license | #ifndef MESSAGE_H_
#define MESSAGE_H_
#include "CMovingObject.h"
enum messageType {MSG_NULL = 0, MSG_CREATE_ARROW, MSG_CREATE_BOMB, MSG_CREATE_FOOD,
MSG_CREATE_SPIRIT_ARCHER,MSG_CREATE_SPIRIT_CHARGER, MSG_CREATE_BEE,
MSG_CREATE_RAGGAMOFFYN, MSG_CREATE_FIREBALL, MSG_CREATE_FIREBREATH,
MSG_CREATE_M... | true |
b89187d8276b1dcc2c1d139befa9c5af2392144c | C++ | scottScottScott/WeAreTalkingAboutPractice | /old/QualifyingContest.cpp | UTF-8 | 644 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
using namespace std;
typedef pair<int, string> pis;
int main() {
int N, M;
cin >> N >> M;
vector<vector<pis>> storage(M + 1);
for(int n = 0; n < N; n++) {
string name;
int region, points;
cin >> name >> region ... | true |
f49a6f10d4e5e646b8b6d758f465ee90c16b0d62 | C++ | Arik096/Fahima-mam_oop_L2T1-codes | /1 extra(MAIN).cpp | UTF-8 | 438 | 3.484375 | 3 | [] | no_license | #include<iostream>
#include<math.h>
using namespace std;
class polar
{
public:
float r,th,x,y;
polar(float a,float b)
{
r=a;
th=b;
}
void call()
{
x=r*cos(th);
y=r*sin(th);
}
void show()
{
cout<<"x="<<x<<" and y="<<y;
}
};
int main()
{
float r,th;
... | true |
d727bade4badfad7b8e7ce1f9f8cd8dad128038a | C++ | rusty34/uni_examples | /TextureLoader.cpp | UTF-8 | 5,683 | 2.5625 | 3 | [] | no_license | /*
Spatial AR Framework - CBL
Copyright (c) 2012 Shane Porter
If you use/extend/modify this code, add your name and email address
to the AUTHORS file in the root directory.
This code can be used by members of the Wearable Computer Lab, University
of South Australia for research purposes. Comm... | true |
3f91a5827fb498b76c2c5f948ea38f2088e59de6 | C++ | macyt357/MacyThomas-CSCI20-Fall2017 | /lab22/lab22.cpp | UTF-8 | 462 | 3.265625 | 3 | [] | no_license | //Macy Thomas
//Lab 2.2
//Random Number Generator
#include <iostream>
#include <time.h> //allows for us to use srand
using namespace std;
void Random(){
cout << "Your Random Number is: "<< endl; //outputs the phrase "Your Random Number is:"
srand (time(NULL)); //produces random number
int number = rand() ... | true |
f488478965ad397f061a818bad037f6043dc1d87 | C++ | isac322/BOJ | /10825/10825.cpp | UTF-8 | 663 | 3.078125 | 3 | [
"MIT"
] | permissive | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct student {
char name[11];
char a, b, c;
bool operator<(const student &right) const {
if (a == right.a) {
if (b == right.b) {
if (c == right.c) {
return strcmp(name, right.name) < 0;
} else return c > right.c;
... | true |