uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
179388f0-52c6-4296-a52e-dc4dc6961f7b | chen-Aaron/Mywork | phantomjs/src/config.cpp | #include "config.h"
#include <QDir>
#include <QFileInfo>
#include <QWebPage>
#include <QWebFrame>
#include "terminal.h"
#include "qcommandline.h"
#include "utils.h"
#include "consts.h"
#include <iostream>
static const struct QCommandLineConfigEntry flags[] = {
{ QCommandLine::Option, '\0', "cookies-file", "Sets... | CONFIG | 0.924657 | 6.236799 |
10c71aa3-855e-4e46-9f5d-692550a83d05 | raptoravis/forwardplusrendering | thirdparty/boost_1_70_0/libs/hana/benchmark/fold_left/compile.hana.basic_tuple.erb.cpp | #include <boost/hana/fold_left.hpp>
#include <boost/hana/basic_tuple.hpp>
namespace hana = boost::hana;
struct f {
template <typename State, typename X>
constexpr X operator()(State, X x) const { return x; }
};
struct state { };
template <int i>
struct x { };
int main() {
constexpr auto tuple = hana::ma... | ALGO | 0.935998 | 3.784502 |
4534a06a-0c59-4e16-aa4e-af09bb67b660 | ROCKCROCK/Project | cc_mini/windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998671 | 6.76073 |
636e0a11-12f9-4709-a148-03eff34d8bb2 | BhargavaRam123/dsa | sortingastack.cpp | #include <iostream>
#include <stack>
using namespace std;
void insertinasortedstack(stack<int> &s,int value)
{
if(s.size()==0||value>s.top())
{
s.push(value);
return;
}
int temp = s.top();
s.pop();
insertinasortedstack(s,value);
s.push(temp);
}
void sortstack(stack<int> &s)
{
if(s.size()==0)
... | ALGO | 0.999909 | 4.471148 |
f7141c6e-7239-471c-8b01-01161ef7cbe0 | zzl20000307/code-learning | C++_data_structures/binary-tree/binary_tree_dfs.cpp | #include "../../include/common.hpp"
vector<int> vec;
// 前序遍历
void preOrder(TreeNode *root)
{
if (root == nullptr)
return;
// 访问优先级:根节点 左子数 右子数
vec.push_back(root->val);
preOrder(root->left);
preOrder(root->right);
}
// 中序遍历
void inOrder(TreeNode *root)
{
if (root == nullptr)
re... | ALGO | 0.999945 | 5.455742 |
e24150f1-78ff-4791-be98-7943d167bc1c | Avninder99/LeetCode_GFG_Solutions | 1480-running-sum-of-1d-array/1480-running-sum-of-1d-array.cpp | class Solution {
public:
vector<int> runningSum(vector<int>& nums) {
int size = nums.size(), sum;
for(int i=1; i<size; i++){
nums[i] += nums[i-1];
}
return nums;
}
}; | ALGO | 0.999826 | 5.995018 |
b93b9085-bff3-4387-8f4d-ac9e6b776267 | C0ldSmi1e/CompetitiveProgramming | Contests/Codeforces-DividebyZero2021andCodeforcesRound714Div.2/A.ArrayandPeaks.cpp | /**
* Author: Daniel
* Created Time: 2021-04-15 16:03:21
**/
// time-limit: 1000
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ER erase
#define IS insert
#define PI acos(-1)
#define PB pop_back
#define MP make_pair
#define MT make_tuple
#define LB lower_bound
#define UB up... | ALGO | 0.999966 | 4.518151 |
1093cd16-b074-4bf5-855b-5311a9e3666f | domathang/algorithm | 백준/단계별/기본 수학 2/베르트랑 공준.cpp | #include<stdio.h>
#include<math.h>
int main()
{
int n,ch,cnt;
scanf("%d",&n);
while(n!=0)
{
cnt=0;
for(int i=n+1;i<=n*2;i++)
{
ch=0;
for(int j=2;j<=sqrt(i);j++)
{
if(i%j==0) {
ch=1;
break;
}
}
if(ch==0 && (i%2==1 || i==2)){
cnt++;
}
}
printf("%d\n",cnt);
sc... | ALGO | 0.99973 | 3.340158 |
4876895a-42f7-4dcf-a178-5f1321631a1b | Ma-Eltohamy/DS-playGround | BSTHomeWork/MediumToHard/2_leetcode_426_bst_to_dll.cpp | #include <cassert>
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
struct TreeNode {
int val{};
TreeNode *left{};
TreeNode *right{};
TreeNode(int val) : val(val) {}
};
struct BinaryTree {
TreeNode *root{};
BinaryTree(int root_value) : root(new TreeNode(root_v... | ALGO | 0.999987 | 5.920135 |
e9e9ab73-1078-44f3-92fd-66a4a09c1df9 | koparasy/openmp-rr | libcxx/test/std/algorithms/alg.sorting/alg.min.max/minmax_comp.pass.cpp | // <algorithm>
// template<class T, StrictWeakOrder<auto, T> Compare>
// requires !SameType<T, Compare> && CopyConstructible<Compare>
// pair<const T&, const T&>
// minmax(const T& a, const T& b, Compare comp);
#include <algorithm>
#include <cassert>
#include <functional>
#include <utility>
#include "test_macr... | TEST | 0.983277 | 5.664051 |
8448ed98-0998-4f3e-9f05-df490cb35d55 | magyarakoos/contest-prog | atcoder/abc392/D/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int INF = 1e18, MAXN = 1e5 + 5, MOD = 1e9 + 7;
#define cases 0
void solve() {
int N;
cin >> N;
vector<vector<int>> dice(N);
for (int i = 0; i < N; i++) {
int K, A;
cin >> K;
while (K--) {
cin >>... | ALGO | 0.997921 | 4.775664 |
9adb390f-c57c-4727-9e89-92e5514f38b5 | Prachi3899/6Companies30days | Count Collisions on a Road.cpp | class Solution {
public:
int countCollisions(string directions) {
int n = directions.size();
int collisions = 0;
// Step 1: Trim leading 'L' and trailing 'R' as they don't collide
int left = 0, right = n - 1;
while (left < n && directions[left] == 'L') left++;
while ... | ALGO | 0.999771 | 6.627327 |
62dbc214-d1d1-4c80-93fc-5d0a482a27db | Mahanvali/gameoflife | src/main.cpp | #include "raylib.h"
#include "simulation.hpp"
#include <iostream>
const int screenWidth = 1200;
const int screenHeight = 600;
const int sizeCell = 3;
Color backgroundColor = {30, 30, 30, 255};
Simulation simulation(screenWidth, screenHeight, sizeCell);
int main(){
InitWindow(screenWidth, screenHeight, "game of l... | ALGO | 0.86067 | 4.847044 |
6641ff61-2ef8-490a-87df-f151f05e9ffa | igorlev91/Leetcode | Algorithms/0521.LongestUncommonSubsequenceI/solution.cpp | #include <algorithm>
#include <array>
#include <string>
#include "gtest/gtest.h"
namespace
{
class Solution
{
public:
int findLUSlength(std::string const &a, std::string const &b) const
{
std::array<size_t, alphabetSize> lettersDataA(createLettersData(a));
std::array<size_t, alphabetSize> let... | ALGO | 0.997824 | 6.679742 |
fe4fa569-bde5-4650-b8f3-dabd384158c3 | raincross7/code-similarity | codes/train_code/problem298/problem298_279.cpp | #include <bits/stdc++.h>
#define endl "\n"
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define fi first
#define se second
#def... | ALGO | 0.999962 | 4.0873 |
54844504-22da-4f25-ad03-0c0cd02e9c76 | DurgaMurali/LeetCodeSolutions | 0380-insert-delete-getrandom-o1/0380-insert-delete-getrandom-o1.cpp | class RandomizedSet {
public:
std::unordered_set<int> set;
RandomizedSet() {
}
bool insert(int val) {
std::pair<std::unordered_set<int>::iterator, bool> out = set.insert(val);
return out.second;
}
bool remove(int val) {
size_t erased = set.erase(val);
... | ALGO | 0.98991 | 6.081136 |
16dbdc05-2747-4f4f-94a9-a1be68f20d0c | langningchen/XMOJ | UnAC/6041.cpp | #include <bits/stdc++.h>
using namespace std;
const int mn = 1005;
int nx, ny, vis[mn], match[mn];
vector<int> g[mn];
bool find(int x)
{
for (auto y : g[x])
{
if (!vis[y])
{
vis[y] = true;
if (match[y] < 0 || find(match[y]))
{
match[y] = x;
return true;
}
}
}
return false;
}
int main()
{
... | ALGO | 0.999771 | 3.705968 |
293f76d5-3637-4015-ba18-d18574d89cea | Divyadarshan007/cppLearnings | cpp-hackerRank-questions/picking-numbers.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int arr[6] = {1, 2, 2, 3, 1, 2};
int num = 0, max = 0;
for (int i = 0; i < 6; i++)
{
num = 0;
for (int j = i; j < 6; j++)
{
if (abs(arr[i] - arr[j]) < 2)
{
num++;
... | ALGO | 0.998729 | 4.012754 |
a576c0a3-1a92-48de-9547-a0ffdfaf4b94 | jiun0507/Interview-prep | Baekjoon/printnandm5.cpp | //baekjoon 15654
#include <iostream>
#include <algorithm>
using namespace std;
int result[10];
int check[10];
int array[10];
void go(int index, int start, int n, int m){
if(index == m){
for(int i = 0; i<m ; i++){
cout<<result[i]<<" ";
}
cout<<"\n";
}
for(int i = 0;i<n;i++){
if(check[i] == 1){
continue... | ALGO | 0.999993 | 3.284374 |
2bdbc3b0-9506-46a8-9d8b-2050f5d6aada | cms-externals/blackhat | test/W3j_partial_and_ME2_check.cpp | /*
*
* program to check:
* (1) partial amplitudes of the W+3jets process
* (2) ME2 of W+3j process
*
* PS-point: bbdfk7pt
*
*/
#include <mom_conf.h>
#include "assembly.h"
#include "settings.h"
#include "settings_reader.h"
#include "polylog.h" // for pi
#include "cached_OLHA.h"
#include "Interface/BH_inte... | ALGO | 0.968286 | 3.958841 |
27d4cb54-b516-468e-8671-07d846476a0f | mjrusinko/ArduPilot-Clone | libraries/AP_NavEKF/AP_NavEKF_Source.cpp | #include "AP_NavEKF_Source.h"
#include <AP_Math/AP_Math.h>
#include <AP_DAL/AP_DAL.h>
#include <AP_Logger/AP_Logger.h>
#include <AP_HAL/AP_HAL.h>
extern const AP_HAL::HAL& hal;
const AP_Param::GroupInfo AP_NavEKF_Source::var_info[] = {
// @Param: 1_POSXY
// @DisplayName: Position Horizontal Source (Primary)
... | TOOL | 0.928344 | 4.130269 |
62ad8277-376b-4d2e-80b5-248518f588a5 | debsaikia03/LeetCode-Solved-Problems | 0066-plus-one/0066-plus-one.cpp | class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int n = digits.size();
for(int i = n - 1; i >= 0; i--){
if(digits[i] < 9){
digits[i]++;
return digits;
}
digits[i] = 0;
}
digits.insert(digits... | ALGO | 0.999859 | 6.784073 |
2c262120-55c4-4dbe-8033-b042505aa945 | SiktaMistry/CPP | cpp_hs36.cpp | #include<iostream>
using namespace std;
int main(){
int n, rem, sum=0;
cout<<"Enter a number\n";
cin>>n;
while(n>0){
rem=n%10;
sum=sum*10+rem;
n/=10;
}
cout<<sum;
return 0;
} | ALGO | 0.99964 | 4.025951 |
7630ff7f-5618-47e8-b34d-5fcad9e71de5 | UCTECHIP/PortComputeLibrary | ComputeLibrary/src/core/NEON/kernels/NEPixelWiseMultiplicationKernel.cpp | #include "arm_compute/core/NEON/kernels/NEPixelWiseMultiplicationKernel.h"
#include "arm_compute/core/CPP/Validate.h"
#include "arm_compute/core/NEON/NEAsymm.h"
#include "arm_compute/core/NEON/NESymm.h"
#include "arm_compute/core/NEON/wrapper/wrapper.h"
#include "arm_compute/core/TensorInfo.h"
#include <arm_neon.h>
... | TOOL | 0.958302 | 6.470711 |
bac2a332-2aa6-4f5a-930d-ee8e36407fc9 | Nikhil0905/DSA-C-Cpp | DSA/LINKED LIST/Singly/completeInsertion.cpp | #include<iostream>
using namespace std;
struct node{
int data;
struct node *next;
};
struct node *start = NULL;
void insertAtBeg(){
struct node *n = new node;
cout<<"\nEnter Data\n";
cin>>n->data;
n->next = start;
start = n;
}
void append(){
struct node *n = new node;
cout<<"\nEnter Data\n";
cin>>n->data;
n-... | ALGO | 0.996315 | 3.762291 |
bf82a869-e4db-4b59-b39e-8e755c715cf2 | Kauaice9/AulaProg | Lista 02/Ex.1.cpp | #include <stdio.h>
#include <math.h>
int main () {
float pot, Vrms, Irms, t;
printf("||Calculador de Potencia ativa||");
printf("Insira o valor da tenso eficaz. \n");
scanf("%f", &Vrms);
printf("Insira o valor da corrente eficaz. \n");
scanf("%f", &Irms);
printf("Insira o valor do angulo entre de fase entre... | ALGO | 0.996702 | 3.90276 |
686df2f6-5c80-439b-83d6-0081200cfa07 | astalaxmi/firebaseimage | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
01a48fcf-8f0c-418d-aa11-cea3b41599e4 | argyrosan/complete_cuda_call_profiler | cusparse/src/cusparse/cusparseSbsrilu02.cpp | #include <cusparse.h>
#include <dlfcn.h>
#include <iostream>
cusparseStatus_t (*wrapper_cusparseSbsrilu02)(cusparseHandle_t, cusparseDirection_t, int, int, const cusparseMatDescr_t, float *, const int *, const int *, int, bsrilu02Info_t, cusparseSolvePolicy_t, void *);
//handle to the libwrapper library, used to fetch ... | TOOL | 0.992011 | 3.500137 |
1c2f06fa-b6e3-4f6f-b7c2-0114ec5c2f67 | Upendra48/Codeforces_Problems | 4_Team.cpp | /*
800
One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests.
Participants are usually offered several problems during programming contests. Long before the start the friends
decided that they will implement a problem if at least two of them are sure about th... | ALGO | 0.999978 | 5.302163 |
1d846b91-bf84-4a73-ab8f-515f2b0428f4 | Omair95/A_prototype_MPEG-G_encoder | boost_1_66_0/libs/math/example/students_t_example2.cpp | // students_t_example2.cpp
// Example 2 of using Student's t
// A general guide to Student's t is at
// http://en.wikipedia.org/wiki/Student's_t-test
// (and many other elementary and advanced statistics texts).
// It says:
// The t statistic was invented by William Sealy Gosset
// for cheaply monitoring the quality ... | ALGO | 0.995605 | 6.805 |
fbeda6d1-43a5-48da-b626-4995933d96e2 | calubtus/gem5_cache_partitioning | src/systemc/tests/systemc/misc/user_guide/chpt11.6/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999418 | 4.632813 |
7099bf34-f0ed-4eea-a905-e77682825268 | Heodong-git/CodingTest | CodingTest/프로그래머스ㅡ카운트 업/소스.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int start_num, int end_num)
{
vector<int> answer;
for (int i = start_num; i <= end_num; ++i)
{
answer.push_back(i);
}
return answer;
} | ALGO | 0.997298 | 4.073801 |
7846d734-da44-4725-9ebb-ae16749c31aa | Dhnnjaysrma/leetcode-progess_cpp | 2024 Maximize the Confusion of an Exam.cpp | class Solution {
public:
int maxConsecutiveAnswers(string answerKey, int k) {
int ans = 0;
int maxCount = 0;
vector<int> count(2);
for (int l = 0, r = 0; r < answerKey.length(); ++r) {
maxCount = max(maxCount, ++count[answerKey[r] == 'T']);
while (maxCount + k < r - l + 1)
--coun... | ALGO | 0.999919 | 6.58213 |
886837e0-992a-48f8-8709-abb2a73372a7 | sun1f/orbslam2_experiment | Thirdparty/g2o/g2o/types/types_six_dof_expmap.cpp | #include "types_six_dof_expmap.h"
#include "../core/factory.h"
#include "../stuff/macros.h"
namespace g2o {
using namespace std;
Vector2d project2d(const Vector3d& v) {
Vector2d res;
res(0) = v(0)/v(2);
res(1) = v(1)/v(2);
return res;
}
Vector3d unproject2d(const Vector2d& v) {
Vector3d res;
res(0) =... | ALGO | 0.971574 | 5.898688 |
828dba85-c951-423b-967f-c59b620779b6 | jaimemin/programmers | 7의 개수.cpp | #include <string>
#include <vector>
using namespace std;
int getSevenCnt(int num)
{
int cnt = 0;
while (num)
{
cnt += num % 10 == 7 ? 1 : 0;
num /= 10;
}
return cnt;
}
int solution(vector<int> array) {
int answer = 0;
for (int num : array)
{
answer += getSev... | ALGO | 0.996402 | 4.937953 |
a705a6e8-ec86-409c-9e3f-5b1da4ef090e | doradelta/Algorithm-Design | 8.AlgoritmosVoraces/30.EsquiandoEnAlaska/Source.cpp |
// Alberto Baegil
// Comentario general sobre la solucin,
// explicando cmo se resuelve el problema
#include <iostream>
#include <fstream>
#include <vector>
#include "PriorityQueue.h"
using namespace std;
// resuelve un caso de prueba, leyendo de la entrada la
// configuracin, y escribiendo la respuesta
bool resue... | ALGO | 0.999687 | 3.681627 |
03fcc980-5911-47d0-8b2b-2847be257e3a | Sudhanshu2306/Leetcode | 2231-find-first-palindromic-string-in-the-array/find-first-palindromic-string-in-the-array.cpp | class Solution {
public:
bool isPalindrome(string s){
string x=s;
reverse(x.begin(),x.end());
return x==s;
}
string firstPalindrome(vector<string>& words) {
int n=words.size();
for(int i=0;i<n;i++){
if(isPalindrome(words[i])) return words[i];
}
... | ALGO | 0.999883 | 6.196422 |
59862d05-0d3a-432a-b573-a7e1450df688 | afterklugge/URIONLINE | Lab02DS/DoubleDice.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n; cin >> n;
int antonia = 100;
int david = 100;
for (size_t i = 0; i < n; i++) {
int a, d; cin >> a >> d;
if(a > d) { david -= a;}
else if(d > a) { antonia -= d;}
}
cout << antonia << endl;
cout << david << endl;
... | ALGO | 0.999917 | 3.505077 |
e5d6a61d-0f03-487e-9fe9-1c9fa5f43be4 | icenfly/myleetcode | 28.find-the-index-of-the-first-occurrence-in-a-string.cpp | /*
* @lc app=leetcode id=28 lang=cpp
*
* [28] Find the Index of the First Occurrence in a String
*/
// @lc code=start
class Solution {
public:
int strStr(string haystack, string needle) {
return haystack.find(needle);
}
};
// @lc code=end
| ALGO | 0.999499 | 5.967536 |
1da673a3-29f6-4184-a69c-c911d0d8f353 | atrijo2001/DSA-Leetcode-C- | maximum-nesting-depth-of-the-parentheses/maximum-nesting-depth-of-the-parentheses.cpp | class Solution {
public:
bool isMatching(char a, char b){
return (a=='(' and b==')');
}
int maxm(int a, int b){
return a>b?a:b;
}
int maxDepth(string s) {
stack<char> st;
int count = 0;
for(char x:s){
if(x=='('){
st.push(x);
... | ALGO | 0.99949 | 5.765834 |
b3cfa6e5-7062-4724-94f8-e6018d7a26c1 | kikkimo/OnlineJudge | 牛客网/华为机试/019 错误记录/019.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
typedef struct _tagOutPutInfo
{
string strFileName;
int line;
int counts;
_tagOutPutInfo(){strFileName = ""; line = 0; counts = 0; }
}OutPutInfo;
bool operator == (const OutPutInfo & a, const OutPutInfo &... | TOOL | 0.9195 | 3.481725 |
c4eb985c-0649-41c5-ba4c-a0f34a04e86b | pablo-Acha/Progra-Competitiva | 800/fixingTheEspresion.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;cin>>t;
while(t--){
string s;cin>>s;
if(s[0]<s[2]){
cout<<s[0]<<'<'<<s[2]<<endl;
}else if(s[0]>s[2]){
cout<<s[0]<<'>'<<s[2]<<endl;
}else{
cout<<s[0]<<'='<<s[2]<<endl;
}
... | ALGO | 0.999907 | 3.837621 |
9fc2c3ff-8e4e-4ed8-90d5-d59c4b646cc3 | ChettriBishal/CP | Contests/Tomjerr.cpp | #include<iostream>
using namespace std;
void solve()
{
int a,b,c,d,k;
cin>>a>>b>>c>>d>>k;
int dist=abs(a-c)+abs(d-b);
if(k>=dist and (k-dist)%2==0)
cout<<"YES\n";
else
cout<<"NO\n";
}
int main()
{
int t;
cin>>t;
while(t--)
solve();
return 0;
}
| ALGO | 0.999924 | 3.838003 |
2ff8df9c-55d4-48c8-be64-06a6c59dae61 | chichchic/algorithmPrac | BaekJoon/2020/200503_1976.cpp | #include <iostream>
#include <vector>
using namespace std;
struct A
{
vector<int> root;
A(int n) : root(n + 1)
{
for (int i = 1; i <= n; i++)
{
root[i] = i;
}
}
int find(int n)
{
if (root[n] == n)
return n;
return root[n] = find(root[n]);
}
void merge(int a, int b)
... | ALGO | 0.999996 | 4.224068 |
3d9694d0-ee76-471a-8823-0858ddb1062c | tdanilo21/CP-Templates | Templates/Segment trees/Segtree types/sum_t.cpp | #define ll long long
#define sp ' '
class sum_t{
public:
ll val;
sum_t(ll val = 0){ this->val = val; }
static sum_t null_v(){ return sum_t(0); }
static sum_t op(const sum_t& a, const sum_t& b){ return a + b; }
// This is currently on set mode but it can be on add.
sum_t up(const sum_t& a){ ret... | TOOL | 0.941233 | 3.412991 |
6af25a7f-5adf-474f-9190-3fb96bca4c79 | mbaguiar/mieic02_aeda | aeda-mt4-2014/Clinica.cpp |
#include "Clinica.h"
//Animal
Animal::Animal(string umNome, string umaEspecie, int numeroConsultas):
nome(umNome), especie(umaEspecie), numConsultas(numeroConsultas)
{}
string Animal::getNome() const
{ return nome; }
string Animal::getEspecie() const
{ return especie; }
int Animal::getNumConsultas() const
{ retur... | ALGO | 0.907494 | 5.396834 |
caecb103-30ea-4141-b42b-ee43b8cfdade | Armaan42/Data-structure-and-algorithms-CPP | Day_21/recursion_3/palindrome.cpp | /*
check if the string is palindrome or not
*/
#include<iostream>
#include<string>
using namespace std;
// bool isPalindrome(string s){
// int i = 0;
// int j = s.size() - 1;
// while(i < j){
// if(s[i] != s[j]){
// return false;
// }
// i++;
// j--;
// }
/... | ALGO | 0.999791 | 5.201113 |
522f9705-f63e-4314-aba9-99cc3061fce4 | Haricharan1212/CP | oldcode/1795B.cpp | // Haricharan
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef ... | ALGO | 0.999969 | 5.2866 |
9935c612-2627-4969-8cfa-6dd51bff9288 | kovaxis/progcomp | problems/asiaeast/2021/d.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define repx(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) repx(i, 0, n)
#define invrepx(i, a, b) for (int i = b - 1; i >= a; i--)
#define invrep(i, n) invrepx(i, 0, n)
struct P {
ll x, y;
P operator+(... | ALGO | 0.99959 | 4.84669 |
9de45544-3cb8-46f2-8ffe-5a1299ce0ff8 | HeinerHub/Taller3 | Punto16/Punto16.cpp | /*
* Programa: Sumar los primeros numeros primos del 1 al 50
* Fecha: 21-08-2018
* Autor: Heiner Colorado Castaeda
*/
#include <stdio.h>
using namespace std;
int main()
{
int suma=0, div=1, cont, n=1;
while(n<=50)
{
while(div<=n)
{
if (n%div==0)
{
cont++;
}
div++;
}
if(cont==2)
{
suma = suma ... | ALGO | 0.999883 | 3.48418 |
cfdf0504-f0b3-4249-9be6-12bdd6d8a80d | hmmonotone/Striver-Sheet | Day 9/Find K-th Permutation Sequence.cpp | // Link to the problem:
// https://leetcode.com/problems/palindrome-partitioning/
class Solution {
public:
string getPermutation(int n, int k) {
int fact = 1;
vector < int > numbers;
for (int i = 1; i < n; i++) {
fact = fact * i;
numbers.push_back(i);
}
numbers.push_... | ALGO | 0.999967 | 6.847824 |
2f43fbd9-89bb-4447-af26-6873fea82a91 | Coach-Academy/Spring-1-2024 | Level 2/CPU - Regular - L2 - C101/Practice/Week 03/D - Frequency Array .cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 5;
int frq[N];
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
int arr[n];
bool valid = true;
for (int &x: arr) {
cin >> x;
... | ALGO | 0.999725 | 4.209421 |
3a1ae8a3-c198-45ff-a341-1870382add08 | rowboat/frameworks-base | media/libstagefright/codecs/amrwb/src/scale_signal.cpp | /*
------------------------------------------------------------------------------
Filename: scale_signal.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
------------------------------------------------------------------------... | ALGO | 0.999269 | 5.946876 |
d80d2c9c-078f-4bce-964d-fcb4f1bf8941 | legianha592/C | Algorithm/Code/T1 va T2/Labiec11.cpp | #include <iostream>
using namespace std;
int main()
{
int a, b, i;
cout << "Nhap hai so nguyen duong bat ki va lon hon 2: ";
cin >> a >> b;
for (int j=1; j<=a; j++)
{
cout << "*";
}
cout << endl;
for (i=2; i<b; i++)
{
cout << "*";
for (int j=2; j<a; j++)
{
cout << " ";
}
cout << "*" << endl;
... | ALGO | 0.999813 | 3.13645 |
0d1e9b12-5606-4164-be7a-cfd9e0f1a8ca | qap2102/DSA-PTIT | PTIT121L.cpp | #include <bits/stdc++.h>
using namespace std;
#define faster \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define ll long long
vector<string> v;
//int a[10];
int n,m;
string s;
bool kt[15]={0};
ll cnt;
int cot[100], xuoi[100], nguoc[100];
//void in(){
// ... | ALGO | 0.999718 | 3.460766 |
bda4d3fd-57dc-4745-a1b8-378268007497 | ishandutta2007/codeforces | sert/normal/645/E.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll md = 1e9 + 7;
typedef long double ld;
const int N = 2e6 + 34;
char s[N];
ll p[N];
int n, k, m;
int lst[100];
int c, cur, mn;
int main() {
//freopen("a.in", "r", stdin);
//freopen("a.out", "w", stdout);
scanf("%d %d\n", &n, &k);
... | ALGO | 0.999991 | 4.067185 |
f2c4dc32-d083-4e48-9aa5-65792b427c7f | ankur-a/codePractice | graph/graph1.cpp | #include<bits/stdc++.h>
using namespace std;
std::vector<int> adj[10];
int main(){
int x,y,nodes,edges;
cin>>nodes>>edges;
for(int i=0;i<edges; i++){
cin>>x>>y;
adj[x].push_back(y);
}
for(int i=1;i<nodes;i++){
cout<<"Adjacency list of nodes" << i << ":";
for(int j=0; j < adj[i].size();j++){
if(j== a... | ALGO | 0.999836 | 4.395365 |
c7d74765-d927-4bdc-bac3-b444b0a30b08 | alexandraback/datacollection | solutions_5756407898963968_0/C++/kwangswei/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cstdio>
using namespace std;
int solve(vector<int> line1, vector<int> line2) {
int cnt = 0;
int answer = 0;
for (const auto n1 : line1) {
for (const auto n2 : line2) {
if (n1 == n2) {
cnt++;
... | ALGO | 0.999329 | 3.572141 |
abbd81f4-e35c-46d0-94dc-b6faf6972fb7 | Mohit-D12/Final450 | Matrix/10.cpp | // Common elements in all rows of a given matrix
// https://www.geeksforgeeks.org/common-elements-in-all-rows-of-a-given-matrix/
#include <bits/stdc++.h>
using namespace std;
#define M 4
#define N 5
void printCommonElements(int mat[M][N])
{
unordered_map<int, int> mp;
for (int j = 0; j < N; j++)
... | ALGO | 0.999811 | 4.477003 |
b601f188-a3b9-4304-952a-2db1c52d3528 | ishandutta2007/codeforces | autumnkite/normal/1425/I.cpp | #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,popcnt,abm,mmx,avx,avx2,fma,tune=native")
#include <bits/stdc++.h>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(0);
int n, q;
std::cin >> n >> q;
std::vector<int> a(n);
... | ALGO | 0.999875 | 4.027626 |
98b60c3b-614e-41a4-b5af-ac62fb45fd6a | ankiosa/Leetcode | 1910-remove-all-occurrences-of-a-substring/1910-remove-all-occurrences-of-a-substring.cpp | class Solution {
public:
string removeOccurrences(string s, string part) {
int part_len = part.length();
bool x = true;
while(x){
int part_pos = s.find(part);
if(part_pos != string::npos){
s.erase(part_pos,part_len);}
else x=false;
//,... | ALGO | 0.999073 | 5.85959 |
75f87004-2ae0-465d-974c-c867bdce7b11 | AayushPratapBansal/DSA-QUESTION | 25-reverse-nodes-in-k-group/reverse-nodes-in-k-group.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseKGr... | ALGO | 0.999995 | 5.525644 |
421d440a-f11f-40b0-baac-5f461177f1f7 | algo-study-embedded-21/algorithm-study | kyeonghoon/6주차_17779_게리멘더링2.cpp | #include<iostream>
#include<queue>
using namespace std;
int n;
int map[21][21];
int max_val = 0, min_val = 40000, ans=40000;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
int total = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) {
cin >> map[i][j];
total += map[i][j];
... | ALGO | 0.999962 | 3.606712 |
475860b1-8151-4e77-9b03-0b3fbd8481ed | Ownfos/Waffle | libraries/boost_1_72_0/libs/geometry/doc/src/examples/algorithms/distance.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[distance
//` Shows calculation of distance of point to some other geometries
#include <iostream>
#include <list>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/point_xy... | ALGO | 0.994289 | 5.687009 |
e3ba3780-2c03-4229-83a9-1634a4d304a1 | VenkatSBitra/leetcode | 300.longest-increasing-subsequence.cpp | /*
* @lc app=leetcode id=300 lang=cpp
*
* [300] Longest Increasing Subsequence
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
vector<int> res(nums.size(), 0);
res[0] = 1;
for (int i = 1; i < nums.size();... | ALGO | 0.999977 | 6.39774 |
f68700f8-298c-47dd-a96a-9d0d517635e1 | Eagle233Fake/Eagle233-In-Class-Practices | DataStructureAndAlgorithms/week3/H.cpp | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m;
cin >> n >> m;
list<int> l;
for (int i = 1; i <= n; i++) {
l.push_back(i);
}
auto it = l.begin();
while (l.size() > 1) {
for (int i = 1; i < m; i++) {
it++;
if (it == l.end()) ... | ALGO | 0.999992 | 3.115076 |
c83d6064-c192-4f82-aded-cef83cf29a75 | trinhvanmanh1603/C-_firstDev | bth/7-3b8.cpp | #include <iostream>
using namespace std;
int giaiThua(int n)
{
if (n == 1)
return 1;
return n * giaiThua(n - 1);
}
int main()
{
int n, k;
cout<<"nhap k can tinh : ";
cin>>k;
cout << " nhap n : ";
cin >> n;
cout << "to hop chap k cua " << n << " la: " << giaiThua(n)/(giaiThua(k)*giai... | ALGO | 0.99979 | 4.27399 |
52c278e7-a4d2-4d2d-a711-a81c22dcaa88 | CrimsonNightfall/practicum_5_semestr | data_structures_1/hashing.cpp | #include <iostream>
#include <vector>
#include <list>
#include <string>
const int kMod = 100003;
const int kP = 31;
class TStringSet {
public:
TStringSet() : table_(kMod) {}
void Add(const std::string& s) {
int hash = Hash(s);
auto& chain = table_[hash];
for (const auto& str : chain) ... | ALGO | 0.999967 | 5.796385 |
a6eaca6d-f134-45f2-8e84-99a4b6210cc3 | Ivan-71-ua/Competitive-Programming | LeetCode/1461.cpp | #include <bits/stdc++.h>
class Solution {
public:
bool hasAllCodes(std::string s, int k) {
std::set<std::string> varois {};
if(s.size() < k)
return false;
for (int i = 0; i <= s.size() - k; i++)
{
std::string tp = s.substr(i, k);
varois.insert(tp);
}
return varois.size() == 2 << k;
}
};
int m... | ALGO | 0.999575 | 4.799556 |
682fea6e-5d89-4152-a2f5-31eccd44dfad | juancitotrucupey/Simulacion_Sistemas_Fisicos_Curso | CUDA/LBOndasEnCuda2016-I.cu.cpp | #include<iostream>
#include <fstream>
#include <cmath>
#include <GL/glew.h>
#include <GL/glut.h>
#include <cuda_runtime_api.h>
#include <cuda_gl_interop.h>
using namespace std;
const double C=0.5; // OJO: C< sqrt(1/2)=0.707
const double A=100;
const double Lambda=10;
const double Omega=2*M_PI*C/Lambda;
#define ... | ALGO | 0.999455 | 3.396812 |
29e22022-935d-42b3-a6f0-112c194b0f58 | ritesend/leetcode | 2270-number-of-ways-to-split-array/2270-number-of-ways-to-split-array.cpp | class Solution {
public:
int waysToSplitArray(vector<int>& arr) {
int n=arr.size();
int cnt=0;
int totalSum=0;
for(int i=0;i<n;i++){
totalSum+=arr[i];
}
long long leftSum=0;
for(int i=0;i<n-1;i++){
leftSum+=arr[i];
long l... | ALGO | 0.999933 | 5.608275 |
219acc42-078d-4384-a254-e219a5f41d04 | darkwuta/-CSC417-Assignment | Assignment2/extern/libigl/python/py_igl/py_polar_svd.cpp | m.def("polar_svd", []
(
const Eigen::MatrixXd& A,
Eigen::MatrixXd& R,
Eigen::MatrixXd& T,
Eigen::MatrixXd& U,
Eigen::MatrixXd& S,
Eigen::MatrixXd& V
)
{
return igl::polar_svd(A, R, T, U, S, V);
}, __doc_igl_polar_svd,
py::arg("A"), py::arg("R"), py::arg("T"), py::arg("U"), py::arg("S"), py::arg("V"));
m.... | ALGO | 0.98769 | 6.260141 |
e86eed96-71d6-4750-9488-ee6779d3031c | himkt/problems.2019 | atcoder/abc/038/a.cpp | # include <algorithm>
# include <cassert>
# include <cctype>
# include <cstdio>
# include <cstdlib>
# include <cstring>
# include <cmath>
# include <iostream>
# include <map>
# include <queue>
# include <set>
# include <sstream>
# include <stack>
# include <string>
# include <vector>
# define rep(i, n) for (int i = 0;... | ALGO | 0.99989 | 3.897912 |
ad51d296-cdc0-49e0-8ae1-dfed0fdc801f | trifledmatter/model-engine | examples/parallel/parallel.cpp | // A basic application simulating a server with multiple clients.
// The clients submite requests to the server and they are processed in parallel.
#include "build-info.h"
#include "common.h"
#include "llama.h"
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
// trim whitespac... | WEB | 0.957453 | 7.001983 |
450c1a98-c167-4376-88b9-6d50843dbced | keynesW/learning_exercise_code | cplusplus/generic_program_template/compare_main.cpp | /*******************************************************************
*
* File Name : main.cpp
* Author : Keynes
* QQ : 1446160257
* Email : <EMAIL>
* Blog : http://www. .com/
* Created Time : Fri 13 Nov 2020 09:05:23 AM CST
... | ALGO | 0.998292 | 3.679607 |
1ddd6c44-0a0c-44a5-9d34-1279b2374166 | chandankds/DataStructures | recursion/factorial.cpp | /*
* factorial.cpp
*
* Created on: 10-Jul-2019
* Author: chandan
*/
#include<iostream>
using namespace std;
int factorial(int num)
{
if(num == 0){
return 1;
}
else{
int result = num * factorial(num -1);
// cout << result <<endl;
return result;
}
}
int main3()
{
... | ALGO | 0.999979 | 4.780468 |
8abd8623-c39c-4821-8546-246db9ba2988 | vatsal-prajapati-1/cpp | calculatorUsingIfElse.cpp | #include <iostream>
using namespace std;
int main() {
int n1;
cout<<"Enter n1 : ";
cin>>n1;
char op;
cout<<"Enter op : ";
cin>>op;
int n2;
cout<<"Enter n2 : ";
cin>>n2;
if(op == '+') cout<<n1+n2;
if(op == '-') cout<<n1-n2;
if(op == '*') cout<<n1*n2;
if(op == '/') cout... | ALGO | 0.942061 | 3.296594 |
e8331a26-baba-4c6f-b15e-009d25623b41 | Abs-Futy7/DSA | LinkedList/Intersection Node.cpp | #include <iostream>
using namespace std;
class Node{
public:
int val;
Node *next;
Node(int data) {
val = data;
next = NULL;
}
};
class LinkedList {
public:
Node* head;
LinkedList() {
head = NULL;
}
void insertAtTail(int val) {
Node* new_node = new Node(val)... | ALGO | 0.999958 | 4.438052 |
d96433eb-78d6-40ec-969c-64678b99d525 | Kristoff-starling/OJ-Programmes | HDU/2021多校/Round 3/[HDU6975]Forgiving Matching.cpp | #include <bits/stdc++.h>
#define rep(i,a,b) for (int i=a;i<=b;i++)
using namespace std;
const int MAXN=1e6;
const int MOD=998244353;
int n,m;
char s[MAXN+48],t[MAXN+48];
int a[MAXN+48],b[MAXN+48];
int add(int x) {if (x>=MOD) x-=MOD;return x;}
int sub(int x) {if (x<0) x+=MOD;return x;}
namespace poly
{
const int... | ALGO | 0.999947 | 3.784611 |
517ea307-7969-4be6-8088-d25096797b5c | phantom23333/3D-Gaussian-Reconstruction | submodules/tetra-triangulation/CGAL-5.6.1/examples/Periodic_2_triangulation_2/p2t2_simple_example.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <fstream>
#include <cassert>
#include <list>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typ... | ALGO | 0.897745 | 4.801996 |
1979c864-05fd-46de-be3a-d2f52de94f7f | vivekpradhan736/DSA-Series | Lecture022 Strings/stringCompression.cpp | #include<iostream>
#include<string>
#include<cstring>
using namespace std;
int compress(char word[]){
int i = 0;
for(int j = 1, count = 1; j <= strlen(word); j++, count++) {
if(j == strlen(word) || word[j] != word[j - 1]) {
word[i++] = word[j - 1];
if(count >= 2)
for(char digit : to_string(count)) ... | ALGO | 0.999909 | 4.498513 |
dc6b55ff-30b6-4d1a-93a3-1c83b1b8a166 | dusagong/Algorithm | 백준/23879.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
int count = 0;
cin >> n;
int *p = new int[n];
int *t = new int[n];
int *s = new int[n];
vector<pair<int,int>> point... | ALGO | 0.99999 | 3.570955 |
2b79cf9e-0bb4-4301-b3c6-6a0177f01cff | raincross7/code-similarity | codes/train_code/problem277/problem277_181.cpp | #include <bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define db(x) cerr << #x << " = " << x << endl
#define db2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n"
#define db3(x, y, z) cerr << "(" << #x << ", " << #y << ", " << #z << ") = (" << x ... | ALGO | 0.999985 | 4.397645 |
a3d7b1aa-5bb9-4794-9da0-a0381d97a041 | abhiXsliet/Solved-DSA-Problems | Leetcode Contests/Biweekly Contest 117/004-maximum-spending-after-buying-items.cpp | // https://leetcode.com/contest/biweekly-contest-117/problems/maximum-spending-after-buying-items/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
long long maxSpending(vector<vector<int>>& values) {
}
}; | ALGO | 0.999752 | 5.744849 |
96b3726e-b80c-4aac-8669-67ed6a2879d3 | plseetiong/cpeprogla2-e22 | FizzBuzz.cpp | #include<iostream>
using namespace std;
int main(){
for(int i=1; i<=100; i++){
if(i % 3 == 0 && i % 5 == 0){
cout << "FizzBuzz";
}
else if(i % 3 == 0){
cout << "Fizz";
}
else if(i % 5 == 0){
cout << "Buzz";
}
else{
cout << i;
}
cout<<endl;
}
}
| ALGO | 0.99935 | 4.464295 |
28df1214-62dd-4b7c-b2c7-0c05f312adc5 | zxj0302/RWDataset | evoke/tests/test_2truss.cpp | #include "Escape/GraphIO.h"
#include "Escape/EdgeHash.h"
#include "Escape/Digraph.h"
#include "Escape/Triadic.h"
#include "Escape/FourVertex.h"
#include "Escape/Conversion.h"
#include "Escape/GetAllCounts.h"
using namespace Escape;
int main(int argc, char *argv[])
{
Graph g;
if (loadGraph(argv[1], g, 1, IOFormat:... | ALGO | 0.942167 | 5.251409 |
ce94458a-1a58-4649-9c77-bb521ca5409a | Dipesh-Budhiraja/practice | greedy/jump_game_greedy.cpp | #include "header.h"
class Solution {
public:
bool canJump(vector<int>& nums) {
int n = nums.size();
int goal = n - 1;
for (int i = n-2; i >= 0; i--) {
if (nums[i] + i >= goal) {
goal = i;
}
}
return goal == 0;
}
}; | ALGO | 0.999932 | 6.308471 |
389a927a-c48f-4b7f-a0e8-d0f02e83b7d7 | Khushal-ag/Leetcode | 2009-minimum-number-of-operations-to-make-array-continuous/2009-minimum-number-of-operations-to-make-array-continuous.cpp | class Solution {
public:
int minOperations(vector<int>& nums) {
int len = nums.size();
unordered_set<int> unique_nums(nums.begin(), nums.end());
nums.assign(unique_nums.begin(), unique_nums.end());
sort(nums.begin(), nums.end());
int tail = 0;
int maxi = INT_MIN;
for (int head = 0... | ALGO | 0.999988 | 5.972312 |
2ccab3d2-4d06-4583-b439-13a22020a742 | abdusss111/ads-2023-fall | lab10/h.cpp | #include <bits/stdc++.h>
using namespace std;
int cnt, n, m;
void dfs(char **arr, int i, int j){
if(i < 0 || j < 0 || i >= n || j >= m || arr[i][j] == '0') return;
arr[i][j] = '0';
dfs(arr, i + 1, j);
dfs(arr, i - 1, j);
dfs(arr, i, j + 1);
dfs(arr, i, j - 1);
}
int main(){
cin >> n >> m;
char **arr = new cha... | ALGO | 0.999566 | 4.556317 |
4786ca0a-ef8d-4673-a06a-5cfef3dbb901 | ayyush08/DSA.cpp-odyssey | SegmentTree/C_Number_of_Minimums_on_a_Segment.cpp | #include<bits/stdc++.h>
using namespace std;
struct SegmentTree {
vector<pair<int,int>> value; // stores the segment tree values and count of minimums
pair<int,int> ne = {INT_MAX, 0};
void init(int size){
int n = 1;
while (n < size) n <<= 1;
value.assign(2 * n, ne);
}
voi... | ALGO | 0.999976 | 5.184125 |
0ad19644-2929-4304-b6d3-e6159aa1d708 | hpp3/Hanoi | game.cpp | #include "game.h"
Game::Game(int n_disks) {
moves = calls = 0;
for (int i = 0; i<3; i++)
t[i].set_which(i);
// assign the pegs their identities
for (;n_disks>0;n_disks--) {
t[0].push(n_disks);
// add all the disks to the first peg
where_is[n_disks-1]=0;
... | ALGO | 0.996841 | 4.823868 |
f39a79a9-e98e-4ad3-b646-586ad6b7eb5c | gim-largerepo/including-investment-59GB | app/ago.cpp | Note investment know every first friend.
Maybe fly but after.
Respond within parent position. | ALGO | 0.998368 | 3.972771 |
c2075372-cd6a-44a6-a238-024353f6a5ba | jtjayesh98/Unfolding | CGAL-5.4.1/examples/Straight_skeleton_2/Create_saop_from_polygon_with_holes_2.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_with_holes_2.h>
#include <CGAL/create_offset_polygons_from_polygon_with_holes_2.h>
#include "print.h"
#include <boost/shared_ptr.hpp>
#include <cassert>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kerne... | ALGO | 0.871689 | 5.995071 |
e4453e4f-e0d7-4cb0-86fe-4c9d599f7711 | dame-time/UserAssistedSphereMeshEditor | include/igl/intrinsic_delaunay_cotmatrix.cpp | template <typename DerivedV, typename DerivedF, typename Scalar>
IGL_INLINE void igl::intrinsic_delaunay_cotmatrix(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
Eigen::SparseMatrix<Scalar>& L)
{
Eigen::Matrix<Scalar, Eigen::Dynamic, 3> l_intrinsic;
DerivedF F_intrinsic;
re... | ALGO | 0.998052 | 7.028543 |
28675c5a-2092-475a-b793-38e650dbcb0e | Yejin-Moon/algorithm | C++/Baekjoon/Problem1977.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
int small=0;
int sum=0;
bool flag = false;
for(int i=n; i<=m; i++)
{
if(sqrt(i)==int(sqrt(i)))
{
if(flag==false)
{
small=i;
fla... | ALGO | 0.999992 | 4.292348 |
ef6c4813-c0dc-45ad-9c7a-5bf5838fc88b | srathod19/DSA---Programs | Graphs/p1_creationGraphs.cpp | #include <iostream>
#include <unordered_map>
#include <list>
using namespace std;
class graph
{
public:
unordered_map<int, list<int>> adj;
void addAdj(int first, int second, bool direction)
{
adj[first].push_back(second);
if (direction == 0)
{
adj[second].push_back(first)... | ALGO | 0.999843 | 5.16403 |
19dfd226-51fc-46d0-80e0-e600ac45bab9 | google-research/football | third_party/gfootball_engine/src/base/geometry/plane.cpp | // written by bastiaan konings schuiling 2008 - 2014
// this work is public domain. the code is undocumented, scruffy, untested, and should generally not be used for anything important.
// i do not offer support, so don't ask. to be used for inspiration :)
#include "plane.hpp"
#include <cassert>
#include <cmath>
nam... | ALGO | 0.952761 | 6.619266 |
a376720d-8e1b-4be6-860b-f776a0be8e93 | satyam071/DSA-with-C- | Looping/pattern7.cpp | //1
//22
//333
#include<iostream>
using namespace std;
int main(){
int n,i=1;
cout<<"Enter the value of n:";
cin>>n;
while(i<=n){
int j=1;
while(j<=i){
cout<<i;
j++;
}
cout<<endl;
i++;
}
} | ALGO | 0.999747 | 3.592315 |
b7f9e13e-dac9-4c71-9821-caa7d3ca2657 | dim4egster/btcu_coderev | src/pubkey.cpp | #include "pubkey.h"
#include <secp256k1.h>
#include <secp256k1_recovery.h>
namespace
{
/* Global secp256k1_context object used for verification. */
secp256k1_context* secp256k1_context_verify = nullptr;
} // namespace
/** This function is taken from the libsecp256k1 distribution and implements
* DER parsing for EC... | TOOL | 0.929538 | 7.434718 |
d7cb0c1a-ec56-49e8-bf15-c72255acd527 | ishandutta2007/codeforces | zhouyuyang/normal/57/E.cpp | #include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define db long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define IT iterator
#define PB push_back
#define MK make_pair
#define LB lower_bound
#define UB upper_bound
#define EB emplace_back
#define fi first
#defi... | ALGO | 0.999821 | 3.639788 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.