uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
20d5f530-8b9c-4d44-99ed-6d115f24a09f | Devansh968/LEET-CODE-SOLUTIONS | Populate Inorder Successor for all nodes - GFG/populate-inorder-successor-for-all-nodes.cpp | // { Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
struct Node *next;
Node(int x)
{
data = x;
left = NULL;
right = NULL;
next = NULL;
}
};
void pri... | ALGO | 0.999109 | 6.508054 |
5ca43e66-a4b3-49f3-bdd7-867a70730f80 | minh47857/CPlusPlus | DoiTuyenTinh/12-10-2022/primemost.cpp | #include<bits/stdc++.h>
#define ll long long
#define pi pair<int , int>
#define fi first
#define se second
using namespace std;
const int N = 5e4 + 5 , MOD = 1e9 + 7 , inf = 1e9;
void file() {
freopen("primemost.inp" , "r" , stdin);
freopen("primemost.out" , "w" , stdout);
ios::sync_with_stdio(0);
cin.tie(0) ; co... | ALGO | 0.999954 | 4.271224 |
625b2713-d5b8-457c-bf68-0a6efbfd41e6 | Amylo-jh/baekjoon | 11000s/11286.cpp | #include <iostream>
#include <queue>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
priority_queue <int, vector<int>, greater<int>> num1;
priority_queue <int> num2;
int query;
cin >> query;
while(query--)
{
int valu... | ALGO | 0.999984 | 4.532026 |
b78c03e5-d5d6-4db0-bc6a-d15438da7e15 | jing1900/mianjing_v1 | 08/10_o(n)/10_8.cpp | /*
滑动窗口
问题1:Leetcode 209 给定一个数组,里面全是正整数,再给一个正整数s,求数组里面最少多少个连续的数,满足总和不小于s
核心,大窗口不满足条件,它的任意小窗口也不满足条件
窗口[i..j]
过小——++j
过大——--i
问题2 子串变位词 (字符串高频面试题精讲例4, 1-4.cpp)
○ 思考题1 最短子串包含全部字母 Leetcode 76 和问题2是一个问题
○ 思考题2 无重复字符的最长子串 leetcode 3 类似问题1,这里是小窗口不满足,则大窗口也不满足,
若太大了,则将左边界往右移。若窗口太小了(窗口元素都只出现1次),则扩大窗口。
*/
class S... | ALGO | 0.999901 | 5.88757 |
3d9d2214-2372-4405-bf4f-1c0cf27df33d | tpn/cuda-samples | v11.0/7_CUDALibraries/MersenneTwisterGP11213/MersenneTwister.cpp | /*
* This sample demonstrates the use of CURAND to generate
* random numbers on GPU and CPU.
*/
// Utilities and system includes
// includes, system
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <curand.h>
// Utilities and system includes
#include <helper_functions.h>
#include <helper_cuda.h... | TEST | 0.902849 | 7.038099 |
30d4703e-3d2f-46ee-9b38-d690e32554fa | daria-tb/MyProject1 | 61_62.cpp | #include <iostream>
// 1-value (left value)
//це об'єкт, який займає певне місце в пам'яті, яке можна ідентифікувати (наприклад за адресою). //
// r-value (right value)
// це вираз, який не являється об'єктом, який можна ідентифікувати
//l-val -> r-val
//r-v + r-v
void Swap(int& a, int& b);
int& Min(int arr[], int ... | ALGO | 0.985413 | 3.165027 |
38978020-6b59-4b44-94d0-7cefa264fe21 | rahul-rrp/MyCode | c program/armstrong number print by function,c.cpp |
# include <stdio.h>
# include <conio.h>
int armstrong(int) ;
int main( )
{
int num, n ;
printf(" Enter the Number to check Armstrong Number : ") ;
scanf("%d", &num) ;
n = armstrong(num) ;
if( n == num )
printf(" Entred Number : %d is Armstrong Number !", num) ;
else
printf(" Entred Number : %d is not a Arms... | ALGO | 0.999611 | 3.170239 |
68e87095-4949-41a5-92cf-56af2509b9ec | sherryshare/blaze-2.0 | blazemark/src/eigen/DMatTDMatMult.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.999454 | 5.71583 |
77ff03b7-1bbc-4693-8ba3-3ad449e532e3 | syqwq-OMG/oi | acwing/856.cpp | // Problem: Floyd求最短路
// URL: https://www.acwing.com/problem/content/860/
#include <algorithm>
#include <array>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <ratio>
#include <unordered_map>
#include <vector>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define ... | ALGO | 0.999991 | 4.368968 |
dad47dab-af2f-4475-a042-ab8831c6d3a8 | alexandraback/datacollection | solutions_5652388522229760_1/C++/NTUwanderer/test.cpp | #include <iostream>
#include <queue>
using namespace std;
bool checkNumber(long number, bool* array, int& remain) {
while(number != 0) {
int temp = number % 10;
if (array[temp] == false) {
array[temp] = true;
--remain;
}
number /= 10;
}
return (remain == 0);
}
int main() {
int round = 0, counter = ... | ALGO | 0.998798 | 5.18645 |
d225a8de-c8b2-4930-b9cf-e3c54f3a78d4 | TRAN-THUY-NGOC/UPCODER | CSES/CSES Problem Set/Sorting and Searching/Movie Festival.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define inp freopen("file.inp", "r", stdin)
#define out freopen("file.out", "w", stdout)
#define TIME 1.0*clock()/CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0)
const int MAXN = 1e6 + 5;
const int MOD = 1e9 +... | ALGO | 0.999698 | 5.185376 |
9bb9f185-748c-4016-8144-85823c830126 | karan-aithal/DSA | Patterns/pattern1.cpp | #include <algorithm>
#include <bits/stdc++.h>
using namespace std;
// * * * * *
// * * * * *
// * * * * *
// * * * * *
// * * * * *
void printPattern1(int row)
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < row; j++)
{
cout << "* ";
}
cout << endl;
}
}
... | ALGO | 0.99989 | 3.507535 |
290ea657-2f93-49bb-9f19-95f71ca6d056 | dmehrab06/Time_wasters | codechef/upsolve/GERALD2.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cmath>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<string>
#include<queue>
#include<iomanip>
#include<limits>
#include<typeinfo>
#include<functional>
#include... | ALGO | 0.999946 | 4.169201 |
f2a45f09-1f6a-4139-973d-a785c5fd15a9 | AlexandruValeanu/Competitive-Programming | Infoarena/Game.cpp | #include <bits/stdc++.h>
#define VI vector<int>
#define VII vector<pair<int,int>>
#define QI queue<int>
#define ms(a,v) memset( a, v, sizeof( a ) )
#define FOR(i,a,b) for(int i = a; i <= b; ++i)
#define ROF(i,a,b) for(int i = a; i >= b; i--)
#define foreach(v, c) for( typeof( (c).begin() ) v = (c).begin(); v != (c).e... | ALGO | 0.999887 | 3.498212 |
948515f5-e6d2-4017-bce0-8b9f017fa254 | jaredramey/AutomationTest_Playground | Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingOperators/Private/CleaningOps/HoleFillOp.cpp | #include "CleaningOps/HoleFillOp.h"
#include "Operations/SimpleHoleFiller.h"
#include "Operations/PlanarHoleFiller.h"
#include "Operations/MinimalHoleFiller.h"
#include "Operations/SmoothHoleFiller.h"
#include "ConstrainedDelaunay2.h"
#include "CompGeom/PolygonTriangulation.h"
#include "Selections/MeshConnectedComponen... | ALGO | 0.94267 | 4.347558 |
ccdd39ee-9e0a-4a66-98f7-2d788d5b0819 | phumipatc/C_Competitive_Programming | C++ - 2561/MWITS/FC_Golden_Age.cpp | /*
Author : Phumipat C.
School : RYW
Language: C++
*/
#include<bits/stdc++.h>
using namespace std;
int a[5010],n,dp[5010][110];
int tree(int now,int k){
if(now>n) return 0;
if(dp[now][k]!=-1) return dp[now][k];
if(k == 0) return dp[now][k] = 0;
int maxx = -1;
for(int i=0;i<k... | ALGO | 0.999949 | 3.65627 |
a0bebab8-2ecb-4c6b-9a11-52a5bc9b530e | xinyuang/9_chapter_cpp_algorithm | 5.Two Pointers/56. Two Sum.cpp | // two sum
// using unordered_map but only the array has no duplicated number;
class Solution {
public:
/**
* @param numbers: An array of Integer
* @param target: target = numbers[index1] + numbers[index2]
* @return: [index1, index2] (index1 < index2)
*/
vector<int> twoSum(vector<int>& numbers, int target) {... | ALGO | 0.999895 | 5.845364 |
98faa8dc-d401-47fc-a140-739f0b24bcd2 | IamUmairKhalid/CPP-learning | Practical 6.cpp | #include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <conio.h>
using namespace std;
int main()
{
int i;
cout<<"Enter any integer (positive or negative) : ";
cin>>i;
if(i>=0)
cout<<"\nAbsolute value of "<<i<<" is "<<i;
else
cout<<"\nAbsolute value of "<<i<<" is "<<i*(-1);
getch();
return 0;... | TOOL | 0.969362 | 3.180596 |
0bb8a6fb-986a-4f7a-91e6-e744b2138e81 | diptesh17/End-game | 03 - DP/00 - 1D DP/05 - House Robber.cpp | class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size() ;
vector<int>dp(n+1);
// base case
dp[0] = 0;
dp[1] = nums[0];
for( int i=2 ; i<=n ; i++)
{
dp[i] = max(dp[i - 1], dp[i - 2] + nums[i - 1]);
}
return dp[... | ALGO | 0.999851 | 5.85257 |
9a72b4a6-d4bd-4ae4-a04c-458eae7476cd | Cheese-5040/Comp-2011 | Program/Program0/rps-game.cpp | #include <iostream> /* File: rps-game.cpp */
#include <cstdlib> // Info about random number generator rand()
using namespace std; // A more concise solution with error message is in rps-game2.cpp
const int ROCK = 0, PAPER = 1, SCISSORS = 2; // 0/1/2 to represent ROCK/PAPER/SCISSORS
/* To print out the choice pick... | TOOL | 0.992899 | 5.054317 |
25efe955-906e-4643-9751-bfa885b4083c | moharamfatema/algorithms-problem-solving | two-sum/Solution.cpp | #include <vector>
#include <map>
class Solution
{
public:
std::vector<int> twoSumBruteForce(std::vector<int> &nums, int target)
{
//bruteforce
int i, j;
for(i = 0; i < nums.size(); i++)
{
for(j = i + 1; j < nums.size(); j++)
{
if(nums[i] +... | ALGO | 0.999792 | 5.903237 |
54940971-096e-4ead-a6bc-f6ba5f3d6fe4 | AnsonHooL/Coding_Note | leetcode/【并查集】1202.交换字符串中的元素.cpp | //
// Created by lenovo on 2021/1/11.
//
class Solution {
public:
int findfa(int x, vector<int>& fa)
{
if(fa[x] == x) return x;
else
{
fa[x] = findfa(fa[x], fa);
return fa[x];
}
}
void merge(int x, int y, vector<int>& fa)
{
int xf = f... | ALGO | 0.999995 | 5.822374 |
1eec5676-b802-4157-b0ae-e822ab3041ff | jesuswr/cp-codes-and-problems | E.enemy_is_weak.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pair<i... | ALGO | 0.999823 | 3.457253 |
69b4c73b-c5db-41dc-83c3-039b154ffb53 | Masters-Akt/CS_codes | hackerrank_sols/Problem_solving/Algorithms/Weighted_uniform_strings.cpp | //Kumar Ankit
#include <bits/stdc++.h>
using namespace std;
// Complete the weightedUniformStrings function below.
vector<string> weightedUniformStrings(string s, vector<int> queries) {
vector<string> ans;
vector<int> st;
for(int i=0;i<s.length();i++){
int count=1,j=i+1;
while(s[i]==s[j]){... | ALGO | 0.999932 | 4.742538 |
63bf5fcb-ea97-4da1-b238-6aa31de15215 | plasmatic1/dmoj-solutions | cpp/nccc2s4.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAX = 50001;
int n, ba, bb, bc;
vector<int> goods,
bads[MAX];
bool bad[MAX];
unordered_map<int, vector<int>> matrix[MAX];
void dfs(int cur, int par, int parclr){
for(auto adjs : matrix[cur]){
int w = adjs.first;
for(int adj : adjs.s... | ALGO | 0.999932 | 4.100618 |
04143cfa-60c7-4f64-b4d2-d9503b2e7d30 | rishi-org-stack/dsAlgo | c++/f2.cpp | #include<iostream>
#include<vector>
#include<iterator>
#include <sstream>
#include<ostream>
using namespace std;
bool isPal(string s){
int mid = s.size()/2;
int same =0;
for (int i =0;i <mid;i++){
if (s[i]==s[s.size()-1-i])
same++;
}
return same==mid;
}
void solve( vector<int> arr, ... | ALGO | 0.99994 | 4.283284 |
1132605e-63d5-4f28-8d3d-efd3b6a92279 | Lmumu1123/HUST-CSE-Courses | 程序设计综合课程设计/程序设计hash/list_R.cpp | #include "tree.h"
/**
* @brief ת FILETIME ʱʽԱʽļ
* @param fileTime ת FILETIME ṹ
* @param outfile дתʱ
*/
void PrintFileTime(const FILETIME& fileTime, ofstream& outfile) {
SYSTEMTIME sysTime;
FILETIME localFileTime;
FileTimeToLocalFileTime(&fileTime, &localFileTime); // ļʱתΪļʱ
FileTimeToSystemTime(&... | TOOL | 0.91848 | 4.031524 |
3c7d46a2-032c-448b-a9e7-69a7d055a71d | raincross7/code-similarity | codes/train_code/problem407/problem407_85.cpp | /**
* created: 12.07.2020 02:45:14
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s);... | ALGO | 0.999987 | 4.016177 |
fe3f87f0-cc22-4264-84b5-f77b81ef4d23 | ishandutta2007/codeforces | dario2994/normal/1239/C.cpp | #define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define SZ(x) ((int)((x).size()))
template <typename T1, typename T2>
string print_iterable(T1 begin_iter, T2 end_iter, int counter) {
bool done_something = false;
stringstream res;
... | ALGO | 0.999994 | 3.098539 |
f7246704-51bb-4bd2-bcff-33a6e7679e20 | fractal161/acervus | rank/surfaces.cpp | #include "surfaces.hpp"
int* intToSurface(int surface){
int* bumps = new int[SURFACE_WIDTH - 1];
for(int i = SURFACE_WIDTH - 2; i >= 0; i--){
bumps[i] = (surface % 9) - 4;
surface /= 9;
}
return bumps;
}
int surfaceToInt(int* surface){
int res = 0;
for(int i = 0; i < SURFACE_WIDTH - 1; i++){
r... | ALGO | 0.938388 | 4.254508 |
6657dbd5-a097-4032-8c72-65fdbde51a5c | Polibits/bootcamp2024 | aulas/aula_03/fita-colorida.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
// Seu código vai aqui
int N;
cin >> N;
vector<int> fita(N);
// Inicializar os valores da fita
for (int i = 0; i < N; i++) {
cin >> fita[i];
}
for (int i = 0; i < N; i++) {
// Pular o quadrado se
... | ALGO | 0.999994 | 4.577439 |
758793be-610f-4e2e-9947-b397e0ddc9b8 | senior-kapitoshka/Solutions | coderun/110_observstion_students.cpp |
//проходит открытые тесты
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
int main()
{
int n,m;
std::cin>>n>>m;
std::vector<bool>stud(n,true);
for(int i=0;i<m;++i){
int a,b;
std::cin>>a>>b;
if(a-1<n && b-1<n){
if(a==b... | ALGO | 0.999956 | 3.803905 |
a8f51822-ce01-4de8-b297-c7a7b1cc6510 | ollehe/AoC | AoC2023/Day 3.cpp | #include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
std::vector<std::string> readFile(std::string str) {
std::vector< std::string > input;
std::ifstream inputFile(str);
if (!inputFile.is_open()) {
// Handle the error if the file couldn't be opened
std::cerr << "Error op... | ALGO | 0.999687 | 5.905574 |
e5b64418-6b2d-49dd-82a0-8a8d93cd6c90 | Memoryzjc/CS2602-24Fall | Assignment/assignment1/maxNum.cpp | #include<iostream>
void quickSort(int arr[], int begin, int end)
{
int i, j, t, pivot;
if (begin > end)
return;
pivot = arr[begin];
i = begin;
j = end;
while (i != j)
{
while (arr[j] >= pivot && i < j) {
j--;
}
while (arr[i] <= pivot && i < j) {
i++;
}
if (i < j... | ALGO | 0.999972 | 4.809328 |
666f2ddd-3ab9-4912-9ef0-0455df3c8ae3 | Ankit2002developer/DSA-questions | Number of Occurence/Linear search.cpp | int count(vector<int>& arr, int n, int x) {
// Write Your Code Here
int count = 0;
for(int i = 0; i < n; i++) {
if(arr[i] == x) {
count++;
}
}
return count;
}
| ALGO | 0.999951 | 5.826544 |
5ac7dd78-ad22-4d94-8e98-71645358197b | cxaosdev/Algorithm | Topological_sort.cpp | //2019055078_ä
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N, M, a, b;
int done[1001];
int wh[1001];
int clr[1001];
vector<int>arr;
vector<int>e[1001];
int T = 0;
int check = 0;
void visit(int a) {
wh[a] = 1;
clr[a] = 1;
T++;
for (int i = 0; i <... | ALGO | 0.999971 | 3.880124 |
3328dea7-97da-425f-98cb-fb30505ccff0 | sanghoon23/Algorithm | Programmers_1016_StringBeauty(월간코딩테스트)/ConsoleApplication1_Test/ConsoleApplication1_Test.cpp | #include "pch.h"
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//@1019_ 속도 빠르게 수정.
/*
목적은 같지만, 순서를 어떻게 배치하냐에 따라서 속도가 확연하게 갈릴 수 있다.
*... | ALGO | 0.999962 | 4.477631 |
cadab050-b66a-483e-9d4f-33a3c4ca8b88 | SoftwareAssigment/Fundamental_Assigment | without_function/dynamic_pattern.cpp | // Create a diamond pattern using alphabet letters.
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
char *ptr;
cout<<"Enter any number you want: \n";
cin>>n;
if (n >= 1){
for(int i = 0; i < (n*2 +1); i++){
for(int j = 0; j < (n*2 + 1); j++){
... | ALGO | 0.999542 | 4.965756 |
d878202f-c45b-4b57-859a-71c2f698d4c4 | chuuuuu/algorithm | cses/dynamic-programming/1636/sol.cpp | // #include <ext/pb_ds/assoc_container.hpp>
#include <bits/stdc++.h>
using namespace std;
// using namespace __gnu_pbds;
using ll = long long;
// template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define mod 1000000007;
void solve()
{
int n, x;
cin... | ALGO | 0.999987 | 4.557419 |
48ccde86-0f0b-45a8-ba75-f10bc9f7fc1c | hankchen1728/Leetcode-cpp | src/0198_house_robber/main.cpp | #include <algorithm>
#include <iostream>
#include <vector>
#include "../Utils/myUtils.h"
using namespace std;
// Solution begin
class Solution {
public:
Solution() {
// Speed up
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
int rob(vector<int>& nums) {
int nHouse = nu... | ALGO | 0.99967 | 5.502306 |
a79d5eaa-a911-4039-a96c-bdc358f8c37b | Poornakgps/CP_ | Concepts/DP/form_6/treedp.cpp | #include<bit/stdc++.h>
using namespace std;
vector<int> g[100005];
int indp[100005];
void in_dfs(int node, int parent = 0){
// initialize 0 for indp[node] assuming this as leaf node
indp[node] = 0;
for(auto it: g[node]){
if(it== parent) continue;
in_dfs(it, node);
indp[node]... | ALGO | 0.999952 | 4.692685 |
20fcbe7d-3bb1-415d-b6e9-7ed1a8ca5909 | GuardChain-official/GuardChain-Blockchain-Core-v.1.0 | src/bls/bls_ies.cpp | #include "bls_ies.h"
#include "hash.h"
#include "random.h"
#include "streams.h"
#include "crypto/aes.h"
template <typename Out>
static bool EncryptBlob(const void* in, size_t inSize, Out& out, const void* symKey, const void* iv)
{
out.resize(inSize);
AES256CBCEncrypt enc((const unsigned char*)symKey, (const... | ALGO | 0.977415 | 7.423766 |
19f199bd-0406-4ece-9599-466b4d850fb2 | Nakib-Arman/CSE314---OperatingSystem | 3.IPC/.history/main_20250626233948.cpp | #include <iostream>
#include <chrono>
#include <pthread.h>
#include <random>
#include <vector>
#include <unistd.h>
using namespace std;
#define MAX_PHASE1_TIME 20
#define MAX_PHASE2_TIME 20
#define SLEEP_MULTIPLIER 1000
auto start_time = chrono::high_resolution_clock::now();
long long get_time() {
auto end_time ... | ALGO | 0.989132 | 4.483059 |
9933e02a-a903-434c-afca-5fcfc451ea36 | LIUWENZHENG12/C-plusplus-easy-code | C++/ch06_07.cpp | #include <iostream>
using namespace std;
//Ӱ}CƭΪŧi
void print_arr(int arr[][5],int,int);
int main(){
//ŧiêlƤGZ}C
int score_arr[][5]={{78,69,83,90,75},{11,22,33,44,55}};
print_arr(score_arr,2,5);
return 0;
}
//JG}CU
void print_arr(int arr[][5],int r,int c)
{ //Ĥ@iٲ,LƪгMwq
int i,j;
for(int i=0;i<... | ALGO | 0.940383 | 3.624425 |
39e78d29-42fe-4bba-8d2e-ab324d3b9bb6 | ishandutta2007/codeforces | square1001/normal/760/B.cpp | #include <iostream>
using namespace std;
long long n, m, p;
long long g(long long x) {
return x * (x + 1) / 2;
}
long long f(long long x, long long t) {
// max(x-t+1, 1) + max(x-t+1, 1) + max(x-t+2, 1) + ... + max(x, 1)
if (x >= t) return g(x) - g(x - t);
return g(x) + (t - x);
}
long long solve(long long x) {
ret... | ALGO | 0.999993 | 3.851041 |
be75629e-34de-418b-925f-4a64d833799c | Simba-97/Leetcode-solved-questions | 0116-populating-next-right-pointers-in-each-node/0116-populating-next-right-pointers-in-each-node.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {}
Node(int _val, Node* _left, Node* _right, Node* _next)
: val(_... | ALGO | 0.999958 | 5.815007 |
9698a235-a3d2-49ca-bcf2-46c6b64823c7 | BingHan0458/PU-GACNet | data_preprocessing/prep_data/MeshSegmentation/source code/eigen3/bench/spbench/test_sparseLU.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <unsupported/Eigen/SparseExtra>
#include <Eigen/SparseLU>
#include <bench/BenchTimer.h>
#ifdef EIGEN_METIS_SUPPORT
#include <Eigen/MetisSupport>
#endif
using namesp... | ALGO | 0.996638 | 4.273294 |
54cb8e9c-334d-4e51-ab0a-53e14002fa53 | usks213/ECSEngine | ECSEngine/ECSEngine/lib/bullet3/include/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp | #include "btConvex2dConvex2dAlgorithm.h"
//#include <stdio.h>
#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/Collisio... | ALGO | 0.999777 | 6.671592 |
8953f1ec-491b-43ce-8cb5-e1b47836be7d | itsmrx1234/leetcode-solution | 0713-subarray-product-less-than-k/0713-subarray-product-less-than-k.cpp | class Solution {
public:
int numSubarrayProductLessThanK(vector<int>& nums, int k) {
if (k <= 1) {
return 0;
}
int start=0,end=0,pd=1,n=nums.size(),count=0;
while(end<n){
pd*=nums[end];
while(pd>=k){
pd/=nums[start];
start+... | ALGO | 0.999918 | 5.440668 |
00218f3b-4734-4414-9af3-a15d453ab320 | ishandutta2007/codeforces | tadijasebez/normal/1167/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=1000050;
int sum[N];
void Set(int i,int f){for(;i<N;i+=i&-i)sum[i]+=f;}
int Get(int i){int ans=0;for(;i;i-=i&-i)ans+=sum[i];return ans;}
int a[N];
bool ok[N];
pair<int,int> b[N];
int c[N];
int main(){
int n,x;
scanf("%i %i",&n,&x);
for(in... | ALGO | 0.999934 | 3.817604 |
8fd89bd7-4f56-4d31-b803-f9dc0ecdc203 | xSeditx/Creature-Engine | CreatureEngine/SDKs/PhysX-4.1/physx/source/geomutils/src/pcm/GuPCMContactCapsuleConvex.cpp | #include "geomutils/GuContactBuffer.h"
#include "GuGJKPenetration.h"
#include "GuEPA.h"
#include "GuVecCapsule.h"
#include "GuVecConvexHull.h"
#include "GuVecConvexHullNoScale.h"
#include "GuGeometryUnion.h"
#include "GuContactMethodImpl.h"
#include "GuPCMContactGen.h"
#include "GuPCMShapeConvex.h"
namespace physx
{
... | ALGO | 0.969078 | 6.643626 |
c5612c45-5395-42aa-98f8-c7e8e5232a97 | Amber-MD/cpptraj | src/Pucker_PuckerSearch.cpp | #include "Pucker_PuckerSearch.h"
#include "CpptrajStdio.h"
#include "ArgList.h"
#include "Range.h"
#include "Topology.h"
using namespace Cpptraj;
Pucker::PuckerSearch::PuckerSearch() {}
/** Recognized pucker keywords. */
const char* Pucker::PuckerSearch::Keywords_[] = {
"nucleic", // NUCLEIC RIBOSE
"furanose", ... | TOOL | 0.859729 | 5.270979 |
dcfbc810-e996-456d-a943-6cb55d2acf7f | saurabh01032003/DSA-Coding-Blocks | lecture 12/generate_subarray.cpp | // #include <iostream>
// using namespace std;
// int main()
// {
// int arr[] = {10, 20, 30, 40,50};
// int n = sizeof(arr) / sizeof(int);
// for (int i = 0; i < n - 1; i++)
// {
// for (int j = i + 1; j < n; j++)
// {
// for (int k = i; k <= j; k++)
// {
// ... | ALGO | 0.999078 | 3.385035 |
273dd59b-d696-4365-af6c-0125a167ce17 | sarvex/leetcode-nativescript | solution/2400-2499/2443.Sum of Number and Its Reverse/Solution.cpp | class Solution {
public:
bool sumOfNumberAndReverse(int num) {
for (int x = 0; x <= num; ++x) {
int k = x;
int y = 0;
while (k > 0) {
y = y * 10 + k % 10;
k /= 10;
}
if (x + y == num) {
return true;
... | ALGO | 0.999948 | 6.079369 |
99558d2e-f5af-498a-9613-d6643d69f834 | nakatamaho/mplapack | mplapack/reference/Rormr2.cpp | #include <mpblas.h>
#include <mplapack.h>
void Rormr2(const char *side, const char *trans, INTEGER const m, INTEGER const n, INTEGER const k, REAL *a, INTEGER const lda, REAL *tau, REAL *c, INTEGER const ldc, REAL *work, INTEGER &info) {
//
// -- LAPACK computational routine --
// -- LAPACK is a software... | ALGO | 0.997986 | 3.431638 |
7e32919c-3471-4551-a046-e8d9246f42d0 | Shariqaftab20/My-Practice-Prog | CountInversion.cpp | #include<iostream>
using namespace std;
long long merge(int a[],int l,int mid,int r)
{
long long inv=0;
int n1=mid-l+1;
int n2=r-mid;
int A[n1],B[n2];
for(int i=0;i<n1;i++)
{
A[i]=a[i+l];
}
for(int i =0;i<n2;i++)
{
B[i]=a[mid+1+i];
}
int i=0,j=0,k=l;
while... | ALGO | 0.999972 | 3.814994 |
e3869e34-b45c-4475-a700-69f37962eb57 | guilhermeferreira-lab/cienco-ed | material 7 estrutura de dados/lista exemplo 2/main.cpp | #include <iostream>
using namespace std;
// Definio da estrutura do n da lista duplamente encadeada
struct Node {
int dado; // Dado do n
Node* anterior; // Ponteiro para o n anterior
Node* proximo; // Ponteiro para o prximo n
};
// Funo para criar um novo n com o dado fornecido
Node* criarNo(int d... | ALGO | 0.999522 | 6.456092 |
98e3915a-f0cc-4e65-bde1-073721f2f8a4 | Bearsharks/dev-note | PS/hotelroom.cpp | #include <iostream>
#include <vector>
#include <set>
using namespace std;
typedef long long ll;
vector<long long> solution(long long k, vector<long long> room_number) {
vector<long long> answer;
set< pair<ll, ll> > s;
s.insert({ -1,-1 });
s.insert({ 10e12+100 , 10e12 + 100 });
for (long long n : r... | ALGO | 0.999986 | 4.200785 |
5933350c-d143-4c4e-8ab7-79f518dc83c7 | IshanX111/CODEFORCES | A. Expression.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,m,d;
cin>>a>>b>>c;
int ar[5];
ar[0]=a+(b*c);
ar[1]=a*(b+c);
ar[2]=a*b*c;
ar[3]=(a+b)*c;
ar[4]=a+b+c;
m=*max_element(ar,ar+5);
cout<<m<<endl;
}
| ALGO | 0.999738 | 3.5121 |
d81740ce-1dcf-479e-be0f-47fe99fd5288 | ishandutta2007/codeforces | lomk/normal/723/F.cpp | /*input
10 16
6 1
1 10
6 5
5 7
5 2
4 1
1 3
5 8
1 8
1 7
4 5
9 1
10 5
9 5
3 5
1 2
1 5 4 5
*/
/*input
*/
#ifdef UncleGrandpa
#include <prettyprint.hpp>
#endif
#include <bits/stdc++.h>
using namespace std;
#define sp ' '
#define endl '\n'
#define mp make_pair
#define fi first
#define se second
#define __builtin_popcount _... | ALGO | 0.999991 | 3.779265 |
cbcc64c0-de68-4d0c-a5cd-e798c18963cc | gpudev0517/LookPanorama | Process/SnapshotDetector.cpp | #include "SnapshotDetector.h"
#include "opencv2\objdetect\objdetect.hpp"
#include "opencv2/video/tracking.hpp"
#include "opencv2\highgui.hpp"
#include "include/Config.h"
CSnapshotDetector::CSnapshotDetector() :
pVerifier(0)
{
clear();
clearStatus();
}
CSnapshotDetector::~CSnapshotDetector()
{
}
void CSnapshotDet... | ALGO | 0.928941 | 5.503822 |
89aec816-cdba-4d6f-a5d1-5b434a95b3ff | PierreMarchand20/BemTool-tests | tests/functional_tests/tests_solve/tests_ddm_dir_YU_2D_P1_indirect_hmat.cpp |
#include <bemtool/tools.hpp>
#include <bemtool/miscellaneous/htool_wrap.hpp>
#include <bemtool-tests/tools.hpp>
using namespace bemtool;
int main(int argc, char *argv[]) {
// Initialize the MPI environment
MPI_Init(&argc,&argv);
// Get the rank of the process
int rank;
MPI_Comm_rank(MPI_COMM_WOR... | ALGO | 0.98511 | 5.659533 |
ba03ac7c-f16e-48fd-883f-c383c6ce8d9d | ishandutta2007/codeforces | zbsnb/normal/1334/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
int a[1000010];
int b[1000010];
signed main(){
ios::sync_with_stdio(0);cin.tie(0);
int t;cin>>t;
while(t--){
int n;cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i]>>b[i];
}
a[n+1]=a[1... | ALGO | 0.999925 | 3.447759 |
4b137b6a-6235-4cb6-811f-33dab37c501a | daizhenyang/OJs | Topcoder/SRM 410 - 419/SRM 412/ForbiddenStrings.cpp | #include <cstring>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#include <utility>
using namespace std;
#define CC(con, v) memset(con, v, sizeof(con))
#define REP(i, l, n) for(int i = l;i < int(n);++i)
... | ALGO | 0.999384 | 4.288437 |
de8839b3-e06b-4cf2-874f-4a8775b976aa | onyx6838/algorithm | Thuat Toan Va UD/BT Chuong 2/QUEUE - BT10.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> firstNegative(vector<int> a, int k)
{
queue<int> q;
for(int i=0;i<a.size();i++)
if(a[i] < 0) q.push(i);
vector<int> ret;
if(q.size()==0) return ret;
for (int i=0;i <= a.size();i++)
{
if(i == q.front())
{
ret.push_back(a[i]);
... | ALGO | 0.999993 | 3.932406 |
033544bf-a748-4882-a5a7-07498cada7ce | haruhi130/FrameworkDX12 | Libraries/Effekseer/include/Effekseer/Effekseer/SIMD/Mat44f.cpp | #include "Mat44f.h"
#include "../Effekseer.Matrix44.h"
#include <cmath>
namespace Effekseer
{
namespace SIMD
{
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
const Mat44f Mat44f::Identity = M... | TOOL | 0.93081 | 5.12693 |
6b0c5110-1d23-435b-84c4-b7b7dc877519 | VoNgocSinh/cp-temp | geometry/geometry.cpp | const long double PI = 3.14159265358979;
struct point {
double x, y;
inline point() {x = y = 0;}
inline point(double _x, double _y) {x = _x, y = _y;}
bool operator < (point b) {return (x < b.x || (x == b.x && y < b.y));}
bool operator > (point b) {return (x > b.x || (x == b.x && y > b.y));}
... | ALGO | 0.999858 | 4.399377 |
6011567d-dfd0-4805-832f-6aef0c56a282 | splucs/Competitive-Programming | Codeforces/Gym/101291 2016-2017 ACM-ICPC Pacific Northwest Regional Contest (Div. 2)/K.cpp | #include <bits/stdc++.h>
using namespace std;
int dice[10];
int main()
{
int winpos = 0, tiepos = 0, d;
for (int i = 0; i < 6; i++) {
scanf("%d", &dice[i]);
}
for (int i = 0; i < 6; i++) {
scanf("%d", &d);
for (int j = 0; j < 6; j++) {
if (dice[j] > d) winpos++;
if (dice[j] == d) tiepos++;
}
}
dou... | ALGO | 0.998829 | 3.838477 |
27274f0b-5d7f-4296-ab3c-2343f48a96c7 | tsimafeip/master-course | SpecialDataStructures/Lab1.cpp | #include <iostream>
#include <stack>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
using namespace std;
void push_to_stack(stack<pair<int, int> > &st, int const &element_to_push) {
if (st.empty()) {
st.push(make_pair(element_to_push, element_to_push));
} else {
i... | ALGO | 0.999991 | 4.642478 |
477ca6dd-c29f-4520-aeeb-cdbb76e0ad49 | OmVidana/OpenCV-Camera-Transformations | FinalProject/Transformations.cpp | #include "Transformations.h"
// Linear Transformations
cv::Vec3b bilinearInterpolation(cv::Mat* source, double x, double y) {
int y1 = static_cast<int>(floor(y));
int y2 = std::min(static_cast<int>(ceil(y)), source->rows - 1);
int x1 = static_cast<int>(floor(x));
int x2 = std::min(static_cast<int>(ceil(x)), source... | ALGO | 0.9911 | 4.384139 |
fbd8bd0e-a6d8-4c2b-97da-7f7b97a703ba | KyoMiyah/AtCoder | ABC285/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<n; i++)
using ll = long long;
int main() {
string s;
cin >> s;
int n = s.size();
ll n26 = 1;
ll ans = 0;
rep(i,n) {
char c = s.back();
int nc = c-'A'+1;
ans += nc * n26;
n26 *= 26;
... | ALGO | 0.999776 | 3.888037 |
ede7380e-f5e1-4ea0-9877-8866ebce3a1f | Yuulis/AtCoderSolution_old | AtCoder/ABC/101~120/104/B.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using lld = long double;
using Graph = vector<vector<int>>;
using mint = modint998244353;
#define all(x) (x).begin(), (x).end()
constexpr auto PI = 3.14159265358979;
constexpr auto INF = 1e+9;
constexp... | ALGO | 0.999857 | 5.290735 |
dffd4b5e-7c66-4e68-9794-d154d487fd7c | jaiden-sidhu/libmath-clone | examples/main.cpp | #include "../include/gcd.h"
#include <iostream>
using namespace std;
int main () {
cout << gcd(60, 54) << endl;
return 1;
} | ALGO | 0.998153 | 4.640683 |
19792cf5-09ef-4d93-a856-f02321647da6 | Kaos599/100DaysOfCode | Day 71-80/Reverse String II.cpp | #include <iostream>
#include <algorithm>
class Solution {
public:
string reverseStr(string s, int k) {
int n = s.length();
for (int i = 0; i < n; i += 2 * k) {
// Calculate the end index for each segment
int end = min(i + k, n);
// Reverse the first k character... | ALGO | 0.999962 | 6.43718 |
82d17e98-41fa-44da-975c-9f5b4386f8ff | Mervhope144k/Cpp_Programming | CppBasics/enum1.cpp | #include <iostream>
using namespace std;
enum day {mon=1, tue, wed, thu, fri, sat, sun};
int main()
{
day d;
cout << mon << endl;
cout << tue << endl;
cout << wed << endl;
cout << thu << endl;
cout << fri << endl;
cout << sat << endl;
cout << sun << endl;
return 0;
}
| ALGO | 0.958267 | 3.126317 |
cfad902b-1a75-4009-b55f-078cb80ee1b0 | msk005/leetcode | 990-satisfiability-of-equality-equations/990-satisfiability-of-equality-equations.cpp | class Solution {
public:
int parent[26];
int find(int x)
{
if(parent[x]==x)
return x;
else
return find(parent[x]);
}
bool equationsPossible(vector<string>& equations) {
for(int i=0;i<26;i++)
parent[i]=i;
for(auto val : ... | ALGO | 0.999976 | 5.645605 |
1ffbb360-e356-4056-b731-97b51d0bc3c4 | vandreas19/POJ_sol | 2478/7876376_AC_188MS_12204K.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
const int N_MAX=1000000;
const int PRIME_NUM_MAX=100000;
int primeNum,primes[PRIME_NUM_MAX];
int factor[N_MAX+1];
__int64 coprimeNum[N_MAX+1];
void primeSieve(){
for(int i=2;i<=N_MAX;i++)
factor[i]=i;
primeNum=0;
for(int i=2;i<=N_MAX;i++){
if(factor[i]==i)
... | ALGO | 0.999193 | 3.896045 |
6c1e6251-6541-4682-99b0-806597126d53 | KNWking/Coding-Learning-Diary | [AcWing] 算法基础课/基础算法/791-高精度加法.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> add(vector<int> &A, vector<int> &B) {
vector<int> C;
int t = 0; // 进位。
for (int i = 0; i < A.size() || i < B.size(); ++i) {
if (i < A.size()) t += A[i];
if (i < B.size()) t += B[i];
C.push_back(t % 10); // 个位。
t /= ... | ALGO | 0.999946 | 4.919793 |
279b6243-43aa-4bb3-9508-194c1a17c517 | MrSiz/Coding | PE/43.cpp | #include <set>
#include <queue>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <iostream>
#include <map>
#include <cmath>
#include <algorithm>
using namespace std;
#define pr(x) (cout << #x << ' ' << x << ' ')
#define prln(x) (cout << #x << ' ' <... | ALGO | 0.999786 | 3.879736 |
c853a1db-2b27-44bf-8219-f3cc8ce27153 | M0D4/Competitive-Programming-Problems-Solutions | Atcoder/C++ (GCC 9.2.1)/abc165_a/12580146.cpp | #include <bits/stdc++.h>
#include <ext/numeric>
using namespace std;
using namespace __gnu_cxx;
#define all(v) v.begin(), v.end()
#define endl "\n"
#define pb push_back
#define F first
#define S second
#define START cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define isOdd(n) (n&1)
#define LLMAX LLONG... | ALGO | 0.999115 | 3.838617 |
bea87eed-044d-449f-a07f-b37930e6fec7 | F0RE1GNERS/ACMSteps | HDU/1166.cpp | // [Auto Archived]
// Submit: 2016-10-11 17:43:29
// Time: 265MS
// Memory: 9608K
#include <bits/stdc++.h>
using namespace std;
#define LSON(i) ((i)*2)
#define RSON(i) ((i)*2+1)
const int nmax = 5e5+10;
const int root = 1;
int kases,n,A[nmax],x,y;
char str[30];
int val[nmax<<2];
int build_tree(int o, int L, int R)
{... | ALGO | 0.999474 | 4.512476 |
cfb10c3d-4531-4bff-a87d-b8bb47595e60 | Olindam20/Striver-SDE-Sheet | Stack And Queue/Sort a Stack.cpp | void insertStack(stack<int> &stack, int val){
if(stack.empty() || val>stack.top()){
stack.push(val);
return;
}
int topp=stack.top();
stack.pop();
insertStack(stack,val);
stack.push(topp);
return;
}
void sortStack(stack<int> &stack)
{
if(stack.empty() || stack.size()==1) return;
... | ALGO | 0.999985 | 5.12631 |
f1e95994-fb0d-46fe-939d-a2fbbc8f5a1b | GrifkaTop/Pi_FML | FML_based/FML_based.cpp | #include <SFML/Graphics.hpp>
#include<stdio.h>
#include<math.h>
#include <random>
#include <iostream>
#include <iomanip>
#include "windows.h"
#define lim_dot 1e7 //Максимальное количество точек
#define r 500 //Начальный радиус
using namespace sf;
using namespace std;
double circle(double, double);
double circle(dou... | ALGO | 0.989557 | 3.68037 |
8ddc23d1-e654-48b5-9078-18dd8e2477d3 | laiyoufafa/developtools_profiler | device/plugins/native_daemon/src/virtual_thread.cpp | #define HILOG_TAG "RuntimeThread"
#include "virtual_thread.h"
#include <cinttypes>
#include <iostream>
#include <sstream>
#if !is_mingw
#include <sys/mman.h>
#endif
#include "symbols_file.h"
#include "utilities.h"
#include "virtual_runtime.h"
namespace OHOS {
namespace Developtools {
namespace NativeDaemon {
#ifdef ... | TOOL | 0.92822 | 5.719521 |
ea416494-8ecc-4bba-b18d-704e97cbc4fd | BlissRoms/platform_packages_inputmethods_LatinIME | native/jni/src/dictionary/utils/probability_utils.cpp | #include "dictionary/utils/probability_utils.h"
namespace latinime {
const float ProbabilityUtils::PROBABILITY_ENCODING_SCALER = 8.58923700372f;
} // namespace latinime
| ALGO | 0.943367 | 4.831943 |
3865a265-711d-4c76-965e-d9774e7c2ce5 | ishandutta2007/codeforces | gyh20/normal/1572/A.cpp | #include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
re int t=0;re char v=getchar();
while(v<'0')v=getchar();
while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
return t;
}
const int M=998244353;
inline int ksm(re int x,re int y){
re int s=1;
while(y){
if(y&1)s=1ll*s*x%M;
x=1ll*x*x%... | ALGO | 0.999757 | 4.331488 |
7b2fa455-288d-4633-800c-160c8dc287c2 | TheRickyZhang/CompetitiveProgramming | Codeforces/2050-2099/2093/2093A.cpp | #include <bits/stdc++.h>
using namespace std;
#define tpl_ template
#define tn_ typename
#define f(i, to) for (int i = 0; i < (to); ++i)
#define fe(i, to) for (int i = 1; i <= (to); ++i)
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define repr(i, a, b) for (int i = (a); i >= (b); --i)
#define ff first
#defin... | ALGO | 0.999907 | 4.215498 |
9d3a2838-46e7-4d68-b811-701fe3c63ccd | nalinhousheng/CppPrimer | Ch03/3_24.cpp | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
vector<int> vec;
int num;
while (cin >> num) {
vec.push_back(num);
}
if (vec.size() < 2) {
cerr << "input at least two integers." << endl;
return -1;
}
/*ÿĺ
for (auto it = vec.begin(); it < vec.end() - 1; ++it) {
cou... | ALGO | 0.999143 | 4.087374 |
14277334-f8af-4d24-8f4c-28b77a1fb7d5 | manishkumar1934/c-_programs | pattern_5.cpp | #include<iostream>
using namespace std;
int main()
{
int row , col = '*' ;
for(row=1;row<=5;row=row+1)
{
for(col=1;col<=row;col=col+1)
{
cout<<'*'<<" ";
}
cout<<endl;
}
} | ALGO | 0.999228 | 3.217813 |
e70e907c-6837-4e09-89e1-077684d06a87 | Filip-Novak/finding-perfect-matchings | rekurzia/ba-graph/test/io/test_graph6.cpp | #include "implementation.h"
#include <io/graph6.hpp>
#include <invariants.hpp>
#include <io/print_nice.hpp>
#include <cassert>
#include <cstdio>
using namespace ba_graph;
int main()
{
std::string s10 = "J";
assert(internal::decode_graph6_order(s10.begin(), s10.end()) == 11);
std::string s11 = "~B?x";
assert(inte... | ALGO | 0.90911 | 5.513748 |
06ae5ad7-472c-43ef-8a50-d46e85ac0261 | graalvm/graal-jvmci-8 | src/share/vm/opto/gcm.cpp | #include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/block.hpp"
#include "opto/c2compiler.hpp"
#include "opto/callnode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/machnode.hpp"
#include "opto/opcodes.hpp"
#include "opto/phaseX.hpp"
#include "opto/rootnode.h... | ALGO | 0.997011 | 5.741259 |
c860f773-4055-4900-bf0b-5c4b18958eab | Sefayet-Alam/New-CP-submissions_vol_3 | I_Improving_IT.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// VVI
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define pb push_back
#define ll lon... | ALGO | 0.999935 | 3.696474 |
78edad0e-2179-4542-9ffb-617bf62fac5b | oliver0616/my_work | Data Structure and Algorithm/C++/Algorithms and Data Structures/Assignment 8/unhuffman.cpp | // CSCI 2530
// Assignment: programming assignment 8
// Author: Huan-Yun Chen
// File: unhuffman.cpp
// Tab stops: 4
// **Implementation of the data decompression**
//---------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#inclu... | ALGO | 0.996306 | 4.748882 |
316bf66a-cbe3-4a0d-9b96-3d24820277f7 | PaiwandRafat/button_flutter_basic | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
3384554f-4bc0-4f0c-b419-dcefcd7b9310 | TheProjecter/wnd-charm | wndchrm/branches/algorithm_registration/transforms/wavelet/WaveletHigh.cpp | #include "WaveletHigh.h"
#include "FilterSet.h"
// 5 level decomp
// bior3.1
// remove 1.0 x 10^-4.
WaveletHigh::WaveletHigh(double lim)
{
nsteps = 5;
mode = WAVELET_HIGH;
double bior31LowDe [] = {
-0.35355339059327379, 1.0606601717798214, 1.0606601717798214, -0.35355339059327379
};
double bior31HighDe [] =... | TOOL | 0.994409 | 4.336922 |
256c829b-1e43-4087-bc78-b42bf661b39e | raincross7/code-similarity | codes/train_code/problem072/problem072_274.cpp | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#incl... | ALGO | 0.999978 | 3.169278 |
7ee9d702-1dad-4380-b2f8-c1189e2080d8 | ReadnThink/algorithm | cpp/다이나믹프로그래밍_DP/서울에서경산까지_부분성공.cpp | #include <iostream>
#include <vector>
typedef long long ll;
using namespace std;
ll n, k, ret;
struct WAY{
ll a,b,c,d;
}way[104];
vector<WAY> city;
void input(){
scanf("%d %d", &n,&k);
int a,b,c,d;
for(int i = 0; i < n; i++){
scanf("%d %d %d %d", &a, &b, &c, &d);
city.push_back({a,b,c,d});
}
}
void dfs(int... | ALGO | 0.999628 | 3.498483 |
f657c9c4-f88d-43c1-8db5-7551a443a858 | dvbuiilds/dsa-prep | leetcode/581. Shortest Unsorted Continuous Subarray.cpp | /**
* @file 581. Shortest Unsorted Continuous Subarray
* @author @dvbuiilds
* @brief
* @version 0.1
* @date 2022-05-03
* @link https://leetcode.com/problems/shortest-unsorted-continuous-subarray/ @endlink
* @copyright Copyright (c) 2022
*
*/
/*
Given an integer array nums, you need to find one continuous su... | ALGO | 0.999993 | 5.920214 |
b8eece3e-211f-46ef-af1c-a51da02dcb3f | heroming/algorithm | hihocoder/weekly/052_1183_连通性一·割边与割点.cpp | /*
* Author:heroming
* File:heroming.cpp
* Time:2017/01/14 06:43:35
*/
#include <vector>
#include <list>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <io... | ALGO | 0.999565 | 4.308448 |
734052fd-b5e8-41f8-b880-981c77f5a07f | myscale/MyScaleDB | src/Functions/FunctionsRandom.cpp | #include <Functions/FunctionsRandom.h>
#include <Functions/FunctionFactory.h>
#include <Functions/VectorExtension.h>
#include <Common/HashTable/Hash.h>
#include <Common/randomSeed.h>
#include <base/unaligned.h>
#if USE_MULTITARGET_CODE
# include <x86intrin.h>
#endif
namespace DB
{
namespace
{
/// NOTE Probably
... | ALGO | 0.977698 | 6.785028 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.