uuid stringlengths 36 36 | repo_name stringlengths 5 133 | relative_path stringlengths 3 3.76k | content stringlengths 282 4.03M | category stringclasses 6
values | algo_rel_score float32 0.9 1 | quality_score float32 3 8.13 | source_meta dict |
|---|---|---|---|---|---|---|---|
18628195-2617-42ba-a21b-7532c1942308 | anshsaxena1703/Codeforces | Codeforces Round 950 (Div-3)/C_Sofia_and_the_Lost_Operations.cpp | /* ..............Code by Ansh.............. */
#include <bits/stdc++.h>
#include<vector>
#include<iostream>
#include<queue>
#define ll long long
const int MOD = 1e9 + 7;
const int w = 998244353;
#define pb push_back
#define endl "\n"
#define godspeed ios_bas... | ALGO | 0.99999 | 4.066883 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2023-10-21T02:50:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d0e6097579d... |
986cdc32-5863-4763-a0b7-cb2aa12d796c | LuezhenYuan/Computational-physics | Advance 1 MinorityGame/src/MinorityGame/Game.cpp | # include "Game.h"
Game::Game(map<pair<int,int>,int> S):m_S(S),p_hist(NULL){
m_N=0;
for(std::map<pair<int,int>,int>::iterator iter=m_S.begin();iter!=m_S.end();iter++){
m_N+=iter->second;
}
if(m_N%2!=1){
cout<<"The number of agents should be odd!\nSet N to N+1.\n";
m_N++;
}
... | ALGO | 0.959425 | 3.246021 | {
"github_metadata": {
"branch": "master",
"commit_count": 6,
"repo_created_at": "2016-03-19T11:01:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ec0e91d1e9... |
c55054bc-06f0-48c3-afff-74ddd2178130 | anhncs/Probabilistic-Graphical-Models | 3.Markov Networks for OCR/inference/inference-src/libdai/src/mf.cpp | /* This file is part of libDAI - http://www.libdai.org/
*
* Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
*/
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <... | ALGO | 0.987131 | 6.082619 | {
"github_metadata": {
"branch": "master",
"commit_count": 9,
"repo_created_at": "2013-04-21T12:30:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 104,
"forks": 70,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "63e131f... |
5775b407-8012-43dc-ab0c-907bb40c97a7 | MeSagor/Compiler-Design-Lab | A4.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
bool is_integerVariable(string token) {
bool flag = true;
if ((token[0] >= 'i' && token[0] <= 'n') || ((token[0] >= 'I' && token[0] <= 'N'))) {
} else {
flag = false;
}
for (int i = 1; i < token.si... | ALGO | 0.994072 | 3.534729 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2022-07-01T05:17:13.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fd1f9b228f94... |
e63adfc5-67dc-46a7-a0c1-8b67d147f43a | sandipan-kundu1/Leetcode-Solutions | 236-lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
#define lca lowestCommonAncestor
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, Tr... | ALGO | 0.999989 | 6.689731 | {
"github_metadata": {
"branch": "main",
"commit_count": 660,
"repo_created_at": "2024-05-25T06:23:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ffd82f76da... |
4dfd9538-d771-4972-a8bf-32fc2333b1cc | yehezkiel1086/dsa-stuffs | cpp/pointers.cpp | #include <iostream>
// outputs memory addresses
void printMemories() {
int a = 3, b = 2, c = 1; // 4 bytes difference each in memory
std::cout << "Addresses: " << &a << " " << &b << " " << &c << "\n"; // returns memory addresses
}
// pointer address assignment from normal var
int *assignAddressFromVar(int var1) {... | TOOL | 0.963416 | 4.844392 | {
"github_metadata": {
"branch": "main",
"commit_count": 119,
"repo_created_at": "2024-04-08T15:07:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4e0a9159c3... |
d0e59f4b-3271-4432-85e4-b385ac69650a | mrmohim/All-OJ-Contest-Problem-Solution | CodeForces/Round 391/A.cpp | #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;
const int INF = 0x7f7f7f7f;
... | ALGO | 0.99978 | 3.311608 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2018-12-02T10:47:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3801b87f2... |
e4ec6ad9-5617-42df-8f4e-f40572ae944f | DarkKirb/libk | math/round.cpp | #include <math.h>
template <typename T>
T __floor(T x) {
return (T)((intmax_t)x);
}
#define deffloor(name, type) \
type name ( type x ) { \
return __floor(x); \
}
#define defceil(name, type) \
type name ( type x ) { \
return __floor(x)+1; \
}
#define deftrunc(name, type) \
type ... | TOOL | 0.923943 | 5.082367 | {
"github_metadata": {
"branch": "master",
"commit_count": 27,
"repo_created_at": "2017-03-18T18:11:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aad6a0334... |
c6f86ea8-79a6-4e46-92f2-a31064afbda5 | oshinoooo/leet_code | problems0239/main.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
class Solution {
public:
vector<int> maxSlidingWindow1(vector<int>& nums, int k) {
vector<int> out;
int n = nums.size();
map<int, int> m;
for (int i = 0; i < n; ++i) {
++m[nums[i]];
... | ALGO | 0.999966 | 6.255704 | {
"github_metadata": {
"branch": "main",
"commit_count": 265,
"repo_created_at": "2022-02-16T17:47:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "60a5ec8044... |
5134c9c6-0728-4949-8e0f-f99689770b9a | YcZhangSing/MyNwafuWorks | DataStructure数据结构/TEST3/TEST3/P3/main.cc | #include <cstdio>
#include <iostream>
#include <queue>
using namespace std;
struct Node {
int data;
Node *left, *right;
};
typedef Node* Tree;
int N, *mid, *lay;
void postTravesal(Tree root) {
if(root) {
postTravesal(root->left);
postTravesal(root->right);
printf("%d ", root->dat... | ALGO | 0.999997 | 3.965108 | {
"github_metadata": {
"branch": "main",
"commit_count": 7,
"repo_created_at": "2024-11-14T05:59:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "267f4840e864... |
33de70dd-151e-4c7c-8561-43976c54ab97 | hiroshi-manabe/wavelet-matrix-cpp | src/wavelet_matrix.cpp | /*
* wavelet-matrix.cpp
* Copyright (c) 2012 <NAME>
*
* based on wat-array.cpp
* Copyright (c) 2010 <NAME>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source cod... | ALGO | 0.998275 | 5.048841 | {
"github_metadata": {
"branch": "master",
"commit_count": 26,
"repo_created_at": "2012-08-20T04:11:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "40d1b8e64... |
541ce7d9-7fab-4470-9cfe-ef9b66e9eff3 | 071yoon/Algorithm | Daily/2023_10/week1/14940.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
int dir[4][2] = {{-1, 0}, {1, 0}, {0, 1}, {0, -1}};
int main(){
int r, c;
int sx, sy;
queue <pair<int, int> > que;
int board[1001][1001] = { 0 };
int dist[1001][1001] = { 0 };
cin >> r >> c;
for(int i = 0; i < r; ... | ALGO | 0.999767 | 3.23391 | {
"github_metadata": {
"branch": "master",
"commit_count": 234,
"repo_created_at": "2021-11-25T02:43:19.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d591862... |
fc044fb5-ff2b-4062-a741-a78845661faa | liuchuo/LeetCode | C++/526. Beautiful Arrangement.cpp | 526. Beautiful Arrangement
Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the following is true for the ith position (1 ≤ i ≤ N) in this array:
The number at the ith position is divisible by i.
i is divisible by the n... | ALGO | 0.999986 | 5.531109 | {
"github_metadata": {
"branch": "master",
"commit_count": 354,
"repo_created_at": "2016-04-01T13:53:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 534,
"forks": 154,
"issues": 5,
"pull_requests": 4
},
"file_meta": {
"content_id": "1152... |
d609ca6e-b963-465f-a5bd-f23042089bdf | Bharat2044/365-days-coding-challanges | Day_309/01_mergeKSortedLists.cpp | // Question Link: https://www.interviewbit.com/problems/merge-k-sorted-lists/
/*
Merge K Sorted Lists
Merge k sorted linked lists and return it as one sorted list.
Example :
1 -> 10 -> 20
4 -> 11 -> 13
3 -> 8 -> 9
will result in
1 -> 3 -> 4 -> 8 -> 9 -> 10 -> 11 -> 13 -> 20
*/
/**
* Definition for singly-linked l... | ALGO | 0.99994 | 5.822321 | {
"github_metadata": {
"branch": "main",
"commit_count": 1246,
"repo_created_at": "2023-05-01T12:09:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5fd5134de... |
49046c89-ae9a-4510-bfac-1c87ae8cc8f1 | gustavohcs/Codigos-Maratona | URI 1121 - Robo Colecionador.cpp | #include <iostream>
using namespace std;
int main(){
int L, C, S,i,j;
char comando;
char frente;
int localL, localC;
while(cin >> L >> C >> S){
if (L == 0 && C == 0 && S == 0)
break;
char arena[105][105];
int cont=0;
for(i=0;i<L;i++){
for(j=0;j<C;j++){
... | ALGO | 0.999918 | 3.715212 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-20T23:14:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b1d024ba53... |
1094101f-44db-4277-9b50-480423c02217 | THOTH0101/c_plus_plus_projects | Pointers_and_Dynamic_Memory_Management/Occurrences_of_each_digit_in_a_string/main.cpp | #include <iostream>
#include <string>
using namespace std;
//function prototype
int* count(const string& s);
void count(const string& s, int counts[], int size);
void printArray(int* list, int size);
int main()
{
const int SIZE = 10;
int* Counts = count("12203AB3");
printArray(Counts, SIZE);
cout << ... | ALGO | 0.98815 | 3.891844 | {
"github_metadata": {
"branch": "master",
"commit_count": 56,
"repo_created_at": "2022-07-16T16:53:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b8b1e3884... |
3e7f3c4b-c8ca-4211-990c-b4e85e685f22 | hiroshi-maybe/topcoder | solutions/SurroundingGameEasy/SurroundingGameEasy.cpp | #include <fstream> // for greed plugin
#include <iostream>
#include <algorithm> // max,min
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>... | ALGO | 0.997588 | 4.284346 | {
"github_metadata": {
"branch": "master",
"commit_count": 1437,
"repo_created_at": "2015-05-24T07:26:54.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 5,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "97e22b7... |
e1339633-ce59-498a-9996-7a25d53ed06c | imraghavagr/DSA-cpp | DP/05.LongestCommonSubsequenceLCS/03.longestCommonSubstring.cpp | //https://practice.geeksforgeeks.org/problems/longest-common-substring1452/1#
#include<iostream>
using namespace std;
int longestCommonSubstr (string text1, string text2, int m, int n)
{
int t[m+1][n+1];
// initialization
for(int j =0; j<n+1; j++){
t[0][j] = 0;
}
for(int i = 1; i<m+1; i... | ALGO | 0.999985 | 4.933715 | {
"github_metadata": {
"branch": "main",
"commit_count": 497,
"repo_created_at": "2021-06-17T06:43:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0cd454a731... |
4817d2b8-1fc9-43c6-8a8f-035ce7601f19 | purveshjambhulkar/Strivers-DSA-Sheet | 06.Recursion/02.Subsequences Pattern/07.Combination Sum II.cpp | class Solution {
public:
void combinationSumUtil(vector<int>& candidates, int target,
vector<vector<int>>& ans, vector<int>& subset,
int index, int sum) {
// base case
if (sum == target) {
ans.push_back(s... | ALGO | 0.999963 | 6.409997 | {
"github_metadata": {
"branch": "main",
"commit_count": 228,
"repo_created_at": "2025-01-25T05:49:29.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a68fe88b56... |
955fcf5a-cf7d-4c7c-a2af-154215fac126 | Vinayak9307/POTD_AC | 5JAN2023/q2.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
int convertFive(int n);
// Driver program to test above function
int main() {
int T;
cin >> T;
while (T--) {
int n;
cin >> n;
cout << convertFive(n) << endl;
}
}
// } Driver Code Ends
int convertFive(int n){... | ALGO | 0.999818 | 5.844573 | {
"github_metadata": {
"branch": "master",
"commit_count": 33,
"repo_created_at": "2023-01-01T10:14:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2babd35d8... |
1c7f9cfc-0084-432a-a4cb-f2f56a8c6ad9 | ishandutta2007/codeforces-d | dorost/normal/NA/180.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
const int N = 106;
string s[N], b[N];
bool a[N][N];
int32_t main() {
int n;
cin >> n;
for (int i = 0; i <= 2 * n; i++) {
for (int j = 0; j <= 2 * n; j++) ... | ALGO | 0.999898 | 3.714884 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:31:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c570441f7758... |
f06b40e3-7e05-42fe-b4a4-d36834def9a2 | ujunhwan/algorithms_cpp | BAEKJOON/DP/2662.cpp | // https://www.acmicpc.net/problem/2662
// 2662번 기업투자
#include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
#define precision(x) cout << fixed; cout.precision(x)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
static const int INF = 0x7f7f7f7f;
const int d4x[4] = {1, 0, -1, 0... | ALGO | 0.999988 | 3.411183 | {
"github_metadata": {
"branch": "master",
"commit_count": 374,
"repo_created_at": "2020-02-26T12:18:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "869b1445... |
247d8724-5149-4eb2-bbea-460ca4a8432b | wellington3110/linkedlist | src/domain/LinkedList.cpp | #include "LinkedList.h"
#include "Elemento.h"
////////////////////metodos de inserção de elemento////////////
bool LinkedList::add(int value)
{
if (size == 0) {
primeiro= ultimo= new Elemento(value, NULL, NULL);
listaOrdenada= false;
size++;
return true;
}
return addLast(valu... | ALGO | 0.985787 | 4.399141 | {
"github_metadata": {
"branch": "master",
"commit_count": 17,
"repo_created_at": "2017-07-20T16:31:31.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4cfabba4a... |
1d577542-59d5-4a76-8559-9a45e48a7c14 | albexl/codeforces-gym-submissions | gym/101982/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(I,A,B) for(short I = A;I < B;++I)
#define WAIT cout << flush,system("PAUSE");
#define sz(s) ((int)((s).size()))
#define endl '\n'
#define MAX 10000005
typedef long long ll;
typedef pair<short, short> pii;
typedef vector<int> vi;
const int maxn = 1e7 + 5;
st... | ALGO | 0.999953 | 4.735401 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2021-07-07T02:03:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 3,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5af8fc6afc... |
77382fb0-ff94-4789-baa1-9797a2f95473 | RyusukeYashiro/Atcorder | dfs/2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <climits>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
#define mp map<int, int>
#define mpl map<long long, long long>
#define vv vector<vector<int>>
vector<string> hold;
int dx[4] = {... | ALGO | 0.999694 | 4.499022 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2024-07-20T07:47:30.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "eca1258a22c... |
73120c95-dab9-4b71-b173-b91a84f33cb3 | Sukarnapaul1893/Code-for-Popular-Topics-of-Contest-Programming | Data Structures/Segment Tree/Lazy without Propagation.cpp | //Light oj 1080
#include<bits/stdc++.h>
using namespace std;
int toggle[400020];
char arr[100005];
int query(int at, int L, int R, int pos){
if(L>pos || pos>R)return 0;
if(L == R)return toggle[at];
int mid = (L+R)/2;
if(pos<=mid)return toggle[at]^query(at*2,L,mid,pos);
else return toggle[at]^qu... | ALGO | 0.999904 | 4.127328 | {
"github_metadata": {
"branch": "master",
"commit_count": 206,
"repo_created_at": "2018-12-24T13:30:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ab828884... |
18f87612-b6ec-4903-bd51-ba8ffc0914d9 | hcnoh/jumping-into-cpp | ch08/test02.cpp | #include <ctime>
#include <cstdlib>
#include <iostream>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++ i)
#define FOR(i, b, e) for(auto i = b; i < e; ++ i)
#define all(x) (x).begin(), (x).end()
int rand_range(int min, int max) {
return rand() % (max - min + 1) + min;
}
int main() {
sr... | TOOL | 0.947858 | 3.553762 | {
"github_metadata": {
"branch": "master",
"commit_count": 22,
"repo_created_at": "2019-01-15T10:29:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "242930dd0... |
86669ac4-60e2-465b-b1ee-fc1a28aa1de4 | avikodak/Algorithms | src/sites/geeksforgeeks/trees/page05/findKthSmallestBST.h | /*****************************************************************************************************************
* File Name : findKthSmallestBST.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\sites\geeksforgeeks\trees\page05\findKthSmallestBST.h
* Created on : Jan 4, 2014 :: 11:12:02... | ALGO | 0.999956 | 5.660117 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2013-12-17T18:33:46.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3d44f1d07... |
f6816873-e5f6-401d-a0a2-e16fbe747ef6 | dbenders1/mpc | mpc_modules/include/mpc_modules/constraints/static_polyhedron_constraints.h | #ifndef MPC_MODULES_CONSTRAINTS_STATIC_POLYHEDRON_CONSTRAINTS_H
#define MPC_MODULES_CONSTRAINTS_STATIC_POLYHEDRON_CONSTRAINTS_H
#include <memory>
#include <vector>
#include <string>
#include <Eigen/Core>
#include <decomp_util/decomp_basis/data_type.h>
#include <decomp_util/ellipsoid_decomp.h>
#include <decomp_util/d... | TOOL | 0.969284 | 6.480094 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2024-11-13T09:54:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9dec696a8d... |
f4134d8d-c5e2-443b-aa58-248e775bfe64 | 2mulin/brushQuestion | LeetCode/algorithm/3301_3400/3307_char.cc | /**
* @date 2025/7/4
* @author 2mu
* @brief hard 找出第 K 个字符 II
*
* 1. 利用数学
* 利用数学思路,定位最终k位的字母是从哪个位置得来的,然后计算总共经历几次变化。
*
* 数学公式:k = 2的t次方 + 'a'
* t表示经历几次变化,计算出t的值,就可以得到k。
*
* 还是似懂非懂,没弄懂到底是怎么计算的...
*
* 时间复杂度:O(logN)
* 空间复杂度:O(1)
*/
#include <iostream>
#include <string>
#include <vector>
using namespace... | ALGO | 0.999419 | 4.718583 | {
"github_metadata": {
"branch": "master",
"commit_count": 485,
"repo_created_at": "2020-01-20T11:37:17.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8713b7af... |
93ecb8d4-8379-4577-80db-8274953292cf | ishandutta2007/codeforces-l | lawrenceli/normal/342/A.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 100010;
int n, a[MAXN], freq[10];
int main() {
if (fopen("input.txt", "r")) {
freopen("input.txt", "r", stdin);
}
scanf("%d", &n);
for (int i=0; i<n; i++) scanf("%d", &a[i]);
sort(a, a + n);
... | ALGO | 0.999619 | 3.138182 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T06:17:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "422d3b32823b... |
6bf31fda-4434-4f8a-baaf-c5d393efea44 | AdiCutitoiu/adventofcode2018 | Day 8/8.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <regex>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <map>
#include <list>
#include <numeric>
#include <functional>
#include <iterator>
#include <string>
#include <cstdlib>
using namespace st... | ALGO | 0.98631 | 3.77181 | {
"github_metadata": {
"branch": "master",
"commit_count": 10,
"repo_created_at": "2018-11-28T22:27:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "70b687910... |
09e6f622-0dfd-47d1-b6fe-f5d94d125ad3 | OpenModelica/OpenModelica | OMCompiler/SimulationRuntime/OMSICpp/runtime/include/Solver/CVode/CVode.h | /** @defgroup solverCvode Solver.CVode
* CVode class wrapper from sundials package
* @{
*/
#pragma once
#include "FactoryExport.h"
#include <Core/Solver/SolverDefaultImplementation.h>
#include <cvode/cvode.h>
#include <nvector/nvector_serial.h>
#include <sunlinsol/sunlinsol_dense.h> /* Default dense linea... | ALGO | 0.994941 | 6.542727 | {
"github_metadata": {
"branch": "master",
"commit_count": 37531,
"repo_created_at": "2015-05-03T16:59:29.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1002,
"forks": 322,
"issues": 2061,
"pull_requests": 46
},
"file_meta": {
"content_id":... |
f29c5e2f-459e-4b6e-ba62-848bd2f3a2c2 | Sarthak-coder-boy/Apna-College | Array/pair_sum.cpp | #include <iostream>
using namespace std;
int main()
{
int n, k;
cout << "Enter number of elements ";
cin >> n;
cout << "Enter the sum we want to search ";
cin >> k;
int c = 0;
int a[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
for (int i = 0; i < n - 1; i++)
... | ALGO | 0.999534 | 4.874302 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2022-03-23T06:17:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c9397e21cb53... |
af87a1f0-36a4-4df5-88af-15d6bfc3311e | Mh-Osman/codeforce1000ratingProblems | B1_The_Strict_Teacher_Hard_Version.cpp |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n, m, q;
cin >> n >> m >> q;
vector<int> v(m, 0);
for (auto &i : v) cin >> i;
vector<int> a(q);
for (auto &i : a) cin >> i;
sor... | ALGO | 0.999986 | 3.6656 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-09-16T15:28:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4329d28a66e... |
c88ac665-06f6-4c8e-ad19-020ff52b2b2d | AdamSimpson/iPic3D-pclcomm | communication/ComParticles3D.cpp | #include <mpi.h>
#include "ComParticles3D.h"
#include "ipicdefs.h"
/** comunicate particles and receive particles to and from 6 processors */
void communicateParticles(int buffer_size, double *b_Xleft, double *b_Xright, double *b_Yleft, double *b_Yright, double *b_Zleft, double *b_Zright, VirtualTopology3D * vct) {
... | ALGO | 0.999344 | 5.531415 | {
"github_metadata": {
"branch": "master",
"commit_count": 14,
"repo_created_at": "2014-09-27T20:42:50.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7263c93b3... |
4b9b9512-9abf-4b0c-b64c-363260b92b95 | alvls/parprog-2018-1 | groups/1508/grachev_vv/3-tbb/sol.cpp | #include <tbb/tbb.h>
using namespace tbb;
int GetBlockSize(int n, int num_threads){
int q = 1;
while ((q*q != num_threads) && (q*q < num_threads / 2 + 1))
q++;
return n / q;
}
class MatrixMultiplicator{
private:
const double *A, *B;
double *const C;
int const n;
public:
Matrix... | ALGO | 0.999399 | 5.38158 | {
"github_metadata": {
"branch": "master",
"commit_count": 644,
"repo_created_at": "2018-02-20T16:09:14.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 63,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d80412... |
b1cef590-2543-43f6-8197-983aab67b33d | ksheetiz/Competitive-Programming-Solutions | Very Easy Task_Codeforces.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<iomanip>
using ll = long long;
using namespace std;
ll n;
int x, y;
bool checkPossible(ll time){
ll l1 = floor(time / x);
ll l2 = floor(time / y);
return (l1 + l2) >= n;
}
int main() {
ios::sync_with_stdio(false);
... | ALGO | 0.999923 | 3.609481 | {
"github_metadata": {
"branch": "main",
"commit_count": 4,
"repo_created_at": "2025-01-15T15:05:48.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a5630ee0fd3d... |
ca12e850-af37-46d1-87bb-550e7627d2d1 | Jussmith01/CUDA_REMC_v2 | src/lib_cuda_functions.h | #include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <cuda.h>
#include <cuda_runtime.h>
#include <curand.h>
#include <curand_kernel.h>
#include <sstream>
#include <string>
#include <string.h>
#include <fstream>
using namespace std;
// ********************************************************************* /... | ALGO | 0.997029 | 3.128243 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-07-22T15:07:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0d0869c3b9... |
f63f60ba-7a9f-4299-8396-c34b7dfab0cc | ROCm/OpenFOAM_HMM | src/finiteArea/finiteArea/ddtSchemes/faDdtScheme/faDdtScheme.H | /*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-----------------------------------... | ALGO | 0.983396 | 5.32002 | {
"github_metadata": {
"branch": "suyash/hmm",
"commit_count": 25733,
"repo_created_at": "2022-10-27T12:31:36.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 25,
"forks": 4,
"issues": 0,
"pull_requests": 1
},
"file_meta": {
"content_id": "e1... |
b283a283-8a9e-4bfc-83bd-61f0a6449476 | martintrojer/symbolic-execution | llvm-2.6/lib/CompilerDriver/CompilationGraph.cpp | //===--- CompilationGraph.cpp - The LLVM Compiler Driver --------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open
// Source License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | ALGO | 0.997302 | 7.608333 | {
"github_metadata": {
"branch": "master",
"commit_count": 7,
"repo_created_at": "2011-11-10T08:38:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 24,
"forks": 9,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "fa1848cc8... |
9203dde0-021a-4737-9059-e9261d18a48c | dhruv-yadav-nitj/striver-a2z-dsa-cpp | Step 09 ~ Stacks and Queues/.INTERVIEW-TYPE-PROBLEMS/08-LRU-CACHE.CPP | #include <bits/stdc++.h>
using namespace std;
// IMPORTANT PROBLEM
// ITS LOGIC IS VERY EASY -> BUT IMPLEMENTATION IS QUITE LENGTHY
// https://leetcode.com/problems/lru-cache/description/
// using linked list since we need O(1) time in get and put function
class Node {
public:
int key, value ; Node *prev, *next... | ALGO | 0.997845 | 5.928339 | {
"github_metadata": {
"branch": "main",
"commit_count": 173,
"repo_created_at": "2023-06-07T19:26:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 52,
"forks": 13,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6e8fc8a... |
9e7d0f40-c4c1-479e-9bb2-bfa8ee4be7e3 | BobbyAnguelov/Esoterica | Code/Base/ThirdParty/cmdParser/cmdParser.h | /*
This file is part of the C++ CmdParser utility.
Copyright (c) 2015 - 2016 <NAME>
*/
#pragma once
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#include <sstream>
#include <functional>
#if _MSC_VER
#pragma warning(push, 0)
#pragma warning(disable: 4702)
#endif
namespace cli {
str... | TOOL | 0.959378 | 7.459921 | {
"github_metadata": {
"branch": "main",
"commit_count": 96,
"repo_created_at": "2022-07-15T23:24:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 986,
"forks": 72,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "f7f53d4b... |
cb48d20f-bf61-4fe5-b327-35820401e3bc | chanhosuh/convertible_bond_pricing | src/default_bond.cpp | /*
* File: default_bond.cpp
* Author: suh
*
* Created on May 5, 2013, 12:32 PM
*
* Pure CIR bond
*/
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
#include "CouponBond.h"
using namespace std;
// intensity for default process;
double lambda(double s)
{
return ... | ALGO | 0.994523 | 5.542531 | {
"github_metadata": {
"branch": "master",
"commit_count": 4,
"repo_created_at": "2015-11-26T21:27:06.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "dbc264c0e7... |
572f4a1e-b4a5-44d9-8190-959a0ed5e7ba | mraggi/Graph | app/Geometry/CPoint.cpp | #include "AllConvex.hpp"
bool CPoint::Intersects(const Point& other) const
{
return Position() == other;
}
bool CPoint::Intersects(const Line& other) const
{
return other.Intersects(Position());
}
bool CPoint::Intersects(const Circle& other) const
{
return other.Intersects(Position());
}
bool CPoint::In... | ALGO | 0.970362 | 5.440271 | {
"github_metadata": {
"branch": "master",
"commit_count": 74,
"repo_created_at": "2018-01-31T13:45:39.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 6,
"forks": 4,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6727f33ed... |
5cc2cb7e-67eb-40d5-8513-b7a5f1cb0d27 | VadimKey/VadimKeyHackerRankLib | sort.h | #pragma once
#include <utility>
#include <vector>
namespace HackerRank {
// Insertion sort (inplace), stable
// Time complexity O(N^2) (worst/average)
// https://en.wikipedia.org/wiki/Insertion_sort
template <typename T>
void insertsort(std::vector<T>& ar);
// Quicksort (inplace), non-stable
// Implements Lomuto pa... | ALGO | 0.999926 | 6.075493 | {
"github_metadata": {
"branch": "master",
"commit_count": 25,
"repo_created_at": "2016-06-14T21:12:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b612c74d1... |
ab411cff-8b26-4365-94cb-3c25e3d4cb7d | HughLocke/ACM-template | 图论/括号序列.cpp | //括号序列
/*首先dfs整棵树一遍,进入一个节点的时候加上一个左括号,然后是节点编号,
当这个节点的所有子树遍历完后再添上一个右括号,这就是括号序列
假如一棵树的括号序列是(1(2(3))(4(5)(6)(7(8))))
我们要求3到8的距离,截取两点间的括号序列为 3))(4(5)(6)(7(8
把编号和匹配的括号删掉 ))(((
剩下了5个左右括号,而这就是3到8的距离。这就是括号序列的性质。*/
/* 模板
操作1.将一个结点黑白变换,操作2.询问所有黑点之间的最长距离
解法:相当于求出括号序列,线段树维护两个黑点之间的最大距离sum*/
const int maxn = 1e5 + 10;
const int INF =... | ALGO | 0.999968 | 3.848587 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2020-03-11T06:27:27.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 13,
"forks": 2,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6bc376765... |
fb2228c0-0b85-438b-8248-c368c10552ca | monsicode/OOP_2024 | BooleanExprecionCalculator/main.cpp | #include <iostream>
#include <assert.h>
#include "MyString.h"
#include "StringView.h"
class BooleanInterpretator{
bool data[26]{false};
public:
void set(char ch, bool val )
{
assert(ch >= 'a' && ch <= 'z');
data[ch - 'a'] = val;
}
bool operator()(char ch) const{
assert(ch... | TOOL | 0.923003 | 3.933295 | {
"github_metadata": {
"branch": "main",
"commit_count": 101,
"repo_created_at": "2024-03-21T13:44:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c3545b5baa... |
c2c5b091-cb75-43c8-8845-4f443a50002d | erwincoumans/experiments | dynamics/ivi-sofa-tp1/sofa/helper/rmath.h | /******************************************************************************
* SOFA, Simulation Open-Framework Architecture, version 1.0 beta 4 *
* (c) 2006-2009 MGH, INRIA, USTL, UJF, CNRS *
* *
... | TOOL | 0.990064 | 3.96029 | {
"github_metadata": {
"branch": "master",
"commit_count": 443,
"repo_created_at": "2011-05-31T01:15:15.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 132,
"forks": 26,
"issues": 4,
"pull_requests": 0
},
"file_meta": {
"content_id": "87a24... |
33492f5a-1aec-4f2f-acdc-ccdfd2134b33 | kiwon0502/giwon_projects | Coding Test Practice/cpp/12851.cpp | #include <iostream>
#include <queue>
using namespace std;
#define MAX 100001
int cnt, ans;
bool visited[MAX];
int BFS(int N, int K) {
queue<pair<int, int>> q;
q.push({N, 0});
visited[N] = true;
while (!q.empty()) {
int cur = q.front().first;
int mov = q.front().second;
q.pop()... | ALGO | 0.999948 | 4.247491 | {
"github_metadata": {
"branch": "master",
"commit_count": 12,
"repo_created_at": "2021-09-06T07:11:21.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f8dcef81f... |
63d46a94-59a3-48b9-802c-c9b08a346f37 | dreyus95/AVSP_SourceQualityPrediction | CodeJamCrawler/dataset/11_24742_61.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std ;
int cmp(const void *a, const void *b)
{
return ((double *)a)[0] > ((double *)b)[0] ? 1 : -1 ;
}
int cmp2(const void *a, const void *b)
{
return ((double *)a)[2] > ((double *)b)[2] ? 1 : -1 ;
}
double calcdis(double len, double adds, dou... | ALGO | 0.999092 | 3.74198 | {
"github_metadata": {
"branch": "master",
"commit_count": 70,
"repo_created_at": "2017-06-08T21:00:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "6ba15f8c9... |
ae6190f2-60a1-4a6c-9ebe-983e17f9c11f | HIJIKI777/CPP_Test | kyopro/cross.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int h,w;
cin >> h >> w;
vector<vector<int>> v (h,vector<int>(w));
vector<int> h_sum(h);
vector<int> w_sum(w);
vector<vector<int>> v_res (h,vector<int>(w));
for(int i = 0; i < h; i++){
for(i... | ALGO | 0.999994 | 3.748142 | {
"github_metadata": {
"branch": "main",
"commit_count": 23,
"repo_created_at": "2022-06-09T10:03:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ddbd330c34b... |
727b2880-7872-442b-8350-4ebbd2df7ba0 | stan-dev/math | stan/math/opencl/rev/fmin.hpp | #ifndef STAN_MATH_OPENCL_REV_FMIN_HPP
#define STAN_MATH_OPENCL_REV_FMIN_HPP
#ifdef STAN_OPENCL
#include <stan/math/opencl/rev/adjoint_results.hpp>
#include <stan/math/opencl/matrix_cl.hpp>
#include <stan/math/opencl/kernel_generator.hpp>
#include <stan/math/opencl/prim/sum.hpp>
#include <stan/math/rev/core.hpp>
#inclu... | ALGO | 0.962515 | 7.292384 | {
"github_metadata": {
"branch": "develop",
"commit_count": 28933,
"repo_created_at": "2015-07-01T18:40:54.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 785,
"forks": 195,
"issues": 298,
"pull_requests": 19
},
"file_meta": {
"content_id": ... |
0f0d8f37-065e-49d1-8967-606bf192f1d8 | ioanaior/Tema-1-PA | colorare.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
using namespace std;
ifstream f("colorare.in");
ofstream g("colorare.out");
int mod = 1000000007;
// gasim o metoda mai eficienta de a calcula puterea (x^y)
long long int power(long long int x, long long int y) {
long long int result = 1;... | ALGO | 0.999711 | 3.952893 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-09-16T15:24:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ad5883cf306d... |
0c00deb1-216d-43ba-8c4f-e8c03aaf98ed | levelp/cpp | 01/HomeWork/main.cpp | // Решение квадратного уравнения
// -------------------------------
// Задание:
// Написать программу, которое решает квадратное уравнение.
// Пользователь вводит (с клавиатуры) три действительных коэффициента a, b, c.
// Программа выводит все решения уравнения (два, одно), "решений нет",
// если их нет или "бесконечн... | ALGO | 0.999519 | 4.624851 | {
"github_metadata": {
"branch": "master",
"commit_count": 2,
"repo_created_at": "2013-12-10T10:39:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 12,
"forks": 51,
"issues": 10,
"pull_requests": 1
},
"file_meta": {
"content_id": "256befe5... |
10892881-c39e-4b2e-a492-d1f020605c99 | zihadul10101/ICPC_Assiut_University_Community | codeforces/Codeforces Round 898 (Div. 4)/C_Target_Practice.cpp | #include<bits/stdc++.h>
using namespace std;
void slove(){
char ch[10][10];
for(int i=0;i<10;i++){
for(int j=0;j<10;j++){
cin>>ch[i][j];
}
}
// Count 'X' values in each ring
vector<int> ringCounts(5, 0);
for (int i = 0; i < 10; ++i) {
for (int j = 0; j < 10; ++j) {... | ALGO | 0.999429 | 5.102595 | {
"github_metadata": {
"branch": "main",
"commit_count": 177,
"repo_created_at": "2023-09-28T18:00:05.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "b6b0200a13... |
a5bcf548-84d8-42ba-844f-c12fba76c926 | lodejard/AllNetCore | dotnet/coreclr/src/utilcode/sortversioning.cpp | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
////////////////////////////////////////////////////////////////////////////
//
// File: SortVersioning.cpp
//
... | TOOL | 0.991469 | 4.804274 | {
"github_metadata": {
"branch": "master",
"commit_count": 56066,
"repo_created_at": "2016-04-23T05:12:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 4,
"issues": 0,
"pull_requests": 5
},
"file_meta": {
"content_id": "23dbb... |
060db89c-51a2-4d41-90cc-096667271dae | Eppie/euler | 5/Euler53.cpp | /*
* =====================================================================================
*
* Filename: Euler53.cpp
*
* Description: Solution to Project Euler, Problem 53
*
* Version: 1.0
* Created: 8/30/2016 8:26:04 PM
* Revision: none
* Compiler: g++
*
* A... | ALGO | 0.999794 | 5.724805 | {
"github_metadata": {
"branch": "master",
"commit_count": 208,
"repo_created_at": "2015-07-31T20:47:02.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "e4cc9b16... |
94d2abc9-ec9f-46f9-bb75-b58032d10403 | ElMoha943/sanjose | ExaminarCadena.cpp | //3) El usuario ingresa una frase y de esa frase hay que obtener:
//Numero de caracteres
//Numero de consonantes
//Numero de vocales
//Numero de palabras
#include <stdio.h>
#include <conio.n>
#include <string.h>
int main(){
char *frase;
int largo = 0, consonantes = 0, vocales = 0, palabras = 0;
printf("I... | ALGO | 0.979272 | 3.635563 | {
"github_metadata": {
"branch": "main",
"commit_count": 9,
"repo_created_at": "2022-12-19T17:20:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2dc744910d87... |
4ae2105f-9cf4-49de-bba6-90bd087c455b | cvc5/cvc5 | src/theory/bv/bitblast/bitblast_proof_generator.h | /******************************************************************************
* Top contributors (to current version):
* <NAME>, <NAME>
*
* This file is part of the cvc5 project.
*
* Copyright (c) 2009-2025 by the authors listed in the file AUTHORS
* in the top-level source directory and their institutional ... | ALGO | 0.991705 | 7.689318 | {
"github_metadata": {
"branch": "main",
"commit_count": 13437,
"repo_created_at": "2012-12-06T18:45:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1150,
"forks": 259,
"issues": 116,
"pull_requests": 56
},
"file_meta": {
"content_id": "5... |
fc8116fd-0089-4e3d-b1d7-1a1b2f1d3062 | Asif-Iqbal-Gazi/LeetCode | Unknown/medium/Unknown/1248.count_number_of_nice_subarrays.cpp | /*
* @lc app=leetcode id=1248 lang=cpp
*
* [1248] Count Number of Nice Subarrays
*/
// @lc code=start
class Solution {
private:
int noOfSubArraysAtmostKOdds(vector<int>& nums, int k) {
int ans = 0;
int n = nums.size();
int l = 0, r = 0;
while (r < n) {
if (nums[r... | ALGO | 0.999961 | 6.290064 | {
"github_metadata": {
"branch": "main",
"commit_count": 121,
"repo_created_at": "2022-02-23T19:38:26.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "aefa0cc905... |
fef48a3a-bf8d-473b-882e-48a71125181c | KashifAhmad1789/KashifAhmad-dsa | Sorting And Searching/17_VIMP_firstAndLastPosition.cpp |
/*
Find First and Last Position of Element in Sorted Array
Medium
6777
226
Add to List
Share
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
If target is not found in the array, return [-1, -1].
You must write an algorithm with O(log n)... | ALGO | 0.999993 | 5.894822 | {
"github_metadata": {
"branch": "main",
"commit_count": 36,
"repo_created_at": "2021-09-02T14:30:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "719f9e34ddd... |
fc1d6a09-ad64-4a92-b7ac-2cb09ac8151d | w0rmr1d3r/UAB_projects | 1A1S/FI/frogger/frog_ruben_ramon/Principal.cpp | // Fitxers de capcalera
#include <stdio.h>
#include <conio.h>
#include "Menu.h"
#include "Joc.h"
#include "GestioResultats.h"
// Declaracio de constants per a la seleccio dels menus
#define OPCIO_1 '1'
#define OPCIO_2 '2'
#define OPCIO_3 '3'
#define OPCIO_4 '4'
#define SORTIR '5'
#define SORTIR_2 '4'
void main()
{
... | TOOL | 0.916545 | 4.647991 | {
"github_metadata": {
"branch": "master",
"commit_count": 8,
"repo_created_at": "2018-02-12T10:04:42.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 1,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a82debd13e... |
b3237dfb-4d90-44f0-8e3f-ca37c9c28198 | camil0palacios/Competitive-programming | solutions/uri/mathematics/1492/solution.cpp | #include <bits/stdc++.h>
#define endl '\n'
#define M 57
using namespace std;
string s;
long long dp[57][2][57];
long long f(int idx, bool top, int acc){
if(idx == s.size())return acc;
if(dp[idx][top][acc] != 0)return dp[idx][top][acc];
int mmax = ( top ? s[idx] - '0' : 1);
long long ans = 0;
for(i... | ALGO | 0.999943 | 3.900637 | {
"github_metadata": {
"branch": "master",
"commit_count": 18,
"repo_created_at": "2018-10-30T16:26:22.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "afc9aa3dd... |
136a53a7-b445-4404-9e66-a2fff5e3a095 | artem-barsov/CP | mai/1 course/DS[16]/implicit_treap.cpp | #include <bits/stdc++.h>
using namespace std;
mt19937 rng;
struct Node {
int prior, value, cnt, max;
bool rev;
Node* l, * r;
Node(int value) : value(value), prior(rng()), max(value), l(nullptr), r(nullptr) {}
};
int cnt(Node* it) {
return it ? it->cnt : 0;
}
void upd_cnt(Node* it) {
if (it)
it->cnt = cnt(it... | ALGO | 0.999996 | 4.699422 | {
"github_metadata": {
"branch": "master",
"commit_count": 171,
"repo_created_at": "2020-06-15T17:43:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f89ea2db... |
c8a363fc-d9e5-48fb-a6a8-7d7872f2e54e | gianatz129/classes-and-objects | atienza-classes-and-objects.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
const int maxB = 100;
class Library {
private:
string titles[maxB];
string authors[maxB];
int years[maxB];
int bookCount;
public:
Library() : bookCount(0) {}
void clearScreen() const {
system("cls");
}... | TOOL | 0.983892 | 5.675212 | {
"github_metadata": {
"branch": "main",
"commit_count": 3,
"repo_created_at": "2024-08-28T13:11:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "7c92c54e31f5... |
0a407916-637b-442b-92e4-dc55234e549a | giongto35/CompetitveProgramming | security.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <que... | ALGO | 0.999946 | 3.307441 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2015-01-30T17:12:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c7a3f73e9b... |
51fa30a4-6806-47c0-94fa-173933de5751 | trantien1997/HashTable | HashTable.cpp | #include <iostream>
#include <vector>
#include <string>
// Khai báo cấu trúc node cho danh sách liên kết
struct Node {
std::string key;
std::string value;
Node* next;
Node(const std::string& k, const std::string& v) : key(k), value(v), next(nullptr) {}
};
// Lớp bảng băm
class HashTable {
private:
... | ALGO | 0.99947 | 5.706095 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-07-13T06:13:58.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "35821d7cca01... |
c9058407-92be-45d5-a100-896b4535ec8b | weidai11/cryptopp | crc.cpp | // crc.cpp - originally written and placed in the public domain by <NAME>
#include "pch.h"
#include "config.h"
#include "crc.h"
#include "misc.h"
#include "cpu.h"
NAMESPACE_BEGIN(CryptoPP)
// crc_simd.cpp
#if (CRYPTOPP_ARM_CRC32_AVAILABLE)
extern void CRC32_Update_ARMV8(const byte *s, size_t n, word32& c);
extern vo... | ALGO | 0.992427 | 6.570193 | {
"github_metadata": {
"branch": "master",
"commit_count": 6471,
"repo_created_at": "2015-06-03T21:53:52.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 5163,
"forks": 1564,
"issues": 58,
"pull_requests": 17
},
"file_meta": {
"content_id": ... |
c7503924-348d-4344-9f6f-0960f6c677d9 | Sadman007/DevSkill-Programming-Course---Basic---Public-CodeBank | DevSkill_CP/Advanced/Batch 3/Class 25/BABY.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[17], b[17], cost[17][17], dp[16][(1 << 16) + 1];
bool checkBit(int n, int pos)
{
int val = n & (1 << pos);
return val > 0;
}
int setBit(int n, int pos)
{
return n | (1 << pos);
}
int f(int x_v, int mask)
{
if(x_v >= n) return 0;
int &ret = dp[x... | ALGO | 0.999958 | 3.683001 | {
"github_metadata": {
"branch": "master",
"commit_count": 473,
"repo_created_at": "2019-02-28T11:59:59.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 84,
"forks": 58,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "776b21... |
ab20a8ef-f6a3-4bba-82c6-fb1c69999961 | H1ck1y/davis_navigation_system | src/TransportationPlannerCommandLine.cpp | #include "TransportationPlannerCommandLine.h"
#include <queue>
#include <iostream>
#include <cmath>
#include <unordered_map>
#include "StringUtils.h"
#include "GeographicUtils.h"
struct CTransportationPlannerCommandLine:: SImplementation{
std::shared_ptr<CDataSource> cmdsrc;
std::shared_ptr<CDataSink> outsink;... | TOOL | 0.905396 | 5.775926 | {
"github_metadata": {
"branch": "main",
"commit_count": 28,
"repo_created_at": "2024-03-30T18:47:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d66968fd20d... |
8869bee6-1c87-4818-bbbf-495fad1472e1 | vidit-04/A2Z-DSA-SHEET-STRIVER | Graph/Topo Sort and Problems/Course Schedule I and II .cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> CourseSchedule2(int n, int m, vector<vector<int>> prerequisites) {
vector<vector<int>> adj(n);
for(auto it : prerequisites){
adj[it[1]].push_back(it[0]);
}
vector<int>indegree(n,0);
for(int i=0;i<n;i++){
for(auto j : adj[... | ALGO | 0.999989 | 5.363054 | {
"github_metadata": {
"branch": "main",
"commit_count": 262,
"repo_created_at": "2024-06-17T10:52:23.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "89823a445c... |
5ac37505-9ab4-42f7-b110-ceb0ced8b43d | emilyju0314/gpt_code_plagiarism | dataset/code_content_classifier/allpro_train/0_0_4820.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> messages(n);
for (int i = 0; i < n; i++) {
cin >> messages[i];
}
for (int i = 0; i < n; i++) {
int count = 1; // Include the current message
int idx = i;
... | ALGO | 0.999988 | 4.957062 | {
"github_metadata": {
"branch": "main",
"commit_count": 50,
"repo_created_at": "2024-04-28T03:59:40.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2ebdef9ce80... |
84a8b533-d5b2-48c5-89d8-44f43b3ebaf9 | google-deepmind/open_spiel | open_spiel/games/markov_soccer/markov_soccer.h | // Copyright 2019 DeepMind Technologies Limited
//
// 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 l... | ALGO | 0.944006 | 7.826305 | {
"github_metadata": {
"branch": "master",
"commit_count": 4660,
"repo_created_at": "2019-07-22T13:50:21.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 4631,
"forks": 1006,
"issues": 17,
"pull_requests": 6
},
"file_meta": {
"content_id": "5... |
f949015f-4c75-4099-867c-500b48ba83e3 | neKonferenciya/LabWork | Konfer-ard-v2/Konfer-ard-v2.ino | /*
Инициализация
Принимает амплитуду сигнала, который нужно подать на выход
Считывет АЦП с трех каналов
Передает эти значения напряжений обратно на ПК
Подает на выход принятый в п.1 сигнал
Ожидает новую команду
*/
float b = 0;
int code = 0;
byte dcode1 = 0;
byte dcode2 = 0;
byte ADC1 = 0;
byte... | TOOL | 0.931042 | 3.697885 | {
"github_metadata": {
"branch": "master",
"commit_count": 29,
"repo_created_at": "2015-04-01T16:57:45.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "4eef22c8d8... |
d841a8fc-b46e-4940-b30d-6574b502c74c | Rim-SeungJae/PS-study | 21611.cpp | #include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
const int dirr[4] = {0,1,0,-1},dirc[4] = {-1,0,1,0};
vector<int> marbles;
vector<pair<int,int>> blizzard;
int n,m;
bool isneg(int a)
{
return a<0;
}
int main()
{
int arr[100][100];
int cnt[4]={0,};
scanf("%d %d",&n,&m);
for(int i=0;i<n;... | ALGO | 0.99972 | 3.064881 | {
"github_metadata": {
"branch": "main",
"commit_count": 219,
"repo_created_at": "2022-11-17T05:22:32.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "65cdbe6007... |
c39c0fd9-3963-427e-b0f7-dff54c00e632 | VaibhavVerma16113108/Competitive-Programming | Codeforces/Photo-To-Remember.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
int w[n];
int h[n];
int sum_widths = 0;
for (int i = 0; i < n; i++)
{
cin >> w[i] >> h[i];
sum_widths += w[i];
}
int max_height = 0;
int second_max_height = 0;
for (int i... | ALGO | 0.99999 | 3.745433 | {
"github_metadata": {
"branch": "main",
"commit_count": 48,
"repo_created_at": "2021-01-26T07:09:24.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "5d5b32f122f... |
88397550-8b5d-41d9-8f2a-e67ec3fd6bdc | z-vista/YZJPdetectsystem--- | YZJPdetectsystem/Calibration.cpp |
#include "stdafx.h"
#include "Calibration.h"
using namespace std;
using namespace cv;
#define PI 3.1415926
//最新标定所用函数
void mysharpen(cv::Mat& src)
{
cv::Mat dst = src.clone();
cv::Mat kernel(3, 3, CV_32F, cv::Scalar(-1));
kernel.at<float>(1, 1) = (float)8.9;
filter2D(src, dst, src.depth(), kernel);
src = dst.... | ALGO | 0.955549 | 3.460374 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-10-13T06:14:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a2b042bc4b... |
2b5e19ee-c9d2-412c-9cb9-9901cd613844 | BangKartavya/GFG | Move All Zeros to End of Array/main.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
void pushZerosToEnd(int arr[], int n) {
int zeros = 0;
vector<int> vp;
for(int i =0;i<n;i++) {
if(arr[i]==0) zeros++;
else vp... | ALGO | 0.999863 | 5.632361 | {
"github_metadata": {
"branch": "main",
"commit_count": 632,
"repo_created_at": "2023-08-22T14:55:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "cf8ada6008... |
eda47ac1-901a-4dd1-aef6-b5bd20d6733d | Haar-you/competitive_programming | codeforces/1157/g.cpp | #include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (a); v < (b); ++v)
#define FORE(v, a, b) for(int v = (a); v <= (b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define REV(v, a, b) for(int v = (a); v >= (b); --v)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).... | ALGO | 0.999918 | 3.410621 | {
"github_metadata": {
"branch": "master",
"commit_count": 257,
"repo_created_at": "2018-08-13T08:37:43.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "2bd775a2... |
07841e62-137f-43be-ab02-0667477125bb | KanhaBhawani/HackerRankCpp | virtual_functions.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
class Person
{
protected:
string name;
int age;
public:
virtual void getdata() = 0;
virtual void putdata() = 0;
};
class Professor : public Person
{
int publications;
static int id... | ALGO | 0.965787 | 3.402436 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2021-05-11T17:26:51.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "0b2b2899ae... |
65f7d063-101b-47b9-855d-843be8474887 | Gurubalan-GIT/CCC | C++/Compiler-Design/Leading&Trailing/Smaller.cpp | //Author : <NAME>
#include<iostream>
#include<cstring>
using namespace std;
char lead[20] = "", trail[20] = "";
char * Leading(char sym , char prod[][20], int n)
{
int k = strlen(lead);
if(!isalpha(sym)) {lead[k] = sym; lead[k+1] = '\0';}
else if(islower(sym)) {lead[k] = sym; lead[k+1] = '\0';}
else
... | ALGO | 0.999934 | 3.539165 | {
"github_metadata": {
"branch": "master",
"commit_count": 242,
"repo_created_at": "2019-03-02T04:29:12.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 33,
"forks": 11,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "59ef46... |
d45d2a0e-2edf-4119-b4e4-315394961c87 | lehoangbaochung/Console | ApplicationAlgorithm/lib/cpp/recuise.cpp | #include <iostream>
using namespace std;
// in các số nguyên từ 1 đến n viết đệ quy
void print(int n)
{
if (n > 1)
print(n - 1);
cout << " " << n;
}
// tính tổ hợp chập k của n dựa trên công thức
// C(k, n) = C(k-1, n-1) + C(k, n-1)
int C(int k, int n)
{
if (k == n || k == 0)
return 1;
... | ALGO | 0.99957 | 4.258589 | {
"github_metadata": {
"branch": "master",
"commit_count": 34,
"repo_created_at": "2021-12-08T15:12:18.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "8831d3443... |
0e0e7b83-8ef1-4720-8c26-3c2b09ca66cc | krishna6431/Competitive-Programming-Works | 2022/CodeChef/Starter59/Confusing_Concatenations.cpp | /*
ॐ त्र्यम्बकं यजामहे सुगन्धिं पुष्टिवर्धनम् |
उर्वारुकमिव बन्धनान्मृत्योर्मुक्षीय माऽमृतात् ||
*/
// All Important Header Files
#include <bits/stdc++.h>
// ALL IMPORTANT MACROS
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define deb(x) cout << x << endl;
#define display(star... | ALGO | 0.999551 | 3.748616 | {
"github_metadata": {
"branch": "master",
"commit_count": 189,
"repo_created_at": "2020-10-26T20:27:57.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef0ef9fb... |
3a35de75-2631-4f88-9cc1-56d15c5aa8f4 | smhx/codeforces | 992/EE.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define LOCAL
#ifdef LOCAL
#define DEBUG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DEBUG(fmt, ...)
#endif
#define getchar() \
(*_pbuf ? *_pbuf++ \
: (_buf[fread(_pbuf = _buf, 1, 1048576, stdin)] = 0, *_pbuf++))
char _buf[1048577], *_pbuf... | ALGO | 0.999966 | 4.7003 | {
"github_metadata": {
"branch": "master",
"commit_count": 16,
"repo_created_at": "2018-05-10T21:21:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "136ff45ad... |
aa15c6f0-cf35-4aaf-b200-e48100a71916 | paparakri/pdp | lottery.cpp | #include <stdio.h>
#include <algorithm>
using namespace std;
int K, N, Q;
char X[110];
char Y[110];
long long price[120];
struct node {
char c;
int cnt;
node* child[10];
node(char x) {
cnt = 0;
c = x;
for(int i=0;i<10;i++) child[i] = nullptr;
}
void insert(int m) {
cnt++;
if(m==K) return;
int i =... | ALGO | 0.999879 | 3.66996 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2023-09-03T16:10:33.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "72714643bc7e... |
df06d709-d12d-4113-b9a7-c187b71cbe71 | kamyu104/LeetCode-Solutions | C++/restoreIpAddresses.cpp | // Time Complexity: O(n^m), where n is max length of number, m is count of segment
// Space Complexity: O(nm)
class Solution {
public:
vector<string> restoreIpAddresses(string s) {
vector<string> ans;
dfs(s, 0, 4, "", ans);
return ans;
}
private:
voi... | ALGO | 0.999858 | 5.428295 | {
"github_metadata": {
"branch": "master",
"commit_count": 19395,
"repo_created_at": "2018-10-11T17:38:35.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 4939,
"forks": 1616,
"issues": 1,
"pull_requests": 55
},
"file_meta": {
"content_id": ... |
59109b0d-425b-4e9a-b2e6-0c2b408faf99 | fryzito/ACM-problems-solved | merged_c++_implementaions/OneHandedTypist.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | ALGO | 0.998961 | 4.09241 | {
"github_metadata": {
"branch": "main",
"commit_count": 57,
"repo_created_at": "2015-01-08T18:11:10.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "f3cc49a7f61... |
b82bfcb6-5b49-4fb9-9ecd-a61d468d583c | apple/turicreate | src/external/boost/boost_1_68_0/libs/compute/perf/perf_merge.cpp | //---------------------------------------------------------------------------//
// Copyright (c) 2013-2014 <NAME> <<EMAIL>>
//
// 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
//
// See http://boostorg.github.com/com... | ALGO | 0.997243 | 6.154246 | {
"github_metadata": {
"branch": "main",
"commit_count": 1571,
"repo_created_at": "2017-12-01T00:42:04.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 11198,
"forks": 1137,
"issues": 502,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
eca1c8c6-b597-4bd3-9fca-43dba692b684 | brianmartens/TabGen | TabGen/TabGen DataProcessing/Crosstabulation/Algebra.h | #ifndef ALGEBRA_H_INCLUDED
#define ALGEBRA_H_INCLUDED
#include "bmath.h"
const bool is_numeric(const std::string& NumberString){
if(NumberString.size() > 0){ // if value is not empty
for(size_t i=0 ; i<NumberString.size() ; ++i){
if(!isdigit(NumberString[i])){
if(NumberString[i]... | TOOL | 0.920347 | 4.342816 | {
"github_metadata": {
"branch": "master",
"commit_count": 3,
"repo_created_at": "2017-09-12T16:39:55.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d8a35b68ad... |
813c89a8-2ef6-402d-b911-0472e0ab92ed | MarkGillespie/CEPS | src/ConePlacement.cpp | #include "ConePlacement.h"
namespace CEPS {
std::vector<Vertex> placeCones(ManifoldSurfaceMesh& mesh,
IntrinsicGeometryInterface& geo, double uTol,
size_t minNumCones, size_t gaussSeidelIterations,
bool verbose) {
// We o... | ALGO | 0.999724 | 6.102986 | {
"github_metadata": {
"branch": "main",
"commit_count": 12,
"repo_created_at": "2021-08-25T21:36:07.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 105,
"forks": 14,
"issues": 1,
"pull_requests": 0
},
"file_meta": {
"content_id": "ef6068d4... |
bd0a340b-2c14-480c-beb5-4a02283cfa49 | aerimforest/Algorithm-Study | Baekjoon/hyeonyoung/새로운 게임 2.cpp | // 220911_BOJ_17837
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
int N, K, board[13][13];
int dx[] = {0, 0, 0, -1, 1};
int dy[] = {0, 1, -1, 0, 0};
struct horse
{
int r, c;
int d;
} horses[11];
stack<int> game[13][13];
void white(int k, int x, int y, int d, int xx, int yy)
{
... | ALGO | 0.999521 | 4.144984 | {
"github_metadata": {
"branch": "main",
"commit_count": 2022,
"repo_created_at": "2022-08-16T13:07:44.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 11,
"forks": 15,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "c5e69dd... |
eb0f6ea4-e074-4869-99af-63c7b7bea1c6 | timurrrr/mipt-cs-timurrrr | 2ndyear/cpp/stl/sort_demo.cpp | #include <stdio.h>
#include <algorithm>
#include <vector>
class MyClass {
public:
explicit MyClass(int v) { value = v; }
int value;
// {{{1
// By the way, this if forbidden by Google C++ Code Style Guide
bool operator< (const MyClass &other) const {
return value < other.value;
}
// }}}
};
// {{{... | ALGO | 0.998423 | 5.699744 | {
"github_metadata": {
"branch": "master",
"commit_count": 1,
"repo_created_at": "2011-05-05T20:54:53.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 1,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "3717a63082... |
46d70749-fefb-40b5-bfc0-9682e27d6fba | ishandutta2007/codeforces-f | frodakcin/normal/1370/F2.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <vector>
const int MN = 1e3+10;
int T, N, d[MN], p[MN], L, X, root;
std::vector<int> a[MN], q, in[MN];
bool u[MN];
char s[100];
void dfs(int n)
{
in[d[n]].push_back(n);
for(auto x:a[n])
if(p[n]!=x)
p[x]=n, d[x]=d[n]+1, dfs(x);
... | ALGO | 0.999631 | 3.604162 | {
"github_metadata": {
"branch": "main",
"commit_count": 1,
"repo_created_at": "2024-04-11T01:43:09.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "a31929758577... |
8885e2da-069e-43dd-8b83-5d7ff0e87399 | indefinitelee/bridge | hw/02/LRW218_hw2_q3.cpp | /*Question 3:
Suppose John and Bill worked for some time and we want to calculate the total time both
of them worked. Write a program that reads number of days, hours, minutes each of them
worked, and prints the total time both of them worked together as days, hours, minutes.
Hint: Try to adapt the elementary method fo... | ALGO | 0.989076 | 4.023426 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2024-01-15T15:39:37.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "9486a01ae0a7... |
cab05955-c0b1-421b-b474-6d2f79b12933 | artoolkit/ARToolKit5 | lib/SRC/KPM/FreakMatcher/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h | // -*- coding: utf-8
// vim: set fileencoding=utf-8
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2009 <NAME> <<EMAIL>>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as... | ALGO | 0.989373 | 6.931016 | {
"github_metadata": {
"branch": "master",
"commit_count": 466,
"repo_created_at": "2020-01-15T02:41:01.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 298,
"forks": 122,
"issues": 6,
"pull_requests": 0
},
"file_meta": {
"content_id": "03065... |
02454321-45ba-4963-9039-e875c8b60bcb | AndreMendezCisneros/arduino-proyectos | motor_ruedas_0.1/motor_rueda0.2.ino | const int IN1 = 2;
const int IN2 = 3;
const int IN3 = 4;
const int IN4 = 5;
// Secuencia para pasos completos (4 pasos)
int stepSequence[4][4] = {
{1, 0, 1, 0}, // Paso 1
{0, 1, 1, 0}, // Paso 2
{0, 1, 0, 1}, // Paso 3
{1, 0, 0, 1} // Paso 4
};
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT... | ALGO | 0.999257 | 5.438194 | {
"github_metadata": {
"branch": "main",
"commit_count": 2,
"repo_created_at": "2025-07-07T16:43:04.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "d9e005b9e465... |
d0b86ed3-59be-4fed-8c8a-f5afb854dd10 | wrf-model/WRF | var/da/da_radiance/ATMS_Spatial_Average.inc | !
SUBROUTINE ATMS_Spatial_Average(Num_Obs, NChanl, FOV, Time, BT_InOut, &
Scanline, Error_Status)
IMPLICIT NONE
! Declare passed variables
integer(i_kind) ,intent(in ) :: Num_Obs, NChanl
integer(i_kind) ,intent(in ) :: Fov(num_obs)
real(r_kind) ,intent(in ) :: Time(Num_Obs)
... | ALGO | 0.978859 | 4.437488 | {
"github_metadata": {
"branch": "master",
"commit_count": 6746,
"repo_created_at": "2016-08-16T20:39:14.000Z",
"is_fork": false,
"is_org_owned": true,
"forked_from": null,
"stars": 1417,
"forks": 765,
"issues": 161,
"pull_requests": 21
},
"file_meta": {
"content_id": "... |
2708ba2d-6718-4dc8-bb57-52b95c0b3bb4 | zuhaib786/CompetitiveWork | USACO/Bronze/Greedy/Even-Odd-Photos/EvenOddPhotos.cpp | #include<bits/stdc++.h>
using namespace std;
using lli = long long int;
void setIO(string name)
{
freopen((name + ".in").c_str(), "r", stdin);
freopen((name + ".out").c_str(), "w", stdout);
}
int main()
{
int n;
cin>>n;
int arr[2];
memset(arr, 0, sizeof(arr));
for(int i = 0; i<n; i++)
{
... | ALGO | 0.999967 | 3.435409 | {
"github_metadata": {
"branch": "main",
"commit_count": 27,
"repo_created_at": "2022-04-16T12:03:25.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 0,
"forks": 0,
"issues": 0,
"pull_requests": 0
},
"file_meta": {
"content_id": "116ac917dc6... |
0bde8658-6cfa-48ce-bde7-d6b11c326b19 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/08/0822/personal_submission/cf360b_retyrn.cpp | int n, k;
bool check(const vector<int>& a, ll val) {
vector<ll> f(n);
iota(all(f), 0LL);
for (int i = 0; i < n; i ++) {
// 枚举上一个不改的位置
for (int j = 0; j < i; j ++) {
if (abs(a[i] - a[j]) <= val * (i - j)) {
chmin(f[i], f[j] + (i - j - 1));
}
}
... | ALGO | 0.999988 | 4.648865 | {
"github_metadata": {
"branch": "main",
"commit_count": 20410,
"repo_created_at": "2024-02-26T01:04:08.000Z",
"is_fork": false,
"is_org_owned": false,
"forked_from": null,
"stars": 478,
"forks": 302,
"issues": 0,
"pull_requests": 7
},
"file_meta": {
"content_id": "e34e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.