uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7977d3b0-2007-45e4-85b6-e36367b6a73e | PakornBank/2110328-DataAlgo | Algorithm/straightline.cpp | #include <bits/stdc++.h>
using namespace std;
bool dfs(const vector<vector<int>>& vec, int node, int parent, vector<bool>& visited) {
visited[node] = true;
if (vec[node].size() > 2) {
return false;
}
for (auto adj : vec[node]) {
if (adj != parent) {
if (visited[adj] == true)... | ALGO | 0.999844 | 5.004078 |
6b65540b-89fd-429e-97ac-d43152ac4c93 | trunghai95/MyCPCodes | VNOI/ICPC22_MB/icpc22_mb_g.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9 + 7;
const int MAXN = 5e5 + 5;
int test;
char s[MAXN];
ll sum, res, n;
ll val(char c) {
return c - 'a' + 1;
}
ll solve() {
scanf("%s", s);
n = strlen(s);
res = 0;
for (int i = 0; i < n; i++) {
ll l = i... | ALGO | 0.999945 | 4.2722 |
10d46902-0e22-4cc3-93c9-4dbf65115c3f | jaketurelli/leetcode | c++/src/022_invert-binary-tree.cpp | ///////////////////////////////////////////////
/// @file 022_invert-binary-tree.cpp
/// @author Jake Turelli (<EMAIL>)
/// @brief https://leetcode.com/problems/invert-binary-tree/
/// @version 0.1
/// @date 2022-01-18
///
/// @copyright Copyright (c) 2022
///
///////////////////////////////////////////////
// Defini... | ALGO | 0.999973 | 6.811949 |
8751704b-fbea-4b83-b363-5099ec67eeb1 | Professor-Berni/android_frameworks_av | media/module/codecs/amrnb/enc/src/enc_lag6.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/enc_lag6.c
Functions:
Date: 02/05/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template used to PV coding template.
... | ALGO | 0.998686 | 7.382874 |
7452f4d4-90d1-40e8-95c4-d15a08423734 | plantainjuice/leetcode_book | 1061.lexicographically-smallest-equivalent-string.cpp | /*
* @lc app=leetcode id=1061 lang=cpp
*
* [1061] Lexicographically Smallest Equivalent String
*/
// @lc code=start
class Solution {
public:
string smallestEquivalentString(string s1, string s2, string baseStr) {
// classic union set problem
vector<char> unionSet(26);
iota(unionSet.begin(), unionSet... | ALGO | 0.999834 | 6.785686 |
d1ec0954-90d6-48cc-b427-ab1fa1eae7c7 | yasmineBouslimani/flutter-stuff-generator | 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.998693 | 6.797273 |
5f1bd791-9228-447d-b77b-c94fca29044d | ishandutta2007/codeforces | nehnait/normal/1266/E.cpp | //Author:xht37
#include <bits/stdc++.h>
#define ui unsigned int
#define ll long long
#define ul unsigned ll
#define ld long double
#define pi pair< int, int >
#define fi first
#define se second
#define mp make_pair
#define ls (p << 1)
#define rs (ls | 1)
#define md ((t[p].l + t[p].r) >> 1)
#define pq priority_queue... | ALGO | 0.99966 | 3.754516 |
c1a53cda-af02-4e02-a119-57c289080d54 | gim-largerepo/including-investment-59GB | code/onto.cpp | Participant ten issue season data best success.
Difficult structure official defense situation.
Blue fine full. | ALGO | 0.895991 | 6.349875 |
0aa96e08-4465-421d-965f-9b078e968757 | whoIsRicardo/Projeto_TCC_2 | volumes/volume_1/matrix_inversion_1/eigen-master/bench/perf_monitoring/llt.cpp | #include "gemm_common.h"
#include <Eigen/Cholesky>
EIGEN_DONT_INLINE
void llt(const Mat &A, const Mat &B, Mat &C)
{
C = A;
C.diagonal().array() += 1000;
Eigen::internal::llt_inplace<Mat::Scalar, Lower>::blocked(C);
}
int main(int argc, char **argv)
{
return main_gemm(argc, argv, llt);
}
| ALGO | 0.999017 | 4.213988 |
69715e08-b61f-43f3-8259-e2cdff3082e2 | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p02580/p02580_num1_parsed.cpp | #include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
int main() {
int H, W, M;
cin >> H >> W >> M;
vector<int> row_count(H, 0);
vector<int> col_count(W, 0);
unordered_set<long long> targets;
for (int i = 0; i < M; i++) {
int h, w;
cin >> h >> w;
... | ALGO | 0.999933 | 4.507779 |
62c0c9d8-7a08-46bb-9ebf-3062cb711d1e | DragonKrissash/Competitive-Programming | Misc/B_Uppercase_and_Lowercase.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
#define X first
#define Y second
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string word;cin>>word;
int up=0;int lo=0;
for(int a=0;a<word.length();a++){
if(isupper(word[a]))
up+=1;
... | ALGO | 0.999423 | 5.479007 |
7e80d023-3547-438a-9454-3e25eab9bb81 | Neha2109/CPP_Programs | double_linked_list/append_last_k.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node* prev;
node(int val)
{
data=val;
next=NULL;
prev=NULL;
}
};
void insertAtTail(node* &head,int val){
node* n = new node(val);
if(head==NULL){
head=n;
re... | ALGO | 0.999887 | 3.798885 |
3f2a6292-c576-47f1-94a6-225ed1967b9b | faradayin/jz | 斐波那契数列.cpp | /*
大家都知道斐波那契数列,现在要求输入一个整数n,
请你输出斐波那契数列的第n项(从0开始,第0项为0)。
n<=39
*/
#include <vector>
#include <string>
using namespace std;
class Solution {
public:
int Fib[40] = {0};//局部自动变量,只要初始化列表存在,即使没有在列表中的部分也会被初始化填充0
int Fibonacci(int n) {
if(Fib[n] != 0) return Fib[n];
if(n == 0)
{
Fib[n] = 0;
... | ALGO | 0.999114 | 4.239838 |
d67d372a-0c3f-430f-b1d7-a618c2162a1a | ebbll/goorm-algorithm | 10-binary-search/ex01.cpp | /* 방 탈출하기 */
#include <iostream>
#include <vector>
#include <algorithm>
int N, M;
std::vector<int> A;
int B;
int in;
int main(void) {
std::cin.tie(NULL);
std::ios::sync_with_stdio(false);
// 입력
std::cin >> N;
for (int i = 0; i < N; ++i) {
std::cin >> in;
A.push_back(in);
}
std::sort(A.begin(), A.end());
... | ALGO | 0.999971 | 5.015738 |
b88e7ded-d1ac-4ccb-9545-405acf71ef2d | iamishansharma/Placement-Preparation | DSA/GeeksForGeeks/DSA-Self-Paced/Greedy/Max length chain.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct val{
int first;
int second;
};
int maxChainLen(struct val p[],int n);
int main() {
// your code goes here
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
val p[n];
for(int i=0;i<n;i++)
... | ALGO | 0.999795 | 5.363785 |
62cbb5f4-86f3-49e4-bde4-8aee279876f3 | zztiswb116/LLHP | projects/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp | // UNSUPPORTED: c++98, c++03
// <queue>
// template <class InputIterator>
// priority_queue(InputIterator first, InputIterator last,
// const Compare& comp, container_type&& c);
#include <queue>
#include <cassert>
#include "MoveOnly.h"
int main()
{
int a[] = {3, 5, 2, 0, 6, 8, 1};
const ... | TEST | 0.964807 | 5.169687 |
5903655b-d7bb-48d4-b346-aeee4e086b04 | WSU-4110/budgie | 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 |
e8eb4bce-3aa2-4cfa-b714-1d793104fb50 | Mostafizur21/UVA-Accepted-Solution | 11764.cpp | /**********Accepted***********/
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int test_case,total_number,input[50],high_jump,low_jump,i,j,k,n;
while(scanf("%d",&test_case)!=EOF)
{
n=1;
for(i=1;i<=test_case;i++)
{
high_jump=0;
low_jump... | ALGO | 0.998692 | 3.226737 |
4a136bea-5e3f-43d8-939f-b9bbc685d4d1 | ishandutta2007/codeforces | tute7627/normal/1086/C.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) fo... | ALGO | 0.999995 | 3.810481 |
43990a3c-0d7f-4930-9d4b-4df38a2f91f6 | manikanta2901/ubuntu | .history/practice/cpp/Leetcode/Cpp/AddTwoNumbers_20210308204002.cpp | #include<bits/stdc++.h>
using namespace std;
struct ListNode{
in
};
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
return l1;
}
};
int main(){
return 0;
} | ALGO | 0.999627 | 5.683272 |
99557c2f-72b4-45c1-a78c-6adc53b24017 | aryan2909/DSA | patterns/pattern2.cpp | // display pattern like:
// 111
// 222
// 333
#include<iostream>
using namespace std;
int main(){
int n;
cout<<"enter number of rows and coloumns: ";
cin>>n;
int i=1;
while(i<=n){
int j=1;
while(j<=n){
cout<<i;
j=j+1;
}
cout<<endl;
... | ALGO | 0.999638 | 3.462327 |
4fb17889-a25d-4c9c-8a33-9055f19ffb73 | GengxinLiu/SWMP | Predict/OBBcalculation/SourceCode/symmetry/Intersection/Wm5IntrLine3Cylinder3.cpp | #include "Wm5MathematicsPCH.h"
#include "Wm5IntrLine3Cylinder3.h"
namespace Wm5
{
//----------------------------------------------------------------------------
template <typename Real>
IntrLine3Cylinder3<Real>::IntrLine3Cylinder3 (const Line3<Real>& line,
const Cylinder3<Real>& cylinder)
:
mLine(&line),
... | ALGO | 0.997377 | 6.370897 |
743c41f3-e884-4c42-b891-77431ace5bb5 | blackhole6/algorithm-code | 个人自用资料/ACM/DP/状压dp/HDU-3538-A sample Hamilton path.cpp | #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#define Inf 0x3f3f3f3f
const int maxn=1e5+5;
typedef long long ll;
using namespace std;
int Map[25][25];
int n,m;
ll dp[1<<21][20];
ll f[25];
int main(... | ALGO | 0.999964 | 3.478885 |
842d3dfc-b87e-4e07-bd5e-aefe719cb071 | Rostyslav0402/flutter_labs | 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 |
c15a37b1-a98f-421d-8fc1-0d245769ec91 | ishandutta2007/codeforces | ivan100sic/normal/571/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
int n, m;
basic_string<int> occ[200005], cyc;
basic_string<pair<int, int>> st;
bool satis[200005];
int sol[200005];
basic_string<pair<int, int>> e[200005];
bool vis[200005], inst[200005];
void ... | ALGO | 0.999985 | 3.739765 |
ae93ec4f-f031-4650-8d4c-351dcedb4419 | batsalee/Baekjoon_Programmers | 프로그래머스/0/120880. 특이한 정렬/특이한 정렬.cpp | #include <vector>
#include <algorithm>
std::vector<int> solution(std::vector<int> numlist, int n) {
sort(numlist.begin(), numlist.end(),
[n](const auto& a, const auto& b)
{
if(std::abs(a - n) == std::abs(b - n)) return a > b;
else return std::abs(a - n) < std::abs(b - n)... | ALGO | 0.999962 | 5.95015 |
8844efdc-2e57-467e-b438-cc56e790bb21 | KISHANsingh0001/Supream_2.0_DSA_by_CODE_help | 20_Binary Search Tree/02_Binary Search Tree Class-02/BST Class 2 code/lcaBST.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
//base case... | ALGO | 0.999978 | 6.073447 |
27ca7e03-d936-4794-ab88-702b8c3a3d06 | Safwan-Ibrahim/CPP | Phase 02/Class 3/Problem Of Class 3/Count_the_Multiples_of_3.cpp | // Created on: 2025-01-28 12:11
// Author: Safwan_Ibrahim
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int nn = 1e5 + 7;
struct STL {
#define lc (node << 1)
#define rc ((node << 1) + 1)
int lazy[4 * nn];
array<int, 5> T[nn * 4];
inline void push(int... | ALGO | 0.998884 | 4.779158 |
d76834b0-3279-43d5-8ac0-a85911be5749 | hynseok/algorithm | legacy/boj/17298.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int Arr[1000004];
int ret[1000004];
stack<int> s;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin>>N;
memset(ret,-1,sizeof(ret));
for(int i=0;i<N;i++)
{
cin>>Arr[i];
while(s.size()&&Arr[s.top()]... | ALGO | 0.999998 | 4.570659 |
b1128f47-fadf-4919-858a-b0d428d29139 | xzqiaochu/cpp | problem/MFOJ/graph/connection/B.cpp | //珍珠 AC
#include <cstdio>
const int MAXN = 105;
bool gra[MAXN][MAXN];
int h[MAXN], l[MAXN];
int main()
{
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= m; i++)
{
int from, to;
scanf("%d%d", &from, &to);
gra[from][to] = true;
}
for (int k = 1; k <= n; k++)
... | ALGO | 0.999883 | 3.489231 |
e28b306e-fe80-47f6-ab5f-89d34852c32e | ishandutta2007/codeforces | jiangly/normal/1721/E.cpp | #include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::string s;
std::cin >> s;
int n = s.length();
std::vector<int> fail(n + 10 + 1);
fail[0] = -1;
std::vector<std::array<int, 26>> f(n + 10 + 1);
f[... | ALGO | 0.999978 | 5.235201 |
2f3e1cba-5aa0-4a74-8b2e-293a7a7df346 | wangliyangleon/leetcode | LongestValidParentheses.cpp | // https://oj.leetcode.com/problems/longest-valid-parentheses/
class Solution {
public:
int longestValidParentheses(string s) {
if (0 == s.length()) {
return 0;
}
int max = 0;
vector<int> lvlen_vec(s.length(), 0);
for (int i = s.length() - 2; i >= 0; --i) {
... | ALGO | 0.998969 | 5.970166 |
01b7d529-ab2d-470f-bd98-e1c8b7dcb8cd | alexandraback/datacollection | solutions_2692487_1/C++/Hogan/pA.cpp | #include<cstdio>
#include<algorithm>
int T, A, n, con[100];
int Min(int a, int b){return a<b ?a:b;}
int main(){
freopen("A-large.in", "r", stdin);
freopen("A-large.out", "w", stdout);
scanf("%d", &T);
for (int F=0; F<T; F++){
scanf("%d%d", &A, &n);
for (int i=0; i<n; i++) scanf("%... | ALGO | 0.999622 | 3.316956 |
7cf9855b-40d1-4de3-a1ac-d84455d01ef4 | NiteshKG/coding_questions_practice | B_pattern.cpp | // B pattern
#include <bits/stdc++.h>
#include<vector>
using namespace std;
int main() {
int n;
cout<<"Enter value of n : \n";
cin>>n;
cout<<"\n\n";
for(int i=1;i<=n;i++){
// for(int s=1;s<=(n-i);s++)
// cout<<" ";
for(int p=1;p<=n;p++){
if(i==1 || p== n || i == (... | ALGO | 0.999808 | 3.706337 |
9d72bed6-c686-44c6-8a25-a329038c5030 | andreaswanninger/Kratos_conservative_levelset-contact_line | applications/PfemFluidDynamicsApplication/custom_constitutive/fluid_laws/temperature_dependent/newtonian_temperature_dependent_2D_law.cpp | // System includes
#include <iostream>
// External includes
// Project includes
#include "custom_constitutive/fluid_laws/temperature_dependent/newtonian_temperature_dependent_2D_law.h"
#include "includes/checks.h"
#include "pfem_fluid_dynamics_application_variables.h"
namespace Kratos
{
//**********************... | TOOL | 0.952167 | 5.246428 |
368dc8a9-4787-4279-982b-d5df763f10cc | Game-Frag/game-frag-coin | src/llmq/quorums_connections.cpp | #include "llmq/quorums_connections.h"
#include "evo/deterministicmns.h"
#include "llmq/quorums.h"
#include "net.h"
#include "tiertwo/masternode_meta_manager.h" // for g_mmetaman
#include "tiertwo/net_masternodes.h"
#include "validation.h"
#include <vector>
namespace llmq
{
uint256 DeterministicOutboundConnection(co... | ALGO | 0.994469 | 7.407025 |
0c771291-2456-4ceb-b096-83d5893d72a1 | Amylo-jh/baekjoon | 1000s/1181.cpp | #include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(string x, string y)
{
if(x.length() == y.length())
{
return x < y;
}
return x.length() < y.length();
}
int main()
{
int word_count;
vector <string> words = {};
string tem... | ALGO | 0.999858 | 4.54738 |
e1548f62-a909-4233-b8ec-b6f165f67ba3 | walkccc/LeetCode | solutions/136. Single Number/136.cpp | class Solution {
public:
int singleNumber(vector<int>& nums) {
int ans = 0;
for (const int num : nums)
ans ^= num;
return ans;
}
};
| ALGO | 0.999685 | 6.031394 |
ca65a24e-c7db-46fa-8849-b691c52e2ad1 | sshockwave/Online-Judge-Solutions | XJOI/Contests/660/2.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#define MOD 1000000007
using namespace std;
struct matrix{
long long a11,a12,a21,a22;
matrix operator * (matrix &b){
return (matrix){
(a11*b.a11%MOD+a12*b.a21%MOD)%MOD,(a11*b.a12%MOD+a12*b.a22%MOD)%MOD,
(a21*b.a11%MOD+a22*b.a21%MOD)%MOD,(a21*b.a12%MOD+a... | ALGO | 0.999993 | 3.916656 |
f334811b-3948-436f-a646-6dd8f8931f71 | ishandutta2007/codeforces | keyid/normal/658/B.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN=150005;
typedef pair <int,int> pii;
#define mp make_pair
#define fi first
#define sc second
priority_queue <pii,vector<pii>,greater<pii> > scr;
int a[MAXN];
bool inq[MAXN];
int main()
{
int n,k,q;
scanf("%d%d%d",&n,&k,&q);
for (int i=1;i<=n;i++) scanf... | ALGO | 0.999985 | 3.697291 |
77f52bd4-93fa-42eb-8fd2-c73f7ef85aaf | Abhisheksharma91122/DSA-on-cpp- | basic.cpp/Recursion/Rat_In_Maze/withoutExtraSpace.cpp | #include<iostream>
#include<vector>
using namespace std;
void helper(vector<vector<int>> &maze, int row, int col, string path, vector<string> &ans) { // TC : O(4^n^2)
int n = maze.size();
if (row < 0 || col < 0 || row >= n || col >= n || maze[row][col] == 0 || maze[row][col] == -1)
{
return;
... | ALGO | 0.99996 | 5.393151 |
e58d760b-093c-4dd6-8b8b-86c89c28591b | Mercycoffee12138/guess | guess01/main.cpp | #include "PCFG.h"
#include <chrono>
#include <fstream>
#include "md5.h"
#include <iomanip>
using namespace std;
using namespace chrono;
// 编译指令如下
// g++ main.cpp train.cpp guessing.cpp md5.cpp -o main
// g++ main.cpp train.cpp guessing.cpp md5.cpp -o main -O1
// g++ main.cpp train.cpp guessing.cpp md5.cpp -o main -O2
... | ALGO | 0.955235 | 3.506185 |
c18aaa5b-e732-49bb-aa21-234feebdb9e9 | kurdtkobain/TBBMalloc | src/rml/perfor/tbb_multi_omp.cpp | #include <cstddef>
#include <cstdlib>
#include <cstdio>
#include <float.h>
#include <math.h>
#include <time.h>
#include <omp.h>
#include <assert.h>
#include "thread_level.h"
#include "tbb/task.h"
#include "tbb/tick_count.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/scalable_allocator.h"
#if _WIN32||_WIN64
... | TOOL | 0.952233 | 4.619615 |
9ecafb64-f7d6-4a1f-829c-c21a9abea36d | bowman2010/Aoc2021 | AOC_Day14/main.cpp | #include <iostream>
#include "aoc2021.h"
#include "polymer.h"
using namespace std;
int main()
{
Polymer polymer(puzzlePath("day14_test1.txt"));
// Polymer polymer(puzzlePath("day14_input.txt"));
polymer.doChemistryMagic(5);
// polymer.doChemistryMagic(40);
return 0;
}
| ALGO | 0.997814 | 5.074684 |
9aa0a510-1ce9-4f3e-93e9-fee386053bbc | Mrlawmaker53/Electroshoe_Onboarding_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 |
e7358127-ea3a-4314-af31-6dcd91ed651a | bappi2097/ACM-Problem-Solving | Mahbubul Hasan Shanto/binaryToInt.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char s[100];
long long int sum=0;
scanf("%s",s);
for(int i=strlen(s)-1,j=0;i>=0;i--,j++)sum+=(int)(s[i]-'0')*pow(2,j);
cout<<sum<<endl;
return 0;
}
| ALGO | 0.999815 | 3.922964 |
768450fd-01bf-44d3-9a3d-05d93d44468d | mova/hgcal_prod_old | TrackingTools/KalmanUpdators/test/KFUpdator_t.cpp | #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
#include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
#include "DataFormats/GeometrySurface/interface/Surface.h"
#include "DataFormats/GeometrySurface/inter... | ALGO | 0.880714 | 6.101199 |
4aface75-378c-4543-8d03-7f0b0d10db15 | stellar/stellar-core | src/crypto/Curve25519.cpp | #include "crypto/Curve25519.h"
#include "crypto/CryptoError.h"
#include "crypto/SHA.h"
#include "util/HashOfHash.h"
#include <Tracy.hpp>
#include <functional>
#ifdef MSAN_ENABLED
#include <sanitizer/msan_interface.h>
#endif
namespace stellar
{
Curve25519Secret
curve25519RandomSecret()
{
Curve25519Secret out;
... | TOOL | 0.98623 | 7.52026 |
83cf4256-5b48-4df7-99fd-aee915e802cb | idlegossip/Codeforces | Educational Codeforces Round 142 (Rated for Div. 2)/test.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
ll a;
vector<ll>v;
for(int i = 0; i < n; i++){
cin>>a;
v.push_back(a)... | ALGO | 0.99789 | 3.647825 |
9fe6b439-4b00-46c9-a25d-e204ae702bc7 | Khush786Mohammad/Data-Structures-and-Algorithms | Patterns/Patterns/pattern6.cpp | #include<iostream>
using namespace std;
int main()
{
int n ;
cin>>n;
for(int i = 0 ; i<n/2 ; i++)
{
for(int j = 0 ; j<=n/2-i ; j++)
{
cout<<"*";
}
for(int space = 0 ; space < 2*i+1 ; space++)
{
cout<<" ";
}
for(int k = n/2... | ALGO | 0.999987 | 3.704951 |
cd76b008-ec91-404b-bba1-63839c067e07 | lumunge/100-days-of-code | Datastructures/PracticeProblems/LeetCodeDSI-CPSolns/validParentheses.cpp | #include<iostream>
#include<stack>
using std::stack;
using std::string;
using std::cout;
using std::endl;
/* PROBLEM STATEMENT:
* Given a string s containing '(', ')', '{', '}', '[', ']', determine if the input string
* is valid.
* Open brackets must be closed by the same type of brackets
* Open brackets must be ... | ALGO | 0.999547 | 7.209637 |
1d931a8c-276b-4ea6-b572-dd744d422802 | satooooshi/kyopro | green/abc222_d.cpp | #include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll;
const int inf = I... | ALGO | 0.999897 | 4.353828 |
bdd0e474-dd93-47ca-889a-77243ce8e8d9 | k99812/Cpp | 인프런 강의/6-M 11053/6-M 11053/11053.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n, num, len;
int main()
{
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++)
{
cin >> num;
vector<int>::iterator temp = lower_bound(v.begin(), v.begin() + len, num);
int pos = temp - v.begin();
if (v[pos] == 0) len++;... | ALGO | 0.999832 | 4.039411 |
086a89a0-d12f-4873-a398-25ebfa3637aa | xiandaicxsj/datastruct | undefine_code/legendGame2.cpp | #include<iostream>
#include<map>
#include<string>
#include<vector>
using namespace std;
string DelStr(int playerNum,int testNum,string testStr,map<string,string>&map_str);
int main()
{
int testNum=0;
cin>>testNum;
string *ret=new string[testNum];
int i=0;
int playerNum=0;
int tranferNum=0;
map<string,stri... | ALGO | 0.999114 | 3.711141 |
096f6e71-6969-435f-9f46-6daf6c7cedb6 | MuveloperDev/CMD_IncounterTable | boost_1_83_0/libs/math/example/negative_binomial_example2.cpp | // negative_binomial_example2.cpp
// Simple example demonstrating use of the Negative Binomial Distribution.
#include <boost/math/distributions/negative_binomial.hpp>
using boost::math::negative_binomial_distribution;
using boost::math::negative_binomial; // typedef
// In a sequence of trials or events
// (Berno... | ALGO | 0.975657 | 6.137424 |
71ad0735-46af-4d9a-95ce-d5514407e71e | swanandjoshi30/SPPU-Data-Structure-Assignments | Assignment_D26.cpp | #include <iostream>
using namespace std;
#define size 10
class StackExp {
int top;
char stack[size];
public:
StackExp() {
top = -1;
}
void push(char);
char pop();
int isFull();
int isEmpty();
};
void StackExp::push(char x) {
top = top + 1;
stack[top] = x;
}
char Sta... | ALGO | 0.993395 | 6.486688 |
c015f3f4-388e-4d40-8054-ee6ee12b8cab | Violet-4EverGarden/2024_campus_test | CityBank_0917/q1.cpp | //
int solution(string &S) {
int len=S.length();
int a=0,b=0,c=0,d=0;
for (int i=0;i<len;i++){
if (S[i]=='^') a++;
if (S[i]=='<') b++;
if (S[i]=='>') c++;
if (S[i]=='v') d++;
}
int m=0;
m=max(m,a);
m=max(m,b);
m=max(m,c);
m=max(m,d);
return a+b+c+... | ALGO | 0.999703 | 3.916217 |
3f93fec8-9e7f-4a0d-8f1a-cbe2b7dabbba | lzmrd/ETHRome2023 | packages/hardhat/contracts/circom2-circuits/ForumPhase/forum_cpp/fr.cpp | #include "fr.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <gmp.h>
#include <assert.h>
#include <string>
static mpz_t q;
static mpz_t zero;
static mpz_t one;
static mpz_t mask;
static size_t nBits;
static bool initialized = false;
void Fr_toMpz(mpz_t r, PFrElement pE) {
FrElement tmp;
Fr_toNormal(&tmp,... | ALGO | 0.996908 | 4.424082 |
e6c4c550-5b68-48f5-a5e0-d27bb1938e76 | renbaoshuo/OI-codes | Luogu/P1181/P1181.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, sum = 0, ans = 1, t;
cin >> n >> m;
for (int i = 0; i < n; i++) {
cin >> t;
if (sum + t > m) {
ans++;
sum = t;
} else {
sum += t;
}
}
cout << ans << endl;
re... | ALGO | 0.999993 | 4.341613 |
d10d3dd8-c75d-4d2a-950e-8de77da40dc8 | HEMAL1234/Code | cf 1093A.cpp | #include<iostream>
using namespace std;
int main() // NAHIDUL HASAN HEMAL
{
int T,n,k;
cin>>T;
while(T--)
{
cin>>n;
//k=n>>1;
k=n/2;
cout<<k<<endl;
}
return 0;
}
| ALGO | 0.999853 | 4.367453 |
5c841433-38ab-4063-9017-fb8f7af36885 | VelvetOrg/3D-Game-Engine | Project/Deps/Include/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp | #include "btStaticPlaneShape.h"
#include "LinearMath/btTransformUtil.h"
btStaticPlaneShape::btStaticPlaneShape(const btVector3& planeNormal,btScalar planeConstant)
: btConcaveShape (), m_planeNormal(planeNormal.normalized()),
m_planeConstant(planeConstant),
m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.))
{
m_... | ALGO | 0.9197 | 7.217118 |
b09bd919-ad86-410b-8412-5d84084d5eb5 | YukeshShr/recipebox | 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 |
6c9e9875-380d-4a58-8a71-b4d8ff6ab547 | raincross7/code-similarity | codes/train_code/problem150/problem150_484.cpp | #include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MAX=105;
const LL INF=1LL<<31;
LL G[MAX][MAX],A[MAX][MAX];
int V,E;
void init(int type){
for(int i=0;i<MAX;i++){
for(int j=0;j<MAX;j++){
if(type){
if(i!=j)G[i][j]=INF;
else G[i][j... | ALGO | 0.999983 | 4.232068 |
57ac4515-f126-4fbf-b0da-27cd4720c1e6 | Aditya007it/Practice-SDE-sheet | Practice SDE sheet/Day-16/LCA_BT.cpp | /************************************************************
Following is the TreeNode class structure
template <typename T>
class TreeNode {
public:
T data;
TreeNode<T> *left;
TreeNode<T> *right;
TreeNode(T data) {
this->data = data;
left =... | ALGO | 0.999996 | 5.826337 |
a97e8b82-8ec8-4eca-be69-d3312a444574 | saks-hamjain/Leetcode_solutions | 0007-reverse-integer/0007-reverse-integer.cpp | class Solution {
public:
int reverse(int x) {
int rev = 0;
while(x != 0)
{
int digit = x % 10;
if((rev > INT_MAX/10) || (rev == INT_MAX/10 && digit > 7)) return 0;
if((rev < INT_MIN/10) || (rev == INT_MIN/10 && digit < -8)) return 0;
rev = rev*10 + digit;
... | ALGO | 0.999763 | 5.859746 |
e01151b6-5c8f-4206-af5c-49c456ac81aa | sasifat18/codeforce-problem | sheet1 pR.cpp |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int y=n/365;n%=365;
cout<<y<<" years"<<endl;
int m=n/30;n%=30;
cout<<m<<" months"<<endl;
int d=n;
cout<<d<<" days"<<endl;
}
| ALGO | 0.99383 | 3.487381 |
82513436-74b2-4283-83c7-cd8316b5fdce | Dazed2808/ASD | Lab4/Lab4_1.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
void printArray(double* arr, int size) {
cout << "Array: ";
for (int i = 0; i < size; i++) {
cout << arr[i] << " ";
}
cout << endl;
}
void insertionSort(double* arr, int size) {
for (int i = 1; i < size; i++) {
... | ALGO | 0.999812 | 5.443982 |
c65424cd-549b-4e15-923f-e67f6f81cb89 | pukibopu/my-leetcode | list/203移除链表元素.cpp | #include <iostream>
struct ListNode
{
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
ListNode(int x, ListNode *next) : val(x), next(next) {}
};
class Solution
{
public:
ListNode *removeElements(ListNode *head, int val)
{
whil... | ALGO | 0.999682 | 5.350924 |
137d8036-7080-43c5-850a-95d372f876d2 | DamChan0/coding_test_by_CMake | greedy/training_clothes.cpp | // 체육복 문제
// https://school.programmers.co.kr/learn/courses/30/lessons/42862
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve) {
int answer = n - lost.size();
sort(lost.begin(), lost.end());
sort(reserve.begin(), reserve.end()... | ALGO | 0.999857 | 4.679115 |
bb3bc00c-61c9-4ad0-a20b-64cd84cb8b2a | luizfelipee7/C-language | atividades/Exercícios - While/exx001.cpp |
#include <stdio.h>
int main()
{
int nm,i=1;
printf("\t\t\t\t\t\t[TABUADA]\n\n");
printf("Escolha o numero da tabuada: ");
scanf("%d", &nm);
while(i<=10)
{
if(nm>10 || nm<1)
{
break;
}
printf("\n %d x %d = %d", i, nm, nm*i);
i++;
}
} | ALGO | 0.868611 | 3.120604 |
dba53ebf-e0eb-48dd-a0fa-821440fae090 | Mridul0911/Leetcode | 0502-ipo/0502-ipo.cpp | class Solution {
public:
int findMaximizedCapital(int k, int w, vector<int>& profits, vector<int>& capital)
{
priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>> > min;
for(int i=0;i<profits.size();i++)
{
min.push({capital[i],profits[i]});
... | ALGO | 0.999996 | 5.215649 |
80a2c532-1c8b-4082-974f-a44e1e4b3505 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1695_5.cpp | #include <bits/stdc++.h>
using namespace std;
int N, M, last;
long long dp[2005][2005][2];
bool visited[2005];
vector<int> edges[2005], a;
map<int, int> cnt;
int dfs(int v) {
visited[v] = true;
for (int u : edges[v]) {
if (visited[u]) continue;
return 1 + dfs(u);
}
return 1;
}
long long solve(int pos, i... | ALGO | 0.999863 | 4.545086 |
93067a52-5885-48cb-ae19-3d758d14599b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3734_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s; cin >> s;
map<char, int> mp;
for (char c : s) {
mp[c]++;
}
cout << (all_of(mp.begin(), mp.end(), [](pair<char, int> p){ return p.second % 2 == 0; }) ? "Yes" : "No") << endl;
} | ALGO | 0.999963 | 4.626222 |
d807a628-dc15-4c9e-b138-4fdb51e94c51 | RohitJain3241/Leetcode | DP/Medium/Maximum_Length_of_Pair_Chain.cpp | class Solution {
public:
int findLongestChain(vector<vector<int>>& pairs) {
sort(pairs.begin(),pairs.end(),[](const vector<int>& a, const vector<int>& b) {return a[0] < b[0];});
int n = pairs.size();
//This will keep the longest chain uptil i
int dp[n];
//This is the las... | ALGO | 0.99996 | 5.644873 |
cb345ebe-7ace-485b-8aaa-df8a489515f3 | ThomasKidane/Competitive_Programming | CSES_problems/twosets.cpp | #include<bits/stdc++.h>
using ll = long long;
using ld = long double;
using namespace std;
#define endl "\n";
#define ff first
#define ss second
#define forn(i,n) for(int i=0;i<n;i++)
#define dbgv(v) cout<<#v<<" "<<v<<endl
#define dbga(a,n) forn(i,n-1) {cout<<a[i]<<' ';} cout<<a[n-1]<<'\n';
void solve(){
int n;
... | ALGO | 0.9998 | 3.671575 |
ed5e0674-b665-49c8-ba85-7ec206ef391f | Sandeep-Varma/CS6004-A4 | metrics/openj9-openjdk-jdk8/omr/compiler/ras/LimitFile.cpp | #include <ctype.h>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "env/FrontEnd.hpp"
#include "compile/Compilation.hpp"
#include "compile/Method.hpp"
#include "compile/ResolvedMethod.hpp"
#include "control/Options.hpp"
#include "control/Op... | TOOL | 0.90437 | 5.941305 |
960b5b40-b732-4a03-a027-99dfc65bb5ff | syntacore/snippy | mlir/lib/Analysis/FlatLinearValueConstraints.cpp | #include "mlir/Analysis//FlatLinearValueConstraints.h"
#include "mlir/Analysis/Presburger/LinearTransform.h"
#include "mlir/Analysis/Presburger/PresburgerSpace.h"
#include "mlir/Analysis/Presburger/Simplex.h"
#include "mlir/Analysis/Presburger/Utils.h"
#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/Builders.... | ALGO | 0.974922 | 7.746735 |
49e5e771-1bf6-416d-b486-ab2216418ece | aminjonshermatov/leetcode | algorithms/KthSmallestElementInASortedMatrix/KthSmallestElementInASortedMatrix.cpp | #include "bits/stdc++.h"
using namespace std;
class Solution {
public:
int kthSmallest(vector<vector<int>>& mat, int k) {
const auto n = mat.size();
if (k == 1 || k == n * n) return mat[(k - 1) / n][(k - 1) % n];
int lo = mat[0][0], hi = mat[n - 1][n - 1];
for (; lo < hi;) {
... | ALGO | 0.99995 | 5.612414 |
521dd747-2ac6-49ac-9362-89ba8e8f4860 | sakib-mustafa-ak/Tasks | 688274G.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define Start ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define ff first
#define ss second
void solve()
{
int n, k;
cin >> n >> k;
map<int, int... | ALGO | 0.999788 | 4.217478 |
1fe6f444-1a0d-49f7-9cc7-7ceb615001d6 | twindb/twindb-xtrabackup-80 | boost_1_68_0/libs/spirit/example/qi/num_list2.cpp | ///////////////////////////////////////////////////////////////////////////////
//
// This sample demontrates a parser for a comma separated list of numbers.
// The numbers are inserted in a vector using phoenix.
//
// [ JDG May 10, 2002 ] spirit1
// [ JDG March 24, 2007 ] spirit2
//
///////////////////////////... | TOOL | 0.971196 | 6.696555 |
63dde9e8-2da9-4f45-82a2-53987e9a3a5c | Ddelval/Competitive-programming | Uva/10895__Matrix Transpose.cpp | // 10895__Matrix Transpose.cpp
// Created by David del Val on 03/08/2021
//
//
// https://github.com/Ddelval/Competitive-programming/blob/master/template.cpp
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#ifdef DEBUG
#de... | ALGO | 0.999786 | 3.515087 |
a91de3f0-0d84-4422-8b9d-5caf3e6d786b | Tunahaha/LeetCode_TopInterview150 | 2024/07/12/167. Two Sum II - Input Array Is Sorted/solution.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& numbers, int target) {
int n = numbers.size();
int left=0;
int right = n-1;
vector<int> res;
while(left<right){
if (numbers[left]+numbers[right]==target){
res.push_back(left+1);
... | ALGO | 0.999972 | 6.366774 |
33999491-874b-4693-8499-ff2e53f82067 | deoliaman00/LEETCODE-SOLUTIONS | 367-valid-perfect-square/367-valid-perfect-square.cpp | class Solution {
public:
bool isPerfectSquare(int num)
{
// {
// if(num==1) return true;
// long long int sum=0;
// int n=1;
// for(;n<num;n++)
// {
// sum+=n;
// if(num==sum)
// {
// return true;
// ... | ALGO | 0.999917 | 5.456188 |
ade2ad88-b6f6-4275-b9f2-11ea74c37601 | silence0201/iOS-Reverse | Obfuscator/Source/lib/Support/StringExtras.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
/// StrInStrNoCase - Portable version of strcasestr. Locates the first
/// occurrence of string 's1' in string 's2', ignoring case. Returns
/// the offset of s2 in s1 or npos if s2 cannot ... | TOOL | 0.899973 | 6.803111 |
ffe33065-e52f-4cdf-9a55-ba375e01139c | PavanNettam/The-LeetCode-GFG-Repo | 543-diameter-of-binary-tree/543-diameter-of-binary-tree.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.999956 | 6.62229 |
db0223df-f766-4a38-b45a-234b4e2dbbcb | ishan-akhouri/theorem-prover | tests/test_clause.cpp | #include <iostream>
#include <cassert>
#include "../src/resolution/clause.hpp"
#include "../src/term/term_db.hpp"
using namespace theorem_prover;
void test_literal_creation() {
std::cout << "Testing literal creation..." << std::endl;
// Test positive literal
auto atom_p = make_constant("P");
Lite... | TEST | 0.922929 | 7.728964 |
cf11e595-f8f1-4034-a250-6ec7a343681a | jayysuthar/Competitive-Programming-Practice | codechef/Vaccine Dates.cpp | //---------------------------------------------------------------------------------------
//-------------------Author : itsjaysuthar ----------------------------------------------
//---------------------------------------------------------------------------------------
#include<bits/stdc++.h>
using namespace std;
int... | ALGO | 0.999855 | 3.676982 |
d709b11a-3571-40a1-a04c-dccbf3bdd8f7 | Moazgamal/LeetCode-Problems | 3329-find-the-length-of-the-longest-common-prefix/3329-find-the-length-of-the-longest-common-prefix.cpp | class Solution {
class trie
{
public :
static const int MAX_CHAR=10;
trie* child[MAX_CHAR];
trie(){
memset(child,0,sizeof(child));
}
void insert(string str, int indx=0)
{
if(indx ==(int)str.size())
return ;
... | ALGO | 0.999898 | 5.587457 |
ec86ecd6-3f83-449e-aa86-98cd163b9e51 | crimsonme/UE4.25 | UnrealEngine-release/Engine/Plugins/Experimental/MeshModelingToolset/Source/ModelingOperators/Private/SmoothingOps/IterativeSmoothingOp.cpp | #include "SmoothingOps/IterativeSmoothingOp.h"
#include "Async/ParallelFor.h"
FIterativeSmoothingOp::FIterativeSmoothingOp(const FDynamicMesh3* Mesh, float Speed, int32 Iterations) :
FSmoothingOpBase(Mesh, Speed, Iterations)
{
SmoothedBuffer = PositionBuffer;
}
void FIterativeSmoothingOp::CalculateResult(FProgressC... | ALGO | 0.997841 | 6.564369 |
8a508dc4-d11e-453a-802f-b8d80a59b372 | 20MH1A0590/Leetcode | Priority_Queue/Easy/leetcode1046.cpp | class Solution {
public:
int lastStoneWeight(vector<int>& stones) {
priority_queue<int>pq;
for(auto &stone : stones) pq.push(stone);
while(pq.size() > 1)
{
int x = pq.top();
pq.pop();
int y = pq.top();
pq.pop();
if(x != ... | ALGO | 0.999933 | 5.545224 |
a617ca82-361a-4b14-b70c-7f72c037999a | Pankajesc/Leetcode | 0071-simplify-path/0071-simplify-path.cpp | class Solution
{
public:
std::string simplifyPath(std::string path)
{
if (path.size() == 1)
{
return path;
}
std::string result;
std::stack<std::string> stk;
std::string temp;
for (int i = 0; i < path.size(); i++)
{
temp.cle... | ALGO | 0.99948 | 5.95659 |
abfeef3b-79ab-465c-a373-53ff90e2f8ac | tofuuuuuuu/competitive-programming | misc/purple_lemon.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
int main(){
cin.sync_with_stdio(0);
cin.tie(0);
int n, m; int w = 1000006;
cin >> n >> m;
int t[m+1];
ll value[n+1];
ll weight[n+1];
for(int i = 1; i <= m; i++) cin >> t[i];
for(int i = 1... | ALGO | 0.999995 | 4.777543 |
3a40926c-63f5-4762-8020-6cb883137166 | shaobozhong/myAcmCodes | 杨老师系统/1637Human Gene Functions.cpp | #include<stdio.h>
int stand[6][6]={
{0,0,0,0,0,0},
{0,5,-1,-2,-1,-3},
{0,-1,5,-3,-2,-4},
{0,-2,-3,5,-2,-2},
{0,-1,-2,-2,5,-1},
{0,-3,-4,-2,-1,-10000}
};
char ch;
int f[105][105];
int a[105],b[105];
int main()
{
int N,n1,n2,i,j;
scanf("%d",&N);
while(N--)
{
scanf("%d%c",&n1,&ch);
for(i=1;i<=n1;i++)
{
... | ALGO | 0.998906 | 3.009653 |
1afd568b-d060-4fba-8710-7ec76d28e113 | alexandraback/datacollection | solutions_5744014401732608_1/C++/Candice/C.cpp | //
// Created by Yuxiang LI on 09/04/16.
//
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int T;
long long B,M,MM;
vector<int> factor(100);
vector<vector<int> > g(100);
/*bool dfs(int i, int j){
if (i == B - 1){
if (ways[B-1] == M)
return true;
else
... | ALGO | 0.999617 | 4.584838 |
f30fdbf6-fce1-4722-b788-aa2bb4ffdf6b | liudonghua123/suyu | src/shader_recompiler/frontend/maxwell/translate/impl/predicate_set_register.cpp | #include "common/bit_field.h"
#include "common/common_types.h"
#include "shader_recompiler/frontend/maxwell/translate/impl/common_funcs.h"
#include "shader_recompiler/frontend/maxwell/translate/impl/impl.h"
namespace Shader::Maxwell {
void TranslatorVisitor::PSET(u64 insn) {
union {
u64 raw;
BitFie... | ALGO | 0.93616 | 7.167657 |
9e04cb25-48cc-4ab6-91ac-d11c09ad571c | AlexSheldrick/ObjectDetectionRandomForests | ObjectDetectionAndClassification/opencv/sources/samples/cpp/tutorial_code/ImgProc/morph_lines_detection/Morphology_3.cpp | /**
* @file Morphology_3(Extract_Lines).cpp
* @brief Use morphology transformations for extracting horizontal and vertical lines sample code
* @author OpenCV team
*/
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>
void show_wait_destroy(const char* win... | TOOL | 0.975686 | 5.082594 |
27d5ae85-0b5b-4af7-bd49-b1dae8cd3d30 | sdycxx2279/myAlgorithm | 11.cpp | //
//@author Xiao Xu
//@create 2018-05-02 17:36
//Container With Most Water
//
#include<iostream>
#include <vector>
using namespace std;
class Solution {
public:
int maxArea(vector<int>& height) {
int max_area = 0, temp_area = 0, i = 0, j = height.size()-1;
while(i < j){
int h = heigh... | ALGO | 0.999889 | 6.212141 |
080966c4-557e-4610-9a1f-2b308f7314ca | ishandutta2007/codeforces | fattypenguin/normal/135/C.cpp | #include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queu... | ALGO | 0.99999 | 3.190575 |
fa88a4dd-af5b-4362-8ed2-e072d6853c0b | hebohang/HEngine | Engine/Source/ThirdParty/bullet3/src/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.cpp |
#include "b3GpuGridBroadphase.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#include "kernels/gridBroadphaseKernels.h"
#include "kernels/sapKernels.h"
//#include "kernels/gridBroadphase.cl"
#include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h"
#include "Bullet3OpenCL/ParallelPrimitives/b3LauncherCL.h"
#define B3_BROADPHA... | ALGO | 0.949186 | 6.475483 |
c78f003c-c82b-479c-a0a4-827fb8a9518d | MahdiAkhbar/factorial | app/main.cpp |
#include <iostream>
#include <stdlib.h>
#include "Foo.h"
int factorial(int n)
{
unsigned int sum{1};
for (int i = 1; i <= n; i++) {
sum *= i;
}
return sum;
}
int main()
{
std::cout << 5 << "! = " << factorial(5) << '\n';
std::cout << 0 << "! = " << factorial(0) << '\n';
std::cout << 9 << "! = " <<... | ALGO | 0.910342 | 4.304401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.