uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f40cab71-1111-4136-a2a5-07660984a8dd | kuailedeguisu/GeneralKnowledgeSummary | Interview/standardCode/standardCode/C++/42_1_ReverseWordsInSentence/ReverseWordsInSentence.cpp | #include "..\utilities\StringUtil.h"
#include <cstring>
#include <cstdio>
using namespace std;
char* ReverseSentence(char *pData)
{
if(pData == NULL)
return NULL;
char *pBegin = pData;
char *pEnd = pData;
while(*pEnd != '\0')
pEnd ++;
pEnd--;
// ת
Reverse(pBegin, pEnd);
... | ALGO | 0.98857 | 4.379888 |
710b35d9-6f82-430b-b85a-cfd21341e13d | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2828_3.cpp | #include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
return x > 0 ? x : (-x);
}
template <class T>
T sqr(T x) {
return x * x;
}
const int maxn = 5010;
char a[maxn][maxn];
int st[maxn];
int ss = 0;
int u[maxn];
int n;
void dfs(int x) {
u[x] = 1;
st[ss++] = x;
for (int i = 0; i < n; ++i... | ALGO | 0.999619 | 3.108337 |
f0bfe811-d947-4d3f-aac6-748cd4c8821a | Sscuber03/Practice-Programs | C++_with_vs/CPC/Vector_Erase.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n;
cin >> n;
vector<int> v;
int nn;
for(int i=0;i<n;i++)
{
cin >> nn;
... | ALGO | 0.999694 | 3.502467 |
99a5e3b0-b986-419a-a08c-60d840b9792a | naman-indranil/One-Piece | CycleDetectUndirected.cpp | #include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to detect cycle in an undirected graph.
bool dfsUtil(vector<int> adj[],bool visited[],int u,int p){
visited[u]=true;
for(int i=0;i<adj[u].size();i++)
{
if (... | ALGO | 0.999983 | 5.945787 |
65c4c0f9-e7fe-42b2-bae8-495e60f928d3 | allem40306/Competitive-Programming | codeforce/cf1000F.cpp | #include <bits/stdc++.h>
using namespace std;
using PII = pair<int,int>;
const int MXN = 500005;
struct Node{
int val, mn;
Node *lc, *rc;
Node()
{
lc = rc = nullptr;
mn = MXN;
}
void pull()
{
if(lc == nullptr)
{
mn = rc->mn;
val = rc->v... | ALGO | 0.999963 | 4.547407 |
eb0e3990-0d9c-4574-8171-d9266f785e67 | csitedexperts/ProgrammingWithCPP | cp17_17.cpp | /* CP17_17.CPP */
/* Square of any Numbers using Function Template */
#include<iostream.h>
template <class T>
T Square(T Value)
{
T Temp;
return ( Temp * Temp);
}
int Square(int );
float Square(float);
double Square(double);
void main()
{
int I;
float F;
double D;
cout << "Enter an Integer: " ; cin >> I;
... | ALGO | 0.945515 | 5.625633 |
db092b30-13bd-4a3f-a669-27c77652c90e | DevJSter/dsa | Interview_DS_Algo/Backtracking/Combination Sum IV.cpp | /*
MY YOUTUBE VIDEO ON THIS Qn : https://www.youtube.com/watch?v=YyuwTwXzSxY
Company Tags : Google, Facebook, Snapchat
Leetcode Link : https://leetcode.com/problems/combination-sum-iv/
*/
/*************************************************************** C++ *********************... | ALGO | 0.999216 | 5.195888 |
d8a30f4d-0b08-4eea-b83d-521c0cc1cd8a | andrejpanev8/Lost-and-Found-Flutter | 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.998733 | 6.76775 |
f0c514b2-66f3-44be-a321-4574391992ef | xenowits/cp | practice/integerRightTriangles.cpp | //xenowitz -- Jai Shree Ram
#include<bits/stdc++.h>
using namespace std;
#define fori(i,a,b) for (long long int i = a; i <= b ; ++i)
#define ford(i,a,b) for(long long int i = a;i >= b ; --i)
#define mk make_pair
#define mod 998244353
#define pb push_back
#define ll long long
#define ld long double
#define MAXN 1e6+5
#... | ALGO | 0.999278 | 3.993832 |
8b4ce95e-7708-4c55-912a-2d4e8fb64054 | manh610/document-c- | ke_gac_cong.cpp | #include <iostream>
using namespace std;
main ()
{
int a,b,c,d;
cin >> a >> b >> c >> d;
int p,m,g;
cin >> p >> m >> g;
int dem1 = 0;
int du1 = p%(a+b);
if ( du1!=0 && du1 <= a ) dem1++;
int du11 = p%(c+d);
if ( du11!=0 && du11<=c ) dem1++;
if ( dem1==0 ) cout << "none" << endl;
else if ( dem1==1 ) cout << "... | ALGO | 0.999764 | 3.470078 |
bccd00f9-f339-44ef-ab6c-e7f27aa6d4c8 | TrDieux18/CTDL-GT_PTIT | Binary_Search.cpp | #include<iostream>
#include<algorithm>
using namespace std;
bool bbinary_search(int a[], int n, int x){
int l = 0, r= n-1;
while(l <= r){
int mid = (l+r)/2;
if(a[mid] == x){
return true;
}
else if( a[mid] > x){
l = mid + 1;
}
else{
... | ALGO | 0.999996 | 4.688539 |
88a07b32-2b25-4220-8b8b-519f3d67f32e | rifatbroh/Daily_Update | week 19/Day_5/A_Rudolf_and_the_Ticket.cpp | /*
MD Rifat Hossain
Institute:- BAIUST
Country:- BANGLADESH
*/
#include<bits/stdc++.h>
using namespace std;
#define OLD_MAXTAN \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long
#define ld long double
#define yes cout << "YES"
... | ALGO | 0.999933 | 4.297009 |
57761c2a-651d-4d0e-8ae6-76b5fb144c87 | Ashish2831/6companies30days | Amazon/14. BurningTree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
Node *buildTree(string str)
{
// Corner Case
if (str.length() == 0 || str[0] == 'N')
return NULL;
// Creati... | ALGO | 0.999895 | 5.870491 |
0b8ec8f4-62f7-4782-9d4b-b50f576b4a42 | amanullah7649/Programming | Dev_Skill_Advanced/DevCP - Advanced - SegmentTreeLazy + Sparse Table/Catapult that ball.cpp | /*
#include <bits/stdc++.h>
using namespace std;
#define MAX 100005
#define ll long long int
#define left start,(start+end)/2,node+node
#define right (start+end)/2+1,end,node+node+1
struct type
{
int max_first, max_second;
type() { max_first = max_second = 0;}
};
int arr[MAX];
type tree[MAX * 4];
void update... | ALGO | 0.999991 | 5.010774 |
912d239b-0b8a-4e0f-b7b9-2fb7c38ffffd | shindechandrakant/data-structure-Algo | codeForeces/plus-to-subset.cpp |
#include<iostream>
#include<math.h>
#include<bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace chrono;
#define ll long long int
#define MOD 1000000007
#define vi vector<ll>
#define pi pair<ll, ll>
#define vb vector<bool>
#define vs vector<string>
#define newline(n) for(int i = 0; i < (n); i++ )cout... | ALGO | 0.999834 | 4.213784 |
abc6a13f-455a-4f58-ab39-d44f91a4e42b | ffokildam/MOPEVM | Misc/TINKOFF/Task3/Task3.cpp | /*
*Сложнейшая таска*
Вводятся N чисел - "высоты" райнов через которые проходит дорога
Необходимо "выровнять" дорогу так, чтобы суммарная площадь
в разрезе на которую придется поднять некоторые участки дороги
была равна суммарной площади, на которую нужно будет
опустить другие участки дороги.... | ALGO | 0.999509 | 3.982202 |
682bdbfe-32e9-4b48-8dab-fe9525f9b834 | razouq/cses | Sorting and Searching/Movie Festival.cpp | #include "bits/stdc++.h"
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define ll long long
#define ull unsigned long long
#define F first
#define S second
#define PB push_back
#define POB pop_back
using namespace std;
bool compare(pair<ll, ll> p1, pair<ll, ll> p2) {
return (p1.S < p2.S || (p1.S == p2.S &&... | ALGO | 0.999945 | 4.481536 |
81fc9002-a85e-41fa-bbe8-4b496327ee98 | showmic96/Online-Judge-Solution | CodeForces/348A/10338607_AC_156ms_3596kB.cpp | // In the name of Allah the Most Merciful.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>v;
int n;
bool possible(ll x)
{
ll sum = 0;
for(int i=0;i<n;i++){
if(v[i]>x)return false;
sum+=(x-v[i]);
}
if(sum>=x)return true;
return false;
}
int main(v... | ALGO | 0.999985 | 4.362572 |
1e8f13e2-a835-4fc8-97ee-b8c6c9a01bd7 | Kawser-nerd/CLCDSA | Source Codes/AtCoder/abc105/A/4921965.cpp | #include <iostream>
int main()
{
long N, K;
std::cin >> N >> K;
long ans;
if ( K != 0 )
{
// ?????????????????????????????1????
ans = ( ( N % K ) != 0 );
}
else
{
// 0??????????????0???????
ans = 0;
}
std::cout << ans << std::endl;
return ( 0 );
} | ALGO | 0.99993 | 3.512861 |
f53c1f17-bcf8-44e9-b17a-8eff79a1063c | Prashant-2505/interview-stuff | dsa/LIS2.cpp | #include <bits/stdc++.h>
using namespace std;
int LCS(string s, string t, int m, int n, vector<vector<int>>& dp)
{
if (m == s.size() || n == t.size())
{
return 0;
}
if (dp[m][n] != -1)
{
return dp[m][n];
}
if (s[m] == t[n])
{
return dp[m][n] = 1 + LCS(s, t, m +... | ALGO | 0.999955 | 6.137296 |
1dd0de74-4621-4f91-ae5a-e56300eceb19 | YeahLim/AlgorithmLevelUpCompetition | 07th_Competition/JeongEon/01/2644.cpp | // ˰ ͵ 7ȸ
// ȣ: 2644
// ̸: ̼
// ˰: BFS
// ۼ: 24.03.04
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int n; // ü
int find1, find2; // ̼ ؾϴ ٸ ȣ
int m; // θ ڽ
vector<int> family[101];
bool visited[101] = { false }; // 湮Ȯ
int depth[101] = { 0 };
void bfs(int check);
int main(v... | ALGO | 0.999958 | 4.331467 |
e6649028-9db2-46d3-8422-6a8d7ed42b58 | Abhishekhmishra0/Array-CPP | arrayrev.cpp | #include<iostream>
void arrrev(int arr[]){
using namespace std;
for(int i=0,j=4;i<j;i++,j--){
int temp = arr[i];
arr[i]=arr[j];
arr[j]=temp;
}
}
int main(){
using namespace std;
int arr[5] ;
cout<<"Enter elements of array ";
for(int i=0;i<5;i++){
cin>>arr[i]... | ALGO | 0.999637 | 4.206383 |
a6ed2b97-d2e4-4358-becb-c38fb7d264c8 | bkorecic/competitive-programming-solutions | onlinejudge/11764 - Jumping Mario.cpp | #include <iostream>
using namespace std;
int main() {
//11764 - Jumping Mario
int K;
int N;
int high;
int low;
cin >> K;
for(int rep=0; rep<K; rep++){
cin >> N;
high = 0;
low = 0;
int H[N];
for(int i=0; i<N; i++){
cin >> H[i];
... | ALGO | 0.999569 | 3.579322 |
36510206-fb8e-4c54-ba7e-db396fca59f0 | kmjp/procon | codeforce/851-900/864/d2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define ... | ALGO | 0.999879 | 3.965861 |
e7d974d4-505c-467f-b800-dc6030e19c54 | AtaberkOKLU/STM32-USB-HID | Mouse_Keyboard/Drivers/CMSIS/NN/Examples/ARM/arm_nn_examples/gru/arm_nnexamples_gru.cpp | /**
* @ingroup groupExamples
*/
/**
* @defgroup GRUExample Gated Recurrent Unit Example
*
* \par Description:
* \par
* Demonstrates a gated recurrent unit (GRU) example with the use of fully-connected,
* Tanh/Sigmoid activation functions.
*
* \par Model definition:
* \par
* GRU is a type of recurrent neura... | ALGO | 0.90855 | 7.471897 |
e8630e46-bee1-47e1-b779-7ea0e5040f6c | CF2001/IC_project1 | sndfile-example-src/wav_dct.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <fftw3.h>
#include <sndfile.hh>
#include <bitset>
#include <cstring>
#include "BitStream.h"
#include "wav_dct.h"
using namespace std;
int main(int argc, char *argv[]) {
bool verbose { false };
size_t bs { 1024 }; // tamanho de cada bloco; cada bloco... | ALGO | 0.974777 | 4.9231 |
85bb5902-49f6-40f9-8e12-6965bfed9944 | queekoo/PP1 | tap7.cpp | #include <iostream>
using namespace std;
int main(){
float p,r,t;
cin>>p>>r>>t;
float st=(p*r*t)/100;
cout<<"Your BMI is " <<st<<endl<<endl;
return 0;
} | ALGO | 0.996008 | 3.820989 |
f5d5fd14-6c0d-47fc-9761-33914650bd30 | maddymundhra/DSA-Supreme-2.0 | CharArrays&Strings-Class2/validPallindrome2.cpp | // Leetcode Link: https://leetcode.com/problems/valid-palindrome-ii/description/
// Check whether a string can be made a pallindrome after removing a single element
// Eg: s = "abca"
// After removing 'c', we can make a pallindrome i.e "aba"
// Output: "true"
#include<bits/stdc++.h>
using namespace std;
bool checkPali... | ALGO | 0.999937 | 6.018373 |
2f3cb7ba-65be-4d5b-89aa-1488d2c0cc48 | MariaChrysafis/CompetitiveProgramming | Codeforces/1656A.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#include <set>
#include <cmath>
#include <map>
#include <random>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <limits.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int T;
cin >> T;
... | ALGO | 0.999961 | 3.836367 |
fcb2196f-d32e-4dce-8516-e7de8980451e | hackverket/bitcoin-abc | src/sync.cpp | #include "sync.h"
#include "util.h"
#include "utilstrencodings.h"
#include <cstdio>
#include <set>
#ifdef DEBUG_LOCKCONTENTION
#if !defined(HAVE_THREAD_LOCAL)
static_assert(false, "thread_local is not supported");
#endif
void PrintLockContention(const char *pszName, const char *pszFile, int nLine) {
LogPrintf("... | TOOL | 0.958043 | 6.280155 |
d708beb0-e085-4ad1-ac6d-c54126a8a3b2 | fuhadkalathingal/DSA-Notes | Array/uniqueNumFreq.cpp | #include <bits/stdc++.h>
using namespace std;
bool isTrue(vector<int> &arr)
{
vector<int> freq(2001, 0);
for (auto i : arr)
{
if (i >= 0)
{
freq[i]++;
}
else
{
freq[1000 * (i * -1)]++;
}
}
vector<int> valid_freq;
for (in... | ALGO | 0.99987 | 4.636862 |
d2cb86fe-02d3-423e-9419-e09076457c48 | itsmona14/Placement-prep | Week 2/Search in a rotated array.cpp | https://practice.geeksforgeeks.org/problems/search-in-a-rotated-array4618/1
class Solution{
public:
int search(int A[], int l, int h, int key){
//complete the function here
if(l > h)
return -1;
int mid = (l+h)/2;
//target found
if(A[mid] == ... | ALGO | 0.999994 | 5.722922 |
a6a4cf2f-fcc9-4c48-af0e-0dfa6db619f1 | ishandutta2007/codeforces | riverwalk7/normal/755/A.cpp | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int N;
bool isPrime(int x)
{
for(int i=2; i<x; i++)
{
if(x%i==0)
{
return false;
}
}
return true;
}
int main()
{
cin>>N;
for(int i=1;; i++)
{
if(!isPrime(N*i+1))
... | ALGO | 0.999918 | 3.655073 |
0e059de4-2ed3-4bc6-ac99-60acd5994236 | LineNo2/PS | class_5/class_5_essentials/1202.cpp | #include <bits/stdc++.h>
#define MAXN 300000
using namespace std;
typedef struct Jam{
int mass;
int value;
bool operator<(const Jam& J)const{
return value < J.value;
}
}Jam;
bool comp(int a, int b){
return a > b;
}
bool sort_jam(Jam a, Jam b){
return a.mass < b.mass;
}
int N, K;
Jam jams[MAXN];
int b... | ALGO | 0.99996 | 3.863577 |
e693d805-f129-4eab-98ad-998c037502f9 | oussamakhadraoui/c-learning | dp/494. Target Sum.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int rec(vector<int>& nums, int target,int i ){
if(i>=nums.size()){
if(target==0)return 1;
else return 0;
}
int result=0;
result+=rec(nums,target-nums[i],i+1);
result+=rec(... | ALGO | 0.999989 | 5.674694 |
3a074c6a-5430-4167-9a93-5b03b8805fca | ajimenez1503/programas-de-Algoritmica | temas/tema3/ejercicios/asignacion de tareas-trabajadores.cpp | /* (C) Programmed by:
Antonio Jimenez Martínez
Asignatura Algoritmica (ALG)
Problemas tema 3: Voraz-Greedy
Version:0.1
EJERCICIO Asignacion de tareas
Supongamos que disponemos de n trabajadores y n
tareas. Sea bij > 0 el coste de asignarle el trabajo j al
trabajador i.
Una asignación de tareas puede ser expresad... | ALGO | 0.999645 | 4.358375 |
969c0a60-2d05-43b2-83c2-8466617c531a | futureneer/wallframe_apps | modulair_app_wallball/include/Box2D/Dynamics/Joints/b2RopeJoint.cpp | #include <Box2D/Dynamics/Joints/b2RopeJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Limit:
// C = norm(pB - pA) - L
// u = (pB - pA) / norm(pB - pA)
// Cdot = dot(u, vB + cross(wB, rB) - vA - cross(wA, rA))
// J = [-u -cross(rA, u) u cross(rB, u)]
// K = J * invM * JT
// = inv... | ALGO | 0.992209 | 7.506215 |
11316dcf-efe1-40d6-a765-bb1bc9e8863a | JohnyKid123/CPP-Course | 2. Programming/1. Data types/CreatingWords/program.cpp | #include <iostream>
#include <string>
#include <sstream>
int main() {
int n;
std::cin >> n;
std::stringstream ss;
for (int i = 0; i < n; i++)
{
char currentSymbol;
std::cin >> currentSymbol;
ss << currentSymbol;
}
std::cout << "The word is: " << ss.str() << std::en... | ALGO | 0.990202 | 4.9587 |
c9f39beb-4767-40a9-b6e2-56a0ccacb8e0 | willimius/leetcode | Ransom Note.cpp | class Solution {
public:
bool canConstruct(string ransomNote, string magazine) {
if (ransomNote.empty()) return true;
if (magazine.empty()) return false;
unordered_map<char, int> char_to_cnt;
for (auto c : magazine)
char_to_cnt[c]++;
for (auto c : ransomNote){
... | ALGO | 0.999566 | 6.432959 |
5e88c1db-6455-411f-8160-47d717efa865 | Balpreet1003/LeetCode | 2914-minimum-number-of-changes-to-make-binary-string-beautiful/2914-minimum-number-of-changes-to-make-binary-string-beautiful.cpp | class Solution {
public:
int minChanges(string s) {
int ans=0;
for(int i=0;i<s.length();i+=2){
if(s[i]!=s[i+1])ans++;
}
return ans;
}
}; | ALGO | 0.999965 | 5.60428 |
48467ae8-bbb3-4da0-8a8a-a4e48d4817af | schrodibear/astraver | doc/texpp/format_arrondi.cpp | \begin{flushleft}\ttfamily\upshape
%BEGIN LATEX
\parindent 0pt
%END LATEX
\begin{slshape}\rmfamily\color{darkgreen}//~3~formats~possibles\end{slshape}~\\
\textbf{type}~float\_{}format~=~Single~|~Double~|~Quad~\\
~\\
\begin{slshape}\rmfamily\color{darkgreen}//~5~modes~d'arrondi~(norme~IEEE$-$754)\end{slshape}~\\
\textbf... | TOOL | 0.967553 | 3.898808 |
c7b6efb6-e8e8-4c0e-a17f-ea52e7ed78b5 | dlvguo/NoobOJCollection | LeetCode/InterviewQuestions/03_02.cpp | #include <bits/stdc++.h>
using namespace std;
class MinStack
{
private:
stack<int> stk;
stack<int> minStk;
public:
MinStack()
{
}
void push(int x)
{
if (minStk.empty() || x <= minStk.top())
{
minStk.push(x);
}
stk.push(x);
}
void pop()... | ALGO | 0.999883 | 5.95295 |
fc615921-ea66-4bd2-8109-12d261c74804 | bennyang/Hello-World | cpp/chap01/01_21.cpp | #include <iostream>
#include "Sales_item.h"
int main()
{
Sales_item item1, item2;
std::cin >> item1 >> item2;
std::cout << item1 + item2 << std::endl;
return 0;
}
| TOOL | 0.855757 | 4.320287 |
0a7b0ce6-f75b-4cae-924f-9fb567c9170e | wangyixu14/interval_convolution_cuda | labs/src/lab3/test_harness.cpp | #include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <cuda.h>
#include <cutil.h>
#include <cuda_runtime_api.h>
#include "util.h"
#include "ref_2dhisto.h"
#include "opt_2dhisto.h"
#define SQRT_2 1.4142135623730950488
#define SPREAD_BOTTOM (2)
#define SPREAD_TOP (6)
#defin... | ALGO | 0.974289 | 6.066609 |
fa3ff918-04a8-44a5-b9bb-c45ee2c11dbc | ishandutta2007/codeforces | robezh/normal/900/C.cpp | #include<cstdio>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int n;
int num[100050];
int cumu[100050];
bool up[100050];
int maxi, smaxi;
int maxD = -1;
int res = 0;
int main() {
cin >> n;
for(int i = 0; i < n; i++) scanf("%d", &num[i]);
fill(cumu, cumu+n, 0);
fill(up, up+... | ALGO | 0.999983 | 3.675757 |
0982c2e8-0a57-41fe-b03b-b14dc76ee068 | SammedSankonatti/Leetcode | C++/237.deleteANode.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
void deleteNode(ListNode *node)
{
... | ALGO | 0.999848 | 5.238953 |
6c9309bb-8599-4cd7-96ba-05d6718e5bab | Raizaen/Tp3 | Exo1.cpp | #include <iostream>
#include <cmath>
using namespace std;
bool triangle(float a, float b, float c) {
return (a<=c+b);
}
bool isocele(float a,float b,float c) {
if(b==a || b==c) return 1;
return 0;
}
bool rectangle(float a,float b,float c) {
if ((b*b+c*c)==(a*a)) return 1;
return 0;
}
bool equilateral(flo... | ALGO | 0.998986 | 3.93609 |
3d5a18a2-79dc-4f55-bffa-7f1052afc295 | sarvex/leetcode-d | solution/1100-1199/1199.Minimum Time to Build Blocks/Solution.cpp | class Solution {
public:
int minBuildTime(vector<int>& blocks, int split) {
priority_queue<int, vector<int>, greater<int>> pq;
for (int v : blocks) pq.push(v);
while (pq.size() > 1) {
pq.pop();
int x = pq.top();
pq.pop();
pq.push(x + split);
... | ALGO | 0.999975 | 6.049258 |
20caa988-8e3f-4d2b-a9d3-9518803b68ed | sliencetian/AndroidFrameWorks | frameworks/base/tools/aapt2/split/TableSplitter.cpp | #include "split/TableSplitter.h"
#include <algorithm>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <vector>
#include "android-base/logging.h"
#include "androidfw/ConfigDescription.h"
#include "ResourceTable.h"
#include "trace/TraceBuffer.h"
#include "util/Util.h"
using ::... | TOOL | 0.921855 | 7.470892 |
13a2de91-dcea-410e-9408-c342f9c9cfab | izlyforever/cf | contest/1401/a/a.cpp | #include <bits/stdc++.h>
#define watch(x) std::cout << (#x) << " is " << (x) << std::endl
#define print(x) std::cout << (x) << std::endl
using LL = long long;
int main() {
std::cin.tie(nullptr)->sync_with_stdio(false);
int cas;
std::cin >> cas;
while (cas--) {
int n, k;
std::cin >> n >> k;
if (n <=... | ALGO | 0.999916 | 4.130134 |
596bcf66-6918-4bbe-a55a-12beec7f911b | jwnhy/lam | llvm-project/libcxx/test/std/algorithms/alg.nonmodifying/alg.find.first.of/find_first_of_pred.pass.cpp | // <algorithm>
// template<InputIterator Iter1, ForwardIterator Iter2,
// Predicate<auto, Iter1::value_type, Iter2::value_type> Pred>
// requires CopyConstructible<Pred>
// constexpr Iter1 // constexpr after C++17
// find_first_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2, Pred pred);
#incl... | TEST | 0.993016 | 6.534602 |
48191863-3b09-4d82-8563-46e0aeaee3e4 | call-me-bammer/montmartre-hill | programmers/176963/main.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
using namespace std;
vector<int> solution(vector<string> name, vector<int> yearning, vector<vector<string>> photo) {
vector<int> answer;
map<string, int> m;
for (int i = 0; i < name.size(); i++)
m.insert({name[i], yearning[i]});
for ... | ALGO | 0.993632 | 4.652266 |
bbac0c8b-6120-40c0-a244-ab27d42b1ccb | dhruv-vavliya/Codeforces | phase_2/test_29.cpp | /*
▄▄▄▄▄ ▄ ▄ ▄ ▄
▄▄▄▄██▄████▀█▀█▀█▀██▄ @author
▀▄▀▄▀▄████▄█▄█▄█▄█████ DHRUV
▀▀▀▀▀▀▀▀██▀▀▀▀██▀ ▄██ VAVLIYA
▀▀ ▀▀ ▄▄██▀
AMMI JAAN KEHTI THI
KOI CODE CHHOTA NAHI HOTA OR...
*/
#include <bits/stdc++.h>
// #define int long lon... | ALGO | 0.999992 | 4.43163 |
54acc568-e843-4864-a752-cbfc6e091c99 | inferno986return/eldritch-mirror | Eldritch-Source/Code/Projects/Eldritch/src/Components/wbcompeldthinkerpatrol.cpp | #include "core.h"
#include "wbcompeldthinkerpatrol.h"
#include "Components/wbcomprodinknowledge.h"
#include "Components/wbcomprodinblackboard.h"
#include "Components/wbcompeldtransform.h"
#include "configmanager.h"
WBCompEldThinkerPatrol::WBCompEldThinkerPatrol()
: m_OutputBlackboardKey()
{
}
WBCompEldThinkerPatrol::... | ALGO | 0.964407 | 6.619802 |
c267c63c-17d1-4d4f-b33e-9bb36fe3f331 | hofbi/tamva | view_mda/source/vqm/src/mdvqm.cpp | #include "mdvqm.h"
#include "frame_history.h"
#include "mdvqm_param.h"
#include "pixel_bitrate.h"
namespace lmt::vqm
{
double calculateMDVQM(const FrameHistory& frameHistory, uint8_t frameRate, double spatialScaleFactor) noexcept
{
const auto sa = frameHistory.getMeanSA();
const auto ta = frameHistory.getMean... | ALGO | 0.991907 | 6.117256 |
b45ae79c-8678-4f07-88ec-1737eb228e76 | fangism/libcxx | test/std/algorithms/alg.sorting/alg.min.max/minmax_element.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// pair<Iter, Iter>
// minmax_element(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
template <class Iter>
void
test(Iter first, Iter last)
{
std::pair<Iter, Iter>... | TEST | 0.958845 | 6.493803 |
b75831dc-4ac3-411b-a61c-fd07233ca4f8 | iamyeasin/UVa | Sources/10285 - Longest Run on a Snowboard.cpp | #include <bits/stdc++.h>
#define UNVISITED 0
using namespace std;
long n,m,kase,longRun=-56;
int fx[] = {+1,-1,+0,+0};
int fy[] = {+0,+0,+1,-1};
int in[123][123],table[123][123];
bool isOk(int i,int j) { return (i>=1 && i<=n && j>=1 && j<=m ); }
void clr(){
for( int i=1; i<=n; i++ ){
for( int j=1; j<=m... | ALGO | 0.999808 | 3.467174 |
17918ab1-5968-4b0e-9f8e-5aee08cdf6a8 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/MixtralExpert/top0-100/stamping-the-grid-Solution.possibleToStamp/177816_Bypass.cpp | void get_checksum2(char *buf, int32 len, char *sum)
{
md_context m;
switch (xfersum_type) {
case CSUM_MD5: {
uchar seedbuf[4];
md5_begin(&m);
if (proper_seed_order) {
if (checksum_seed) {
SIVALu(seedbuf, 0, checksum_seed);
md5_update(&m, seedbuf, 4);
}
md5_update(&m, (uchar *)buf, len);
}... | ALGO | 0.996235 | 5.804347 |
0896212c-0a03-46d0-9d84-bebbcd72cdda | loyinglin/Codeforces | 1288/D/Codeforces/main.cpp | /************************** 题解 **********************
[题目链接](http://codeforces.com/contest/1288/problem/D)
**题目大意:**
有n个数组,每个数组有m个元素;
对于两个数组可以进行一次合并,新的数组每个index的数字等于原来两个数组对应index 的较大值,比如:
5 0 3 1 2
1 8 9 1 3
=5 8 9 1 3
现在从n个数组中选出2个数组,合并之后得到数组b,并且要求数组b的最小值,要尽可能的大;
输入:
第一行 𝑛 and 𝑚 (1≤𝑛≤3⋅1e5, 1≤𝑚≤8)
接下来n行... | ALGO | 0.999866 | 3.57866 |
5a769d3c-ffdf-4823-9c61-613c697f0e28 | erupshis/algorithms_cpp | praktikum_sprint_1/a_func_values/func_values.cpp | #include <iostream>
int main() {
int a, x, b, c;
std::cin >> a >> x >> b >> c;
std::cout << a * x * x + b * x + c;
return 0;
} | ALGO | 0.9597 | 3.916867 |
24defe7c-13b2-45c1-92b9-e8f1f9901a63 | HONGJICAI/LeetCode | cpp/559.cpp | class Node {
public:
int val;
vector<Node*> children;
Node() {}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
class Solution { // Runtime: 136 ms, faster than 98.03% of C++ online
// submissions for Maximum Depth of N-ary Tree.
pu... | ALGO | 0.999887 | 6.526427 |
3cb2260d-bfb3-4f65-8dd8-753e51b9c668 | suhaas02/Data-structures-and-algorithms | DSA self paced course/5.Arrays/longest-even-odd-subarray.cpp | //maximum length even odd subarray
//time complexity: O(N);
#include<bits/stdc++.h>
using namespace std;
int maxEvenOdd(int arr[],int n)
{
int res = 1;
int curr = 1;
for (int i = 1; i < n; i++)
{
if ((arr[i] % 2 == 0 && arr[i - 1] % 2 != 0) ||
(arr[i] % 2 != 0 && arr[i - 1] == 0))
... | ALGO | 0.999847 | 4.474653 |
559423ee-c02e-47e5-ab97-e0cc32221897 | PakinDioxide/TOI-zero | A1/A1-003.cpp | /*
author : PakinDioxide
created : 01/04/2025 20:53
task : A1-003
*/
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
ll a, b, c;
cin >> a >> b >> c;
cout << max({a, b, c}) << '\n';
} | ALGO | 0.999896 | 4.888936 |
f5024c31-bca6-4a63-aed3-634c23ee3617 | zfsrogue/freebsd-crypto | contrib/llvm/lib/Transforms/Utils/FlattenCFG.cpp | #include "llvm/Transforms/Utils/Local.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
using names... | ALGO | 0.993704 | 7.37912 |
7f8d71c3-e26f-4aab-9f25-256f2b04c32a | NicholasTemesvary/CPSC335-Algorithms_Assignment5 | src/breadth_first.cpp | #include "tree_algorithms.h"
#include <queue>
void _breadth_first(TreeNode* root, vector<int>& answer){
if (root == nullptr) {
return;
}
queue<TreeNode*> q;
q.push(root);
while (!q.empty()) {
TreeNode* current = q.front();
q.pop();
answer.push_back(current->data);
... | ALGO | 0.999954 | 5.824272 |
5f364af1-50b9-4aac-af62-c3e6405d3911 | BLBT1/MyLeetcodeSolution | Hashmap/438. Find All Anagrams in a String/438. Find All Anagrams in a String.cpp | class Solution
{
public:
vector<int> findAnagrams(string s, string p)
{
int m = s.size();
int n = p.size();
if (m < n)
return {};
vector<int> s_mp(26, 0);
vector<int> p_mp(26, 0);
for (auto c : p)
p_mp[c - 'a'] += 1;
vector<int> re... | ALGO | 0.999923 | 6.135943 |
ce2e719c-684c-4bfe-b467-d2a68db3f21e | ReB2GOS/libcxx | src/algorithm.cpp | #include "algorithm"
#include "random"
#include "mutex"
_LIBCPP_BEGIN_NAMESPACE_STD
template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
template void __sort<__less<signed char>&, signed char*>(signed char*, si... | ALGO | 0.999527 | 5.632583 |
1ef30d07-1764-4b66-b969-9550c89216b6 | StarRocks/clucene | src/core/CLucene/search/spans/NearSpansUnordered.cpp | #include "CLucene/_ApiHeader.h"
#include "CLucene/index/IndexReader.h"
#include "CLucene/util/StringBuffer.h"
#include "_NearSpansUnordered.h"
#include "_NearSpansOrdered.h"
#include "SpanNearQuery.h"
CL_NS_DEF2( search, spans )
/////////////////////////////////////////////////////////////////////////////
NearSpansU... | ALGO | 0.978011 | 6.657571 |
7ecc0d94-6f5b-42f4-b2b9-e8402aa96963 | ldslds449/LeetCode | 1382/main.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.999974 | 6.209182 |
bb31b884-f9ed-486d-9378-ce171cad22c7 | Pj-develop/DataStructuresNAlgorithm | sd4.cpp | #include <iostream>
#include <vector>
int count_elements_less_equal(const std::vector<int> &arr, int key) {
int left = 0, right = arr.size() - 1;
int count = 0;
while (left <= right) {
int mid = left + (right - left) / 2;
if (arr[mid] <= key) {
count = mid + 1; // Include the ... | ALGO | 0.999955 | 5.894052 |
e04debef-f9d5-47fd-b18c-df18865cfb95 | Hawardshin/HellgorithmStudy23 | FirstWave/mkwon/7set/12852.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int n,m,dp[1000005]={0,},path[1000005]={0,};
int main()
{
ios_base::sync_with_stdio(false); cin.tie(nullptr);
cin>>n;
dp[1]=0; path[1]=1;
for(int i=2; i<=n; i++){
dp[i]=dp[i-1]+1;
path[i]=i-1;
if(i%2==0 && dp[... | ALGO | 0.999984 | 3.816045 |
a91864b0-3d2e-4cda-8eec-4cdf761c6df0 | Varun1300211/Algo | topologicalSort_DFS.cpp | #include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define ff first
#define ss second
#define ii insert
#define vi vector<long long int>
const int N=1e5+5;
const int mod=1e9+7;
const ll int_max=1e18;
#define loop(i,j,k) for(ll i=j;i<=k;i++)
#define looprev(i,j,k) for(ll i=j;i>=k;i--)
using namespace... | ALGO | 0.999952 | 4.209366 |
ea9a4841-4c9f-4766-854a-7db99c2b2878 | Asik8/My-Codeforces | Old Codes/A_Permutation_Warm_Up.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pbs insert
#define pi pair<ll,ll>
#define py cout<<"YES\n";
#define pys cout<<"Yes\n";
#define pn cout<<"NO\n";
#define pns cout<<"No\n";
#define co(x1) cout<<x1<<"\n";
#define ct(x1) cout<<x1<<" ";
#define elc cout<<"\n";
#... | ALGO | 0.999922 | 4.423552 |
49ab2645-7c2e-440b-b909-e410b4c9ce5f | yuichiro-kurose/kyopro | joi/joi2015/honsen/a/main.cpp | // author: Yuichiro Kurose
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<int> p(m), a(n), b(n), c(n);
for (int i = 0; i < m; i++) {
cin >> p[i];
}
for (int i = 1; i <= n - 1; i++) {
cin >> a[i] >> b[i]... | ALGO | 0.999802 | 4.229819 |
e7d73ab5-6266-4983-a868-4d7c91286c24 | apu52/GFG-Daily-Solutions | Minimum Weight Cycle.cpp | class Solution {
public:
int findMinCycle(int V, vector<vector<int>>& edges) {
const int INF = 1e8;
vector<vector<int>> dist(V, vector<int>(V, INF));
vector<vector<int>> adj(V, vector<int>(V, INF));
for (auto &e : edges) {
int u = e[0], v = e[1], w = e[2];
... | ALGO | 0.99938 | 5.390161 |
194e9bee-609d-45b3-b9fd-dd659ec6af4e | daniel-ankit/Leetcode | Subset Sums - GFG/subset-sums.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
vector<int>sums;
void fn(int i, vector<int>nums, int sum)
{
if(i>nums.size()) return;
if(i==nums.size())
{
sums.push_back(sum);
return;
}
... | ALGO | 0.999704 | 6.657342 |
96744c3e-9669-45a5-9a54-9342c968607e | Shivk123/Leetcode-problems | 2059-UniqueLength3PalindromicSubsequences/2059-UniqueLength3PalindromicSubsequences.cpp | // Last updated: 5/28/2025, 9:52:02 PM
class Solution {
public:
int countPalindromicSubsequence(string s) {
int ans = 0;
vector<int> first(26, s.length());
vector<int> last(26);
for (int i = 0; i < s.length(); ++i) {
const int index = s[i] - 'a';
first[index]... | ALGO | 0.999889 | 6.821463 |
ae4d7ea9-170b-4f19-81c3-b0676f5fcaf7 | muhimin30/Contests_Solve | Codeforces_922_div_2/b.cpp | //Muhimin
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define bismillah() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(16);cout.setf(ios::fixed,ios::floatfield);
#define endl '\n';
void solve()
{
int n; cin >> n;
vector<... | ALGO | 0.999769 | 3.210978 |
8ac77bca-fa6b-4a57-a1ea-24b7bf9c52e5 | Vijay1770/DSA-FULL | ll_head_insertion.cpp | #include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
// THis constructor show the nodes data...
Node(int data)
{
this->data = data;
this->next = NULL;
}
};
// /*
// This function insert a node in begninning...
void insertathead(Node *&head, int... | ALGO | 0.998887 | 4.146365 |
b3d29bc8-2a7c-4a73-8a0f-9aabf5f7e81b | Fireworker20th/SPORTS | SPORTS/VO/VO_Module/thirdparty/lietorch/eigen/bench/bench_reverse.cpp |
#include <iostream>
#include <Eigen/Core>
#include <bench/BenchUtil.h>
using namespace Eigen;
#ifndef REPEAT
#define REPEAT 100000
#endif
#ifndef TRIES
#define TRIES 20
#endif
typedef double Scalar;
template <typename MatrixType>
__attribute__ ((noinline)) void bench_reverse(const MatrixType& m)
{
int rows = m.r... | TEST | 0.904524 | 5.595998 |
d49c0f19-f7be-40d1-b204-c19d3290771e | OlaAbdallahM/Competitive-Programming | UVA/10944/23878437_AC_280ms_0kB.cpp | #define _CRT_SECURE_NO_WARNINGS
// Allah_Almost3aan
#include<bits/stdc++.h>
#include <unordered_map>
using namespace std;
using ll = long long;
const ll OO = 1e18;
#define MOD 1e9+7
#define fnt 0x3f3f3f3f
#define ed '\n'
#define ff first
#define ss second
#define sz(a) a.size()
#define pii pair<int,int>
#define vii... | ALGO | 0.999865 | 3.612524 |
3dac0665-4baa-4f2e-bc1a-db5265330c38 | ishandutta2007/codeforces-w | waynetuinfor/normal/732/F.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 4e5 + 10;
int a[maxn], b[maxn], tin[maxn], t, low[maxn], bcc[maxn], bcnt, to[maxn];
vector<pair<int, int>> G[maxn];
vector<int> head;
bool v[maxn], bridge[maxn];
stack<int> edge;
void dfs(int now, int fa) {
tin[now] = low[now] = ++t;
for (auto u :... | ALGO | 0.999974 | 4.199805 |
bb80f0f5-2c4a-4cac-a458-3d1fcb14e689 | jayysuthar/Competitive-Programming-Practice | Leetcode/20. Valid Parentheses.cpp | class Solution {
public:
bool isValid(string s) {
stack<int> st;
for(int i=0; i<s.size();i++){
if(s[i]=='(' or s[i]=='{' or s[i]=='['){
st.push(s[i]);
}
else{
if(st.empty()){
return false;
}
... | ALGO | 0.999704 | 6.365148 |
28b5e3cf-7557-4cea-b1f9-59e09140ec88 | yuanyuanxia/exprAuto | srcTest/polarToCarthesianX/expr_polarToCarthesianX_NumOpt.cpp | #include <iostream>
#include <iomanip>
#include <limits>
#include <cmath>
#include <cfenv>
#include "backend/points.h"
#include "backend/self_math.h"
#include "backend/gamma.h"
#include "iRRAM/lib.h"
int iRRAM::MAXiterationnum = 30;
bool iRRAM::enableReiterate = true;
bool iRRAM::alwaysenableReiterate = true;
using ... | ALGO | 0.993899 | 4.28656 |
2fbb0619-d38c-41a9-a611-f3b16a1538ae | paulyc/android-platform-system-core | libcutils/hashmap.cpp | #include <cutils/hashmap.h>
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
typedef struct Entry Entry;
struct Entry {
void* key;
int hash;
void* value;
Entry* next;
};
struct Hashmap {
Entry** buckets;
size_t bucketCo... | TOOL | 0.957932 | 6.623057 |
1d628233-1629-4e6a-adcb-98da529541df | illillli/codes | toj/toj_96.cpp | #include<iostream>
using namespace std;
int main() {
int a,c;
char b;
cin>>a>>b>>c;
if (b=='/'){
if(c==0){
cout<<"ERROR\n";
}else{
int ANS,R;
ANS=a/c;
R=a%c;
cout <<a<<" / "<<c<<" = "<<ANS<<" ... "<<R<<endl;
... | ALGO | 0.99763 | 3.556741 |
3e12be9d-f466-4809-b837-4f88bc597389 | NicerNewerCar/CS670-Team-4 | SLAM/opencv/sources/modules/gapi/samples/face_detection_mtcnn.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <iostream>
#include <limits>
#include <numeric>
#include <stdexcept>
#include <string>
#include <vector>
#include <opencv2/gapi.hpp>
#include <opencv2/gapi/core.hpp>
#include <opencv2/gapi/imgproc.hpp>
#include <opencv2/gapi/cpu/gcpukernel.hpp>
#include ... | TOOL | 0.972756 | 6.61742 |
a8dc4c47-4eb5-4178-8d9d-6ef7d38ee8ab | Ankit-Singh1234/DSA-CODE | Recursion/CA/nTo1.cpp | #include<iostream>
using namespace std;
void Print( int n){
if(n==1){
cout<<1;
return;
}
cout<<n<<endl;
Print(n-1);
}
int main(){
Print(5);
return 0;
} | ALGO | 0.999979 | 4.086263 |
f16f0495-4761-47ab-a6a9-4f6822714ba7 | parasguglani1/competitive_coding | Codeforces/830 div2/D_1_Balance_Easy_version.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace chrono;
#define ff first
#define ss second
#define int long long
using ll = long long;
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define PI 3.1415926535897932384626
#define ps(x,... | ALGO | 0.999983 | 4.645926 |
e095e912-6479-4938-9176-4f51a60bf0a9 | v0r0bi0v/templates | cpp_template/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
vector<tuple<ll, ll, int>> generate_subsets(const vector<pll>& items) {
int len = items.size();
vector<tuple<ll, ll, int>> subsets;
for (int mask = 0; mask < (1 << len); ++mask) {
ll total_weight = 0, tot... | ALGO | 0.999981 | 4.145009 |
4feb28e6-cee1-45aa-9970-36a03a0a2fdb | dckat/coding-test-study | private-study/백트래킹/알파벳.cpp | #include <iostream>
using namespace std;
char arr[20][20];
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
bool visited[26];
int r, c;
int ans = 0;
bool canMove(int x, int y) {
if (0 <= x && x < r && 0 <= y && y < c) {
return true;
}
return false;
}
void dfs(int x, int y, int cnt) {
bool ... | ALGO | 0.999749 | 4.971086 |
e652fc86-4c31-4994-a064-203d4f743598 | SudVig/Nearby-Bluetooth-Attendance-Tracker-App | 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 |
0741ea43-0d8e-45a6-a579-1e9b638818a7 | luhsra/melf-linker | src/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp | // <algorithm>
// template<class RandomAccessIterator, class UniformRandomNumberGenerator>
// void shuffle(RandomAccessIterator first, RandomAccessIterator last,
// UniformRandomNumberGenerator& g);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_macros.h"
int main(int,... | TEST | 0.960634 | 6.565413 |
bcd4d7fa-e660-441f-9f84-bb52faf9fccd | karan-saj/Data_Structure_Practise | friend_suggestion_ll.cpp | #include<iostream>
#include<string.h>
using namespace std;
struct node // Create linked list structure
{
string d;
node *next; // traverse b/w main ll
node *down; // traverse in tail ll
};
struct tree // Create linked list structure for friend link list
{
string d;
node *nxt; // traverse b/w main ll
};
class L... | ALGO | 0.99798 | 3.576883 |
e064121e-df86-48b3-a31d-f3d1f8914500 | Infinities-pro/Infinities | third_party/mlas/lib/qgemm_kernel_sse.cpp | #include "mlasi.h"
#include "qgemm.h"
struct MLAS_GEMM_U8X8_KERNEL_SSE
{
typedef int16_t PackedAType;
typedef int16_t PackedBType;
typedef uint8_t OffsetAType;
typedef int8_t OffsetBType;
static constexpr size_t PackedK = 2;
static constexpr MLAS_GEMM_QUANT_STRIDES Strides{ 12, 128, 128 };
... | ALGO | 0.959531 | 5.970728 |
aafd036a-b696-465f-841d-4825549a6278 | nick-thompson/GABUnityDemo | JuceLibraryCode/modules/juce_core/native/juce_android_Network.cpp | namespace juce
{
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \
METHOD (constructor, "<init>", "()V") \
METHOD (toString, "toString", "()Ljava/lang/String;") \
DECLARE_JNI_CLASS (StringBuffer, "java/lang/StringBuffer");
#undef JNI_CLASS_MEMBERS
//=============================================... | TOOL | 0.945866 | 5.743049 |
c3bc1e05-5216-4919-a13f-66678f3234e7 | eatoure/automata_messaging | signalgp-lite/third-party/conduit/third-party/Empirical/demos/utils/extras/calc_pow.cpp | #include <iostream>
#include <cmath>
int main()
{
// const double steps = 1024.0;
// for (double i = 0.0; i < steps; i += 1.0) {
// double val = i/steps;
// // std::cout << i << " " << steps << " " << val << " : " << std::log2(val) << std::endl;
// std::cout << std::pow(2, val) << ",";
// if (((int... | ALGO | 0.967981 | 3.993758 |
9c1efbf4-8952-403b-bce7-77fbd7fe8917 | Fahadh4444/Coding_Mafia | Practice/Problems/244 Diameter of Binary Tree()/Diameter of Binary Tree.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
/* A binary tree node has data, pointer to left child
and a pointer to right child */
struct Node {
int data;
struct Node* left;
struct Node* right;
};
Node* newNode(int val) {
Node* temp = new Node;
temp->data = val;
temp... | ALGO | 0.99958 | 6.090627 |
b73bd767-7c53-4edb-b320-f4c1778feeda | hoangvantuan123/LTHDT_OOP | Đề Thi/Hàng Đợi/lthdt-hangdoi-phantan.cpp | // Ho Ten :Hoang Van Tuan
// MaSV :650024
// Lop : K65CNTTA
// De :`
/*
Bài 31(lthdtbai31.cpp): Cho tệp văn bản "daysonguyen-bai31.txt" chứa một
dãy số nguyên,
trên tệp không có thông tin về số lượng số. Đọc từng số của dãy số từ
tệp,
nếu là số nguyên tố thì đưa vào hàng đợi. Đưa ra màn hình dãy số đọc t... | ALGO | 0.997266 | 3.717203 |
df62be8c-d527-41d7-b7b1-fd27b4d59e63 | Overstars/Practice | OJ/洛谷/数论/P1147 连续自然数和(等差数列求和).cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll fun(ll a0,ll sum)
{
ll delta=(2*a0-1)*(2*a0-1)+8*sum;
if(delta<0)
return -1;//无解
ll sq=(ll)sqrt(delta);
if(sq*sq!=delta)
return -1;//无整数解
ll ret=1-2*a0+sq;
if(ret%2==0)
return ret>>1;
else
return -1;
}
int main()
{
ll m;
cin>>m;
for... | ALGO | 0.999901 | 3.565017 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.