uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
9a2a4465-74bb-4f80-ae26-2e6976f2b518 | Zhang-RQ/OI_Code_10wL_Completion | LOJ/3057.cpp | #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MAXN=5010;
char str[MAXN];
int n,m,q,c[MAXN],visp[MAXN],col[MAXN],vis[MAXN][MAXN],Ans[MAXN][MAXN],fa[MAXN];
vector<int> G[MAXN],nG[MAXN];
vector<pair<int,int> > Es,En;
int find(int x){return x==fa[x]?x:fa[x... | ALGO | 0.999973 | 4.186157 |
136c8af5-c9c5-4a07-8ec5-2c9d585816de | kenjinote/hyakutyping | src/ShuffleWaka.cpp | /*!
\file
\brief a̕т̃VbtNX
\author Satofumi KAMIMURA
$Id$
\todo ܂莚̂Ƃɂ́A܂莚O[vŃ\[g
*/
#include "ShuffleWaka.h"
#include "WakaData.h"
#include <algorithm>
#include <set>
#include <boost/random.hpp>
using namespace boost;
struct ShuffleWaka::pImpl {
enum {
InvalidNo = -1,
// !!! 6 ł߂Ȃ̂łƂ肠 +2 ĂB s... | ALGO | 0.987195 | 5.378978 |
53aaede4-a3c7-465b-b49d-8053ab58ba2e | EgorMichel/Proga4sem | 03_fenics/cpp/Poisson.cpp | #include <dolfin.h>
#include "Poisson.h"
using namespace dolfin;
// Source term (right-hand side)
class Source : public Expression
{
void eval(Array<double>& values, const Array<double>& x) const
{
double dx = x[0] - 0.5;
double dy = x[1] - 0.5;
values[0] = 10*exp(-(dx*dx + dy*dy) / 0.02);
}
};
// ... | ALGO | 0.9977 | 6.368789 |
063ffa88-b690-4afe-bf2a-dbd4ec897813 | gzhu-team-509/tup-design-and-analysis-of-algorithm | Book-Code/Chapter09/zju1140-Hungary-DFS-Vector.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
using namespace std;
vector<int> map[105];
int p,n;
bool use[305];
int match[305];
bool dfs(int x)
{
for(int i=0;i<map[x].size();++i)
{
if(!use[map[x][i]])
{
use[map[x][i]] = true;
if(!match[map[x][i]]||dfs(match[map[x][i]]))
{
... | ALGO | 0.999836 | 3.842219 |
d9f368d4-a3e2-4a51-8d12-d7ed8b60ab80 | JustEndRay/Lab2.3-OOP- | Source.cpp | #include "LongLong.h"
#include <iostream>
int main()
{
LongLong A, B;
cout << "\nValue1 = " << endl;
cin >> A;
cout << A;
cout << "\nValue2 = " << endl;
cin >> B;
cout << B;
cout << "\nA-B = " << endl;
cout << A-B;
cout << "A++" << endl; cout << A++ << endl;
cout << "A--" << ... | ALGO | 0.972951 | 3.744422 |
a726fe0e-76e6-49f8-90d1-af95e215d6f7 | tzupengwang/PECaveros | contest/Petr2018ITMOU/d.cpp | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef long double ld;
int n , k;
ld ans;
ld cal( int p ){
if( ((1 << n) - k - (1 << p) + 2) <= 0 )
return 0;
double ret = 1. , up = (1 << n) - k , dn = (1 << n) - 1;
for( int _ = 0 ; _ < (1 << p) - 1 ; _ ++ ){
... | ALGO | 0.999312 | 4.113113 |
9b559e5d-4cef-4493-b9cb-b10ce0ea9a8e | jaydcarlson/netmf-community-ports | DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/crypto/des/des_enc.cpp | /* crypto/des/des_enc.c */
#include "des_locl.h"
#include "spr.h"
void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
{
register DES_LONG l,r,t,u;
#ifdef DES_PTR
register const unsigned char *des_SP=(const unsigned char *)DES_SPtrans;
#endif
#ifndef DES_UNROLL
register int i;
#endif
register DES_LON... | ALGO | 0.998656 | 5.395316 |
77afe077-2283-484b-97e7-1c7be39d9038 | harshita9104/DSA | 1666-make-the-string-great/make-the-string-great.cpp | class Solution {
public:
string makeGood(string s) {
string result = "";
//result string ka last char dekho agar vo aane wale char s[i] ka +- 32 hai , kyuki kisi bhi letter klowercase or uppercase ka ascii diff is 32 so to check if two adjacent letters are capital and lowercase
//check this... | ALGO | 0.999878 | 6.21416 |
7a681503-b37c-478a-b448-25854ecf9b6a | muawiyaKaleem/Semester-3 | Link_Lists/Doubly.cpp | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *next , *prev;
node(int value)
{
data = value;
next = prev = NULL;
}
};
class List
{
private:
int length;
node *head;
public:
List()
{
head = NULL;
length = ... | ALGO | 0.999524 | 3.916874 |
f97edce9-32da-40f2-93fd-13dffd99fad2 | Nickx58/Problem-Solving | LeetCode/LeetCodeJuneChallenge/5.RandomPickWithWeight.cpp | class Solution
{
public:
vector<int> v;
Solution(vector<int> &w)
{
srand(time(NULL));
int n;
n = w[0];
for (int i = 1; i < w.size(); i++)
{
w[i] += w[i - 1];
n = w[i];
}
v = w;
}
int pickIndex()
{
return upper_bound(v.begin(), v.end(), rand() % v.back()) - v.begi... | ALGO | 0.999921 | 5.63642 |
26f3f74e-e221-4857-b255-e279b68db9ea | rahsanalsaymon/Codeforces-solutions | 1966B Rectangle Filling.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(t) t.begin(), t.end()
#define rall(t) t.rbegin(), t.rend()
#define forr(x, n) for (int i = x; i < n; i++)
#define ff first
#define ss second
#define pb push_back
#define nl '\n'
#define faster \
ios_base::sync... | ALGO | 0.999861 | 4.845181 |
9af883ee-9f38-4868-b0f3-a2fed908564c | Akhil404/CNS-Lab | cnslab-master/yash/Lab4/polynomial_arithmetic.cpp | #include<bits/stdc++.h>
#include<gmpxx.h>
using namespace std;
class polynomial{
public:
int degree;
int prime;
vector<mpz_class>coeffs;
polynomial()
{
degree=0;prime=0;
coeffs.clear();
}
friend istream& operator>>(istream&,polynomial&);
friend ostream& operator<<(ostream&,polynomial&);
friend polynomial oper... | ALGO | 0.999486 | 3.435028 |
07f7c2a2-6fd3-4725-bb0e-a9f6166ea221 | suraj-sp101201/LEETCODE | 827. Making A Large Island.cpp | class Solution {
public:
// combine all groups and name the group as a number with greater than 1 so that we can differentiate upcoming 1's.
/*
1111 2222
0000 -----> 0000
1110 3330
0001 0004
*/
// add the sizes o... | ALGO | 0.99997 | 6.238167 |
797bccd7-214a-4551-b9e7-ae4bf5687453 | duongtrieuelec/LeetSolve | cpp-leetcode/leetcode90-subsets-ii_bfs2.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
// 方法: 回溯/dfs
class Solution {
public:
vector<vector<int>> subsetsWithDup(vector<int>& nums) {
vector<vector<int>> res;
if (nums.size() < 1) return res;
sort(nums.begin(), nums.end());
vector<int> curSet... | ALGO | 0.999929 | 5.15676 |
2be58a16-78ad-48f3-94ed-3bc4369d154f | dodonut/Competitive-Programming | UVA-CP3/Data_Structures/Non_Linear_DS_with_Built_in_libs/STL_priority_queue/10954_add_all.cpp | #include <iostream>
#include <queue>
int main()
{
int t, val, tot_cost, result;
while (scanf("%d", &t), t)
{
std::priority_queue<int, std::vector<int>, std::greater<int>> q;
while (t--)
{
scanf("%d", &val);
q.push(val);
}
tot_cost = 0;
... | ALGO | 0.999801 | 4.249087 |
a16c8356-4208-48c1-8047-0adc23ed9d29 | tinjet11/boostorder_demo | 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.998799 | 6.776823 |
5c4c7a36-f4b5-48d5-a424-cbc47cccff33 | raincross7/code-similarity | codes/train_code/problem076/problem076_418.cpp | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz... | ALGO | 0.999956 | 3.695612 |
8ce18a60-42f8-4754-8828-9326d94d6d3e | Dhananjay-shrivastav/CxxPrimerPlus | chapter7/ex7.cpp | /*
Redo Listing 7.7, modifying the three array-handling functions to each use two pointer
parameters to represent a range. The fill_array() function, instead of returning the
actual number of items read, should return a pointer to the location after the last location
filled; the other functions can use this pointer as ... | ALGO | 0.987056 | 6.409935 |
3baeaaa7-f7f4-477d-8a98-58dbb13683a7 | michaelysj/cppprimer | cppprimer1/cppprimer1.23.cpp | #include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item item1, item2;
int num;
if (std::cin >> item1)
{
num = 1;
while (std::cin >> item2)
{
if(item1.isbn() == item2.isbn())
{
++num;
}
else
{... | TOOL | 0.89201 | 4.75032 |
c7b11e4d-6d01-462e-bd07-d9c63a5e9172 | fupengfei058/algorithm | Leetcode/41. First Missing Positive.cpp | /*First Missing Positive:Given an unsorted integer array, find the first missing positive integer.*/
//交换数组元素,使得数组中第i位存放数值(i+1)。最后遍历数组,寻找第一个不符合此要求的元素,返回其下标。
class Solution {
public:
int firstMissingPositive(vector<int>& nums) {
int i = 0;
int n = nums.size();
while(i < n){
if(nums[i... | ALGO | 0.999938 | 4.521057 |
ae6499db-4844-4af0-95a1-3e79418c7160 | CodeTemplar99/cuesoft-developer-test | 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.998859 | 6.785645 |
c2ddc582-a844-495c-b1a7-5f6567dfe5f2 | omnirom/android_system_core | init/host_import_parser.cpp | #include "host_import_parser.h"
#include <android-base/strings.h>
using android::base::StartsWith;
namespace android {
namespace init {
Result<void> HostImportParser::ParseSection(std::vector<std::string>&& args, const std::string&,
int) {
if (args.size() != 2) {
... | TOOL | 0.866896 | 5.113592 |
8669d8e3-cc97-4198-91f4-cd26a2be3cc2 | pavellevap/code_antiplagiat | final_test/1/t9938_522_C_10196167.cpp | #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <string>
#include <vector>
#include <cstdio>
#include <cassert>
#include <ctime>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef WIN32
#define LLD "%I64d"
#else
#define LLD "%lld... | ALGO | 0.999748 | 3.406587 |
67cad7d0-0e03-44c7-920a-b79d827d1027 | Jackey0903/Stardew-Valley | Stardew-Valley/cocos2d/cocos/math/CCVertex.cpp | #include "math/CCVertex.h"
#include "base/ccMacros.h"
NS_CC_BEGIN
void ccVertexLineToPolygon(Vec2 *points, float stroke, Vec2 *vertices, unsigned int offset, unsigned int nuPoints)
{
nuPoints += offset;
if(nuPoints<=1) return;
stroke *= 0.5f;
unsigned int idx;
unsigned int nuPointsMinus = nuPoin... | ALGO | 0.988472 | 5.824827 |
b7bb5674-021a-4689-b5f0-8b74115fbbd6 | bmgandre/hackerrank-cpp | src/algorithms/implementation/counting_valleys/counting_valleys.cpp | #include "counting_valleys.h"
#include <algorithm>
#include <string>
using namespace hackerrank::bmgandre::algorithms::implementation;
/// Practice>Algorithms>Implementation>Counting Valleys
///
/// https://www.hackerrank.com/challenges/counting-valleys
int counting_valleys::solve(int n, std::string s)
{
auto height... | ALGO | 0.999967 | 6.18404 |
eefe0fb2-de4e-49d3-98b6-ed2cafbf55a6 | sarvex/leetcode-nim | solution/1600-1699/1664.Ways to Make a Fair Array/Solution.cpp | class Solution {
public:
int waysToMakeFair(vector<int>& nums) {
int s1 = 0, s2 = 0;
int n = nums.size();
for (int i = 0; i < n; ++i) {
s1 += i % 2 == 0 ? nums[i] : 0;
s2 += i % 2 == 1 ? nums[i] : 0;
}
int t1 = 0, t2 = 0;
int ans = 0;
f... | ALGO | 0.99999 | 5.733522 |
827c9e47-1495-4322-9c6a-0d5f41b50247 | ankur-kayal/Contests | codeforces/1526/C2.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
void run_cases() {
int N;
cin >> N;
vector<int64_t> A(N);
for(auto &u: A)
cin >> u;
int ans = 0;
int64_t health = 0;
vector<int64_t> pq;
make_heap(pq.begin(), pq.end());
for(int i=0;i<N;i++) {
he... | ALGO | 0.999834 | 4.783072 |
b39c84a8-2329-464c-b3be-3724d7fea03d | Deepti675/Competitive_CB | Binary_Tree/Construct Binary Tree from Preorder and Inorder.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 6.468906 |
41570e1f-16a8-422b-823e-b5928a2ceb52 | MarkCarbonell98/UniFirstSemester | IPK_Programmierkurs/Ubungsblatt03/loesung.cpp | #include <iostream>
#include <cmath>
#include <limits.h>
//this statements makes that the compiler automatically associates each function declared in this scope with the std:: class (just use it, don't ask much ;)
using namespace std;
//function to calculate the numbers x1 and x2
//the boolean only works to decide wh... | ALGO | 0.999106 | 4.151719 |
01b5e6c8-ba62-4fd6-9a8a-2b11e04089e1 | sungwonnoh/codetree-TILs | 240109/정렬된 숫자 위치 알아내기/indices-of-sorted-array.cpp | #include <iostream>
#include <algorithm>
using namespace std;
class Find{
public:
int n,idx,o;
Find(int n,int idx){
this->n=n;
this->idx=idx;
}
Find(){}
};
bool cmp(Find a, Find b){
if(a.n==b.n){
return a.idx < b.idx;
}
return a.n<b.n;
}
in... | ALGO | 0.999981 | 4.332686 |
4d7383de-63b7-4a16-add3-02f60add2658 | Sangeo/ECE-2020-FYP | face_recognition/previous_code/liveplot_rBCG.cpp | #include "opencv_helper.h"
using namespace cv;
namespace plt = matplotlibcpp;
constexpr auto M_PI = 3.141592653589793;
CascadeClassifier face_cascade;
typedef std::chrono::high_resolution_clock Clock;
typedef std::chrono::milliseconds milliseconds;
const bool DEBUG_MODE = false;
const bool DEBUG_MODE2 = false;
std:... | ALGO | 0.98602 | 3.531111 |
85e95eff-6bfa-4bef-a0b0-f572aedaffec | duttaANI/AL_Lab | Leetcode/797_AllPathsFromSourcetoTarget.cpp | class Solution {
public:
vector< vector<int> > paths;
void dfs(int x, vector<int> & cur, int trgt, vector<vector<int>>& graph, vector<int> & vis ){
if( x==trgt ){
cur.push_back(x);
paths.push_back( cur );
cur.pop_back();
return ;
}
... | ALGO | 0.999897 | 5.934278 |
5ed12530-a403-40a6-8750-7f7da6993367 | mdsiaofficial/ProblemSolving | UVa/p10071.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#define pi 3.14159
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define ld long double
#define fs(n) fixed<<setprecision(int(n))
#define s(n) setprecision(int(n))
using namespace std;
int m... | ALGO | 0.998457 | 3.826458 |
8265f710-c384-4577-bdd5-68a65bdb7bfa | roshan-raj14/coding_questions | sliding window maximum.cpp | // leetcode 239 - sliding window maximum
class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector<int> ans;
deque<int> q; //using deque bcz popback and popfront dono ka need hai
int n = n... | ALGO | 0.99999 | 6.032345 |
47674366-3358-458d-83c3-6e818bcc8011 | CST-Modelling-Tools/Coin4TonatiuhXX | src/misc/SoCompactPathList.cpp | #include "misc/SoCompactPathList.h"
#include <cassert>
#include <Inventor/SoFullPath.h>
#include <Inventor/lists/SoPathList.h>
#include <Inventor/errors/SoDebugError.h>
/*!
\class SoCompactPathList SoCompactPathList.h Inventor/misc/SoCompactPathList.h
\brief The SoCompactPathList class is used to optimize SoPath... | TOOL | 0.856202 | 7.006268 |
64d8315a-cefc-482b-82d6-a38e7539c034 | nybzmr/CP | Rebuild/Basics/13_bitwise_operations_and_bitmasks/Swap_bits.cpp | // Author: Nayaab Zameer
#include <bits/stdc++.h>
using namespace std;
#define pi (3.141592653589)
#define mod 1000000007
#define pb push_back
#define is insert
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min... | ALGO | 0.999913 | 4.441292 |
cba2f205-8614-49a8-8606-986abd365fea | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/minimize-manhattan-distances-Solution.minimumDistance/177913_Exec_Code_Overflow.cpp | tt_cmap8_validate( FT_Byte* table,
FT_Validator valid )
{
FT_Byte* p = table + 4;
FT_Byte* is32;
FT_UInt32 length;
FT_UInt32 num_groups;
if ( table + 16 + 8192 > valid->limit )
FT_INVALID_TOO_SHORT;
length = TT_NEXT_ULONG( p );
if ( table + len... | ALGO | 0.988774 | 4.452071 |
655ae12a-e8ee-4d78-a2c5-d55772d3995d | RichardJeanBaptiste/CISC-3142 | Lab-2/Q4.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main() {
double length, radius, requiredSpace, areaOfTree;
cout << "Enter: length, radius, requiredSpace" << "\n";
cin >> length >> radius >> requiredSpace;
float treeDiameter = 2 * radius;
float treeSpace = treeD... | ALGO | 0.998971 | 4.964371 |
8d507b46-50ed-48e9-a82e-d436e8a4de1f | VipulRaj-123/DSA | Graph/Possible paths between source and destination.cpp | /* Possible paths between source and destination in directed graph */
void dfs(vector<int>adj[],int s,int d,int &count){
if(s==d)
count++;
else{
for(int i=0;i<adj[s].size();i++)
dfs(adj,adj[s][i],d,count);
}
}
int countPaths(int V, vector<int> adj[], int... | ALGO | 0.999921 | 5.503829 |
6c5490ad-97bc-40e3-87bc-1012560eb5dd | SandeepMaithani/Problem_Solving_Placement_series | Solutions/Merge two sorted Arrays without extra space.cpp |
//Method 1 (without using seprate space)
//Time complexity O(N1 + N2) and Space Complexity O(1)
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) {
int fill = n + m - 1;
int fst = m - 1;
int sec = n - 1;
while (fst >= 0 && sec >= 0) {
if (nums1[fst] >= nums2[sec]) {
... | ALGO | 0.999993 | 5.683172 |
32669e20-c4e1-4abc-834e-77b037907668 | arpitgpta/Competitive_Programming | luckyno.cpp | #include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL)
#define endl '\n'
#define int long long int
using namespace std;
#define pii pair <int, int>
#define pb push_back
#define loop(s, e, itr) for (int itr = s; itr < e; itr++)
#define vin vector<int>
#def... | ALGO | 0.999825 | 5.190605 |
17829e62-69fb-46b3-9ba6-4d9014b5233a | karankhalas/assigment | OOPS Program/Program 5.cpp | #include <iostream>
#include <cmath>
class Circle
{
private:
double radius;
public:
Circle(double r)
{
radius = r;
}
// Function to calculate the area of the circle
double calculateArea()
{
return M_PI * radius * radius; // M_PI is a constant representing pi
}
/... | TOOL | 0.995725 | 6.991602 |
36d531fa-83b4-4587-8954-ff462334e130 | rmagon/cprog | Stack/07-Next Greater Element.cpp | #include <iostream>
#include <stack>
#define SIZE 4
using namespace std;
int main() {
stack<int> st;
int arr[4];
arr[0] = 11;
arr[1] = 13;
arr[2] = 21;
arr[3] = 3;
st.push(arr[0]);
for(int i=1;i<4;i++)
{
int next = arr[i];
int element = st.top();
while(element < next)
{
st.pop();
cout<<"Next o... | ALGO | 0.999928 | 3.667236 |
5971896e-6085-4e10-af56-0d5566bfe082 | thuylinhptit/CTDL_GT | contest6/MergeSort.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
vector <ll> a;
int main (){
ll t;
cin>>t;
while( t-- ){
ll n;
cin>>n;
a.resize(n);
for( ll i=0; i<n ; i++ ) cin>>a[i];
sort( a.begin(), a.end() );
for( ll i=0; i<n ; i++ ) cout<< a[i]<< ' ';
cout<< endl;
}
}
| ALGO | 0.999551 | 3.439764 |
d65ef081-d27b-4bea-a8dd-b890cf4c4f22 | milphaser/HN | 03.HNG/1.Arsac/3.HN ver.0.7x/2.MAX/4.uint64/0.77/UnitMain.cpp | //---------------------------------------------------------------------------
// Hamming Numbers Generator
// Hamming Number Namespace ver. 0.77 templatized
//---------------------------------------------------------------------------
// {Dynamic Programming}
//-------------------------------------------------------... | TOOL | 0.905019 | 5.54428 |
f0e27430-e1e0-498e-8b32-cba5a904791f | Azure1709/OOP_Assignment | LAB_2/Bai7/Polygon.cpp | #include "Polygon.h"
#include <iostream>
#include <cmath> // Thu vien cho ham fabs (gia tri tuyet doi)
using namespace std;
// Constructor mac dinh
Polygon::Polygon() : n(0), x(nullptr), y(nullptr) {}
// Constructor voi tham so n la so diem
Polygon::Polygon(int n) : n(n) {
x = new float[n];
y = new float[n];
... | ALGO | 0.976308 | 5.084862 |
da377839-37c6-4873-b231-e0a9620a9e4b | vishalpa8/DSA | String Algorithm/longestPalindromicSubstring.cpp | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0)
/*
bruteforce approach, where we are storing characters in temp in a linear way and other hand
in temp2 we are storing character's in reverse order. and if it is palindrome and if value ... | ALGO | 0.999826 | 5.274763 |
04e8e7e5-c6eb-47bd-99e2-f623ad0cba71 | IvyLH03/algo-contest-archive | contest-algo-archive/lg/3369.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
const int N=1e6,INF=1e8;
int n,tot,rt;
struct node{
int val,lc,rc,size,pri,cnt;
#define v(x) a[x].val
#define ls(x) a[x].lc
#define rs(x) a[x].rc
#define s(x) a[x].size
#define p(x) a[x].pri
#define c(x) a[x].cnt
}a[40*N];
void upt(int k){
s(k)=s(ls(k))+... | ALGO | 0.999961 | 3.766343 |
a84cf710-11b2-4806-9b11-b83bf11ab246 | evellynsc/arboreal-jump-number-algorithms | solver/old/multi_flow_model.cpp | /*
* multi_flow_model.cpp
*
* Created on: Feb 23, 2022
* Author: evellyn
*/
#include "multi_flow_model.h"
namespace solver {
MultiFlowModel::MultiFlowModel() { this->type = solver::COMPACT; }
MultiFlowModel::MultiFlowModel(ajns::Instance& problem_instance_) {
this->type = solver::COMPACT;
this->p... | ALGO | 0.984547 | 5.635342 |
a8a6a360-dc94-4855-bdd9-c5fd24fb4c1e | beamiter/cbp | Ipopt/Ipopt/src/Algorithm/LinearSolvers/IpMa86SolverInterface.cpp | #include "IpoptConfig.h"
#ifdef COIN_HAS_HSL
#include "CoinHslConfig.h"
#endif
// if we do not have MA86 in HSL or the linear solver loader, then we want to build the MA86 interface
#if defined(COINHSL_HAS_MA86) || defined(HAVE_LINEARSOLVERLOADER)
#include "IpMa86SolverInterface.hpp"
#include <iostream>
#include <cm... | TOOL | 0.918469 | 6.737372 |
84942389-d3d9-4c5f-9c4c-89023e7d4429 | ohyoodan/ohyoodan_3rd_grade | Project1/Test3.cpp | #include <iostream>
#include <functional>
#include <vector>
class Event {
public:
using EventHandlerFunc = std::function<void()>;
void Subscribe(const EventHandlerFunc& handler) {
eventHandlers.push_back(handler);
}
void Trigger() {
for (const auto& handler : eventHandlers) {
... | TOOL | 0.871422 | 6.215244 |
1757af48-0ca2-40c9-b6d7-4148e860ca7e | pingchungchang/CP | CF1617B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
ll k;
ll c;
ll a,b;
cin>>k;
if((k&1) == 1){
k -=1;
k/=2;
if((k&1) == 1){
a = k+2;
b = k-2;
c = 1;
}
else{
a = k+1;
b = k-1;
c = 1;
}
}
else{
k -= 1;
k /=2;
a = k;
b = k+1;
c = 1;
}
cout<<a<<... | ALGO | 0.999861 | 3.696954 |
747c22a8-288b-4cfc-833b-9fad2d1fa442 | Ylarod/goron | llvm/tools/llvm-exegesis/lib/Uops.cpp | #include "Uops.h"
#include "Assembler.h"
#include "BenchmarkRunner.h"
#include "MCInstrDescView.h"
#include "Target.h"
// FIXME: Load constants into registers (e.g. with fld1) to not break
// instructions like x87.
// Ideally we would like the only limitation on executing uops to be the issue
// ports. Maximizing po... | TOOL | 0.874647 | 7.601211 |
b7611592-0392-451e-9c53-1bc79c999c28 | swacisko/pace-2022 | WGYC/extern/KaHIP/lib/tools/graph_extractor.cpp | #include <unordered_map>
#include "graph_extractor.h"
graph_extractor::graph_extractor() {
}
graph_extractor::~graph_extractor() {
}
void graph_extractor::extract_block(graph_access & G,
graph_access & extracted_block,
PartitionID block,
... | ALGO | 0.983256 | 3.661431 |
39624407-5473-4fc2-91f9-e8eb28c4b35c | FoxZFox/CompetitivePrograming | progrtaming.in.th/Seven_Dwarves.cpp | #include <iostream>
using namespace std;
int main()
{
int nums[9];
int sum = 0;
for (size_t i = 0; i < 9; i++)
{
cin >> nums[i];
sum += nums[i];
}
for (size_t i = 0; i < 9; i++)
{
for (size_t j = i + 1; j < 9; j++)
{
if (sum - (nums[i] + nums[j]... | ALGO | 0.999714 | 4.181565 |
1e94210c-e8ad-4dbc-b65d-1a0341e5e84b | programMiro24/C-plus-plus | 4 Grade/ogledalo_n.cpp | #include<iostream>
using namespace std;
int main()
{
int n,c,ogl;
cin>>n;
while(n)
{
c=n%10;
ogl=ogl*10+c;
n=n/10;
}
cout<<ogl<<endl;
return 0;
}
| ALGO | 0.999747 | 3.843743 |
1a74ea85-8ac8-4ab1-a0bc-caaf6383c54e | AnkitMajee/DataStructureInCpp | R) Intervals/nested-intervals-check.cpp | /**
* Range Containment Problem
*
* Problem Statement:
* Given n ranges [x, y], determine for each range:
* 1. Does this range contain any other range?
* 2. Is this range contained within any other range?
*
* Input:
* - First line: Number of ranges (n)
* - Next n lines: Two integers x, y representing range ... | ALGO | 0.999965 | 7.508679 |
22539cfd-4960-4b44-b5dc-32b1bff9307f | crisbodnar/Programare | Piese2/main.cpp | #include <iostream>
#include <fstream>
using namespace std;
ifstream fin("piese2.in");
ofstream fout("piese2.out");
long long t, n, k, sum, poz1, poz2;
int main()
{
fin>>t>>n>>k;
while(t--)
{
sum = 0;
for(int i=1; i<=k; i++)
{
fin>>poz1>>poz2;
sum += poz2 ... | ALGO | 0.999846 | 3.229788 |
7ce4fe8b-4cbd-4289-9f3c-5affb6fe1379 | jerredchen/A1_SLAM | fast_gicp/thirdparty/Eigen/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.996416 | 3.081962 |
62f6b446-7861-4ea8-b45a-d6a4c7d25d08 | bashell/CppStandardLibrary | ch11/partialsum1.cpp | #include "algostuff.hpp"
using namespace std;
int main()
{
vector<int> coll;
INSERT_ELEMENTS(coll, 1, 6);
PRINT_ELEMENTS(coll);
partial_sum(coll.cbegin(), coll.cend(), ostream_iterator<int>(cout, " "));
cout << endl;
partial_sum(coll.cbegin(), coll.cend(), ostream_iterator<int>(cout, " "), m... | ALGO | 0.942275 | 4.846282 |
658a720d-b896-4e5e-958e-aebed72e18d8 | tjdvyzl/algorithm_study | baekjoon/1043/1043.cpp | #include <iostream>
#include <vector>
using namespace std;
int N, M; // N Ƽ M
int true_number; // ƴ
vector<int> party[51];
vector<int> graph[51];
bool check[51];
bool visit[51];
bool exist(int bound, int input) { // ٿ ° input ϴ üũ
for (int i = 0; i < graph[bound].size(); i++)
if (graph[bound][i] == input)... | ALGO | 0.999867 | 4.01949 |
4c5e097c-67ea-4583-8dba-4dd9082a495e | Shahrad-Mirzaei/Code-Templates | codes/Matrix.cpp | void build(matrix &mat, ll s)
{
mat.resize(s);
for(ll i=0;i<s;i++)
{
mat[i].resize(s);
}
}
matrix operator*(matrix a, matrix b)
{
matrix c;
c.resize(a.size());
for(ll i=0;i<c.size();i++) c[i].resize(b.size());
for(ll i=0;i<a.size();i++)
{
for(ll j=0;j<b.size();j++)... | ALGO | 0.999804 | 3.539893 |
87a77a25-4148-43df-8c6e-745c67c3e13d | HMD-CVA/Code | baitapc++/bt/tach fibo.cpp | #include <bits/stdc++.h>
using namespace std;
typedef string bignum;
int cmp(bignum a, bignum b)
{
while (a.size()<b.size()) a="0"+a;
while (a.size()>b.size()) b="0"+b;
if (a>b)
return 1;
if (a==b)
return 0;
else return -1;
}
bignum bigadd(bignum a, bignum b)
{
int i,s,carry=0;
bignum c="";
while(... | ALGO | 0.999931 | 3.381582 |
d47076f1-d551-4686-aabc-e97af2a4d1c2 | charul124/100_days_code | Difficulty: Easy/Segregate 0s and 1s/segregate-0s-and-1s.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
void segregate0and1(vector<int> &arr) {
// code here
sort(arr.begin(), arr.end());
}
};
//{ Driver Code Starts.
i... | ALGO | 0.99953 | 6.205104 |
2dd5955c-c1fd-490b-89f1-b840f2ec147e | raincross7/code-similarity | codes/train_code/problem325/problem325_431.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define full(a) a.begin(),a.end()
#define stoink stack<ll>
#define vec vector <ll>
#define vg vector<vector<ll> >
#define vgw vector<vector<pair<ll,ll> >
#define pa pair<ll,ll>
#define mp make_pair
#define pb push_back
int main() {
ll n,l;
cin >>... | ALGO | 0.999929 | 3.149174 |
7c35129d-af82-4abf-885c-c068510ce525 | crystalspace/CS | libs/csgeom/bsptree.cpp | #include "cssysdef.h"
#include "csgeom/bsptree.h"
#include "csgeom/math3d.h"
#include "csgeom/tri.h"
#include "csutil/set.h"
//---------------------------------------------------------------------------
CS_IMPLEMENT_STATIC_CLASSVAR_REF (csBSPTree, b2fArray, B2fArray,
csDirtyAccessArray<int>, ());
namespace
{
CS... | ALGO | 0.994033 | 6.381066 |
a78745f0-d169-4984-884c-0fd2d1aea127 | AnooshaaAli/Parallel-Influence-Maximization-Analysis | .history/algo5-6/main_20250502231030.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <unordered_map>
#include <string>
#include <cmath>
#include <omp.h>
#include <set>
#include <algorithm>
#include <queue>
#define MAX_TOPICS 10
#define DAMPING 0.85
#define EPSILON 0.0001
#define MAX_ITER 100
using namespace std;
str... | DATA | 0.99839 | 5.591585 |
3a723acf-bbf6-44f5-96e6-cbc3f22b94a6 | QbitQuantum/Basics | Исходники/find_cross_field_singularities.cpp | IGL_INLINE void igl::find_cross_field_singularities(const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const Eigen::PlainObjectBase<DerivedM> &Handle_MMatch,
... | ALGO | 0.988304 | 5.021355 |
887db55f-41e4-4ad8-b54c-b3903f1ea6b2 | singlavinod/Self-Driving-Car-NanoDegree-Udacity | Term3-Path-Planning-Concentrations-and-Systems/Project1-Path-Planning/src/Eigen-3.3/bench/benchmark-blocking-sizes.cpp | #include <iostream>
#include <cstdint>
#include <cstdlib>
#include <vector>
#include <fstream>
#include <memory>
#include <cstdio>
bool eigen_use_specific_block_size;
int eigen_block_size_k, eigen_block_size_m, eigen_block_size_n;
#define EIGEN_TEST_SPECIFIC_BLOCKING_SIZES eigen_use_specific_block_size
#define EIGEN_T... | TOOL | 0.891531 | 5.95051 |
24ad8c59-2081-473f-94c6-6f90dea0574c | mariamaitoumelloul/mariamaitoumelloul-cppcourse-brunel | Week1/Neuron.cpp | #include "Neuron.h"
#include <iostream>
using namespace std;
double Neuron::I_time( double time, double a, double b)
{
if (time<=b and time>=a)
{
return Iext;
}else{
return 0;
}
}
void Neuron::Update (double simtime , double I)
{
if ( membrane_potentiel>V_thr)
{
spiketime=simtime;
spike_number+... | TOOL | 0.953662 | 3.8545 |
983114dc-df71-4546-9db4-37609b5202d2 | huxingyi/autoremesher | thirdparty/cgal/CGAL-5.1-beta1/demo/Polyhedron/Plugins/Point_set/Point_set_to_mesh_distance_plugin.cpp | #include <CGAL/Three/Polyhedron_demo_plugin_interface.h>
#include <CGAL/Three/Polyhedron_demo_plugin_helper.h>
#include <CGAL/Three/Three.h>
#include <QApplication>
#include <QDockWidget>
#include <QObject>
#include <QAction>
#include <QMainWindow>
#include <Scene_surface_mesh_item.h>
#include <Scene_points_with_normal... | TOOL | 0.932675 | 6.732927 |
efd1748c-c084-4a28-b3e1-7d0199d41a39 | MorozovGZ/lab03 | project/svg.cpp | #include "svg.h"
#include <vector>
#include <string>
#include <iostream>
using namespace std;
size_t find_max(const vector<size_t>& bins)
{
size_t max = bins[0];
for (const auto& bin : bins)
{
if (bin > max)
{
max = bin;
}
}
return max;
}
void svg_begin(double wi... | TOOL | 0.862004 | 5.528058 |
0a36466d-a101-4d05-933f-c7628f5038a8 | icansong/Algorithm_Coding_Test_C- | 05_2_BFS/027.cpp | // 미로 탐색하기
#include <iostream>
#include <queue>
using namespace std;
static int dx[] = {0 ,1 ,0, -1};
static int dy[] = {1, 0, -1, 0};
static int A[101][101];
static bool visited[101][101] = {false};
static int N, M;
void BFS(int i, int j);
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie... | ALGO | 0.99989 | 4.219825 |
79d326ad-fdcb-4da3-a727-ab0b42d08e7b | snavely/bundler_sfm | src/KeyMatchFull.cpp | /* KeyMatchFull.cpp */
/* Read in keys, match, write results to a file */
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "keys2a.h"
int ReadFileList(char* list_in, std::vector<std::string>& key_files) {
FILE* fp;
if ((fp = fopen(list_in, "r")) == NULL) {
printf... | ALGO | 0.971561 | 5.228872 |
414e3197-3fbb-464e-b077-7c31d18ce7da | apple-opensource/llvmCore | lib/CodeGen/ProcessImplicitDefs.cpp | #define DEBUG_TYPE "processimplicitdefs"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
#include ... | TOOL | 0.874711 | 7.790203 |
bb4fc62c-302a-467b-a2b9-1da70f4801fa | MME-NTU-KhPI/MatViz3D | moore.cpp | #include <ctime>
#include <cmath>
#include "myglwidget.h"
#include "parent_algorithm.h"
#include "moore.h"
Moore::Moore()
{
}
Moore::Moore(short int numCubes, int numColors)
{
this->numCubes = numCubes;
this->numColors = numColors;
}
const std::array<std::array<int32_t, 3>, 26> MOORE_OFFSETS = {{
{-1, -... | ALGO | 0.997182 | 3.924373 |
17393835-4423-4a2e-91c7-5d6736a3dfcf | cpe102/practica-exam-rehearsal-arclxngth | rehearsal_4.cpp | #include <iostream>
using namespace std;
string compress(string t1){
int x=0;
string sum;
while(x<=t1.size()){
if(x%3==0){
sum +=t1[x];
}
x+=3;
}
return sum;
}
int main()
{
string a = compress("ABCDEFGHIJKLMN");
string b = compress("123456");
... | ALGO | 0.999892 | 3.293206 |
a524a83c-ceac-4bcd-9638-88d8ebefec7b | murataksoy/adventofcode-2021 | day13.cpp | // to compile - g++
#include <iostream>
#include <fstream>
#include <string>
#include <deque>
#include <vector>
#include <array>
#include <set>
#include <stack>
#include <utility>
#include <map>
using namespace std;
vector<string> fold(vector<string> paper, char fold_axis, int fold_coord)
{
int nx = paper[0].size... | ALGO | 0.999032 | 4.89087 |
dff5eacd-64e1-459b-93e4-a95ee0da16e6 | kifah-s/Problem_Solving | Gammal_Tech_Academy/2_C++_Programming_Language/Exercises/Pro_536_DemoFunction_With_Conditions_Program/DemoFunction_With_Conditions_Program_V1.cpp |
//* DemoFunction With Conditions Program (Version 1).
/*
* Create a program that includes a function demoFunction with a static variable.
* In the main function, call demoFunction with both true and false conditions and observe the behavior of the static variable.
! Output:
! Static Variable Value: 10
*/
#include <... | TOOL | 0.898278 | 5.745136 |
dd155aeb-2d50-4b0e-aa2b-f76437ade5ef | WBhlietue/OS-lab | lab7/15.cpp | #include <math.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
#include <pthread.h>
#include <stdlib.h>
const double fibo = (1 + pow(5, 0.5)) / 2;
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
double *ans;
double CalculateFibonacci(int num, double fibo)
{
return (pow(fibo, num) - pow(1 - fi... | ALGO | 0.999819 | 3.20439 |
ff5936cf-2a21-4223-952f-072bee6ba6d1 | CrookedAndroid/frameworks_av | media/libcpustats/CentralTendencyStatistics.cpp | #include <stdlib.h>
#include <cpustats/CentralTendencyStatistics.h>
void CentralTendencyStatistics::sample(double x)
{
// update min and max
if (x < mMinimum)
mMinimum = x;
if (x > mMaximum)
mMaximum = x;
// Knuth
if (mN == 0) {
mMean = 0;
}
++mN;
double delta =... | ALGO | 0.991194 | 6.234724 |
c05b9de2-e661-4744-92cb-a46e6de31f7c | eval1749/evita-common-lisp | mini/mini_18_hash_table.cpp | #include "./mini_lisp.h"
namespace MiniLisp
{
namespace
{
static const int Default_Size = 511;
static const int Default_RehashSize = 130;
static const int Default_RehashThreshold = 67;
static const Int MaxHashCode = HashTable::MaxHashCode;
} // namespace
static bool htb_need_rehash_p(Val);
static v... | ALGO | 0.973495 | 5.915175 |
85f08a32-f62a-4ab6-bc9f-9319c8727df6 | Owen864720655/algorithm_book | codes/algorithms_cpp/029/029.12.1二叉搜索树 BST.cpp | #include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
typedef struct BSTree
{
int nValue;
struct BSTree *pLChild;
struct BSTree *pRChild;
}BSTree, *PBSTree;
PBSTree InsertBSTree(PBSTree pRoot, int nValue)
{
if (pRoot == NULL)
{
pRoot = (PBSTree)malloc(sizeof(BSTree));
if (!pRo... | ALGO | 0.999972 | 3.548386 |
2d56d107-5cf0-43fe-80bc-f60c5c808aa1 | starlino/librepilot | ground/gcs/src/libs/eigen/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.976233 | 4.145121 |
fddd6530-b2a2-4fdc-b787-062ca5fc60de | Shourya-Dubey/LOVEBABBAR_DSA_YOUTUBE | lec22_CharArrya/MaximumOccu.cpp | #include<iostream>
using namespace std;
char maxOccu(string s){
char arr[26] = {0};
for(int i = 0; i<s.length(); i++){
char ch = s[i];
int number;
number = ch - 'a';
arr[number]++;
}
int maxi = -1, ans = 0;
for(int i = 0; i<26; i++){
if(maxi < arr[i]){
... | ALGO | 0.999881 | 3.859831 |
f6557f2c-4727-449c-ac41-14679f4cd508 | EmptyOne/Boomberman2 | CollisionManager.cpp | // CollisionManager.cpp
#include "stdafx.h"
#include "Collider.h"
#include "CollisionManager.h"
bool CollisionManager::Check(Collider* lhs, Collider* rhs, int& overlapX, int& overlapY)
{
// we use something called Separating Axis Theorem
// link: en.wikipedia.org/wiki/Hyperplane_separation_theorem#Use_in_collisio... | ALGO | 0.914739 | 4.905689 |
e84925e9-516c-47fb-9739-ba9b35d983f5 | nilay2207/CP | codechef/laptop_recommendation.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() \
ios_base::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL)
#define MOD 1000000007
#define MOD1 998244353
#define INF 1e18
#define nline "\n"
#define pb push_back
#define ppb pop_back
#define mp... | ALGO | 0.999787 | 5.189164 |
c92d8738-26dc-4a72-9445-425d15c43035 | raincross7/code-similarity | codes/train_code/problem476/problem476_326.cpp | #include <bits/stdc++.h>
using namespace std;
int n,m,a[100001];
int gcd(int x,int y) {
if (x<y) swap(x,y);
if (y==0) return x;
else return gcd(y,x%y);
}
int main() {
cin>>n>>m;
for (int i=0; i<n; i++) cin>>a[i];
long long lcm=0,p2=0;
for (int i=0; i<n; i++) {
long long num=a[i];
... | ALGO | 0.999995 | 4.134535 |
cac1d770-e86d-4e34-bd4d-2bf719d98ae6 | savsiout/gpu-autosched-update | src/Util.cpp | #include "Util.h"
#include "Debug.h"
#include "Error.h"
#include "Introspection.h"
#include <atomic>
#include <chrono>
#include <fstream>
#include <iomanip>
#include <map>
#include <mutex>
#include <sstream>
#include <string>
#ifdef _MSC_VER
#include <io.h>
#else
#include <stdlib.h>
#include <unistd.h>
#endif
#include... | TOOL | 0.907292 | 4.682477 |
0b1aafac-72df-454e-8de7-56811d983b29 | Sungjun0204/softeer_practice_codes | [Lv.1]/[Lv.1] 연탄 배달의 시작.cpp | /*
- 주어진 숫자들의 각 차이를 하나씩 계산해서 차이가 가장 작은 수를 계산
- 그럼 그 작은 수의 차이가 나는 두 숫자의 조합이 얼마나 있는지 세어서 그 갯수를 출력
- 첫 번째 반복문에서는 두 수의 차이의 최소값 min을 찾는다
- 두 번째 반복문에서는 두 수의 차이가 min인 경우의 갯수를 센다
*/
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(int argc, char** argv)
{
int n=0; // ... | ALGO | 0.999821 | 4.219174 |
930e4433-f36f-4412-9340-0d4e03e65885 | Next-Gen-UI/Code-Dynamics | LoveBabbar/03_string/03_duplicates_char_in_string.cpp | /*
link: https://www.geeksforgeeks.org/print-all-the-duplicates-in-the-input-string/
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
using array of 256 to store occurence count
TC: O(n)
SC: O(256) => O(1) constant
*/
vo... | ALGO | 0.997645 | 4.608316 |
ddbfaa8b-a040-4bc7-971c-8d53daad88c0 | Coder-Vippro/Code | Archived/GiaHung/EMAIL.CPP | #include <bits/stdc++.h>
using namespace std;
bool ktem(string a){
if(a[0]=='.'|| a[a.size()-1]=='.')return 0;
int dem1=0,dem2=0;
for(unsigned int i=0;i<a.size();i++){
if(a[i]==' '||a[i]==96||a[i]==91||a[i]==92||a[i]==93||a[i]==94||a[i]>=123||(a[i]>=20 && a[i]<=45)||(a[i]>=58 && a[i]<=63)||a[i]==47)... | ALGO | 0.99926 | 4.059813 |
6cbaae93-7741-41a7-80af-0f2c2dfd1aca | HandsomeLuoyang/alalgorithm_2024 | leetcode/mianshi.cpp | int main(){
int countOnes(int num){
int count = 0;
while(num){
if(num & 1){
count++;
}
num>>=1;
}
return count;
}
} | ALGO | 0.999469 | 4.381989 |
d2403dfe-1062-4ce3-9fd8-eb2ac932878c | tristan3716/Morgorithm | Week8/eunjoo/programmers42888.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
vector<string> solution(vector<string> record)
{
vector<string> answer;
vector<string> queue; //들어오고 나가는 command를 저장하는 벡터
map<string, string>openChat; //id에 해당하는 nickname을 저장하는 맵
for(int i=0; i<record.size();... | ALGO | 0.994802 | 4.572426 |
d1191aba-1bc2-4eda-b490-c0f3c7e44427 | mohitpandey94/SPOJ-Solutions | spoj/MAXSUMSQ/MAXSUMSQ-14779178.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define gc getchar
#else
#define gc getchar_unlocked
#endif
using namespace std;
int readi () {
int n=0,sign=0;
char c=gc();
while (c<48) {
if (c==45) sign=1;
c=gc();
}
while (c>47) {
n=n*10+c-'0';
c=gc();
}
if (sign) return (-n);
return n;
}
int a[100005];
... | ALGO | 0.999599 | 3.844852 |
0c6806fc-0d27-4e45-aef4-f8f3758f8529 | BiancaJvRensburg/MedMax_v2 | multiView/curve.cpp | #include "curve.h"
#include "math.h"
#include <GL/gl.h>
Curve::Curve(unsigned int nbCP, std::vector<Vec>& cntrlPoints){
this->nbU = 0;
nbControlPoint = nbCP;
for(unsigned int i=0; i<nbCP; i++){
TabControlPoint.push_back(new ControlPoint(cntrlPoints[i]));
}
initConnections();
}
void Curve... | ALGO | 0.988187 | 4.671393 |
6f01d117-be76-4acf-be05-0639b23d3920 | nicecapj/crossplatfromMmorpgServer | ThirdParty/boost_1_61_0/libs/spirit/classic/example/fundamental/stuff_vector.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers
// This is the phoenix version of number_list.cpp.
// This is discussed in the "Phoenix" chapter in the Spirit User's Guide.
//
// [ JDG 1/12/2004 ]
//
///////... | TOOL | 0.975884 | 7.116484 |
9d9e230b-6128-41af-b2bd-bb880e0931e7 | MasterIceZ/TOI17_Practice | RYW/toi3_tiling.cpp | /*
* AUTHOR : Hydrolyzed~
* SCHOOL : RYW
* TASK :
* ALGO :
* DATE :
* */
#include<bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#include "template.hpp"
#else
#define dbg(...) 0
#endif
using ll = long long;
int a[22][22];
bool mark[22][22];
const int di[] = {-1, 0, 0, 1};
const int dj[] = {0, -1, 1, 0};... | ALGO | 0.999612 | 3.980023 |
b474d767-b3f2-4b13-8e1f-f76538634172 | Shaquille-Wu/MNN | source/backend/cpu/CPUSetDiff1D.cpp | #include "backend/cpu/CPUSetDiff1D.hpp"
namespace MNN {
ErrorCode CPUSetDiff1D::onExecute(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs) {
auto input = inputs[0];
auto remove = inputs[1];
if (input->getType().code != halide_type_int || remove->getType().code != halide_type_int) ... | TOOL | 0.865768 | 6.930001 |
3db2544d-9e4b-4e6d-84c4-ae5b6e7886bc | CRUXsur/qr_reader | 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.998687 | 6.797341 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.