uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0ef3cc41-d50d-4fe6-8dbb-c273f57af41d | Himanshu07-debug/POTD | Leetcode/May/14_may.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;
#define endl '\n'
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX >> 1;
const long long NINF = LLONG_MIN;
struct node{
int data;
node* le... | ALGO | 0.999421 | 5.396411 |
14ae063f-a8a7-4c9c-939d-0c378632fd7d | JKSL12/cppchat | boost_1_83_0/libs/spirit/classic/phoenix/example/fundamental/sample8.cpp | #include <vector>
#include <algorithm>
#include <iostream>
#define PHOENIX_LIMIT 5
#include <boost/spirit/include/phoenix1_operators.hpp>
#include <boost/spirit/include/phoenix1_primitives.hpp>
#include <boost/spirit/include/phoenix1_composite.hpp>
#include <boost/spirit/include/phoenix1_special_ops.hpp>
#include <boo... | TOOL | 0.861944 | 5.155582 |
f92aaf7c-223a-43cc-9720-503abf48b2e2 | Ongtrumxadoan/Cautrucdulieu-vutrongphuongnopro | CTDL>_Tail_Recursion.cpp/CTDL>_Exponential_Recursion/CTDL>_Exponential_Recursion_1.cpp | void dayNhiPhan(int i, int n, int *X)
{
int val; // val l cc gi tr? c th? gn cho cc v? tr trong x
for (val = 0; val < 2; val++) // val c th? nh?n hai gi tr? l 0 v 1
{
X[i] = val;
if (i == (n-1)) // n?u i l ph?n t? cu?i c?a dy
{
int j;
for(j ... | ALGO | 0.999929 | 3.074767 |
d2a78064-fb18-4cb5-b340-1688fef6dd59 | codestream/algorithms | cpp/BinaryPow.cpp | #include <iostream>
using namespace std;
int pow(int a, int b, int MOD) {
int res = 1;
for (; b > 0; b >>= 1) {
if (b & 1)
res = (long long) res * a % MOD;
a = (long long) a * a % MOD;
}
return res;
}
int main() {
const int MOD = 1000000007;
int x = pow(2,... | ALGO | 0.999383 | 4.76784 |
fdbc02e0-f81e-42e9-acd9-c4f442a30dc1 | DaeeYong/algorthim | BaekJooN/15649.cpp | #include <iostream>
using namespace std;
int arr[10];
bool isused[10];
int n, m;
//k개의 숫자를 선택했을 때, arr[k]를 결정하는 함수
//0-based idx
void func(int k){
//base condition
if(k == m){
for(int i = 0; i < m; i++) cout << arr[i] << ' ';
cout << '\n';
}
for(int i = 1; i <= n; i++){
if(!i... | ALGO | 0.999932 | 4.319073 |
058e779f-c581-4272-8147-cf48ae6e4299 | Seyamalam/Codeforces | 1500+++/1506a-strangetable.cpp | #include <cstdio>
typedef long long ll;
int main(){
ll t; scanf("%lld", &t);
while(t--){
ll n, m, x; scanf("%lld %lld %lld", &n, &m, &x);
--x;
ll row = x % n;
ll col = x / n;
ll res = row * m + col + 1;
printf("%lld\n", res);
}
}
| ALGO | 0.999715 | 3.912587 |
8cab07ae-de4d-4d4a-9721-0e3f18dafc77 | LoganJoe/training-data | 2018.9/2018.09.15/tour.cpp | #include<bits/stdc++.h>
#define N 20005
int n,m,A[N],f[12][60000],ecnt,head[N],vis[N],deep[N],ans=0;
int po[12];
struct edge
{
int v,next;
}e[N<<2];
void add(int u,int v)
{
e[++ecnt]={v,head[u]};head[u]=ecnt;
}
int getbit(int S,int k){return (S/po[k])%3;}
void dfs(int u,int dep)
{
vis[u]=1,deep[u]=dep;
for(int s=0;... | ALGO | 0.999912 | 3.880046 |
56f0a739-e50f-4877-9264-f624e49c12f9 | tangxiangru/NOIP | 3.9/priority_queue练习题.cpp | #include <iostream>
#include <queue>
#include <bitset>
using namespace std;
bitset<3200> tab;
int getNum(int k){
int num = 0;
for(int j = 2; j < 3200 && j < k; j++){
if(tab[j] == 0 && k % j == 0){
while(k % j == 0)
k /= j ;
num ++ ;
if(k == 1) break ;
}
}
if(k == 1)
return num;
else if(num == 0)
return 0;
else
return... | ALGO | 0.999724 | 3.278095 |
7cc4d610-d1b9-4e7b-883c-9f681aabee28 | samgiz/Competitive_Programming | Codeforces/Christmas Spruce.cpp | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
typedef int def; //default parameter for loops
#define fori(a) for(def i=0; i<(a); i++)
#define forii(a, b) for(def i=(a); i<(b); i++)
#define forj(a) for(def j=0; j<(a); j++)
#define forjj(a, b... | ALGO | 0.999864 | 3.817785 |
43f5fa3d-69e6-4c77-a433-4718eab2c801 | Hamim-200/DSA | DAY_2_STL_Vector/vector_erase.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// For Multiple Value
vector<int> v = {10, 20, 30, 40, 50};
v.erase(v.begin() + 1, v.begin() + 3);
for (int x : v)
{
cout << x << " ";
}
// FOR one value dELETE
// vector<int> v={10,20,30,40,50};
// v.erase(v.begi... | ALGO | 0.976402 | 3.832173 |
d123487e-b7b4-467f-9e24-e22a95fb2dbf | TeogopK/Data_Structures_and_Algorithms_FMI | Exams/exam_03/bonus/solution_inorder_rewrite.cpp | // We can not return the result with one inorder traversal,
// because the height of right subtree is still unkown at the time of print
int dfs(TreeNode *root, const int depth)
{
if (!root)
{
return 0;
}
int left_depth = dfs(root->left, depth + 1);
int right_depth = dfs(root->right, depth + ... | ALGO | 0.999869 | 5.853321 |
9ce97830-bfb2-4ae9-a978-48e2565456b4 | mamaevads/miptalgo2015 | Company.cpp | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void dfs(int v, const vector<vector<int>>& g, vector<bool>& used, vector<int>* order) {
used[v] = true;
for (int to : g[v])
if (!used[to])
dfs(to, g, used, order);
if (order)
order->push_back(v);
}
int getAnsw... | ALGO | 0.999935 | 4.967209 |
a7e9072e-4ce5-448d-8f33-ad65eb79691a | Shreyanshsingh23/leetcode-GFG | 3501-delete-nodes-from-linked-list-present-in-array/delete-nodes-from-linked-list-present-in-array.cpp | /**
* Definition for singly-linked list.
* 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* modifiedLis... | ALGO | 0.999974 | 5.76097 |
641b0322-9b2b-42b7-a717-47431a4df758 | RionKV/CSES | repetitions.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
long long n = s.length();
if(n == 1) {
cout << 1;
}
else {
long long ans = 0;
long long cnt = 1;
for(int i = 0; i<n-1; i++) {
if(s[i] == s[i+1]) {
cnt++;
... | ALGO | 0.999936 | 3.796843 |
20bae034-f9c7-46c5-a81b-24d6cc48efa3 | JZY-Revival/JZY-Revival | dep/g3dlite/source/stringutils.cpp | /**
@file stringutils.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2000-09-09
@edited 2008-01-10
*/
#include "G3D/platform.h"
#include "G3D/stringutils.h"
#include "G3D/BinaryInput.h"
#include <algorithm>
namespace G3D {
#ifdef _MSC_VER
// disable: "C++ exception handler used"
... | TOOL | 0.966689 | 6.713766 |
735be6df-8602-4f94-8ff5-931d13a5c722 | P0L3NARUBA/roblox-2016-source-code | CSG/sgCore/Core/NURBS/NRB_ARC.cpp | #include "../sg.h"
//spline must be APPR!!!!
//----------------------------------------------------------------->>>>>>>>>>>>>
static void create_NURBS_line(lpSPLY_DAT sply, sgFloat *v1, sgFloat *v2);
static BOOL create_NURBS_arc( lpSPLY_DAT sply_dat, sgFloat *center, sgFloat *Ort_X,
sgFloat *Ort_Y, sgFl... | ALGO | 0.992661 | 3.214336 |
ebf72b27-c671-4dfd-b918-3d375d6c8996 | Shreyaspatil2310/GFG | Difficulty: Hard/Edit Distance/edit-distance.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int editDistance(string s, string t) {
vector<vector<int>> dp(s.size()+1,vector<int>(t.size()+1,INT_MAX-1));
for(int i=0;i<=s.size();i++){
for(int j=0;j<=t.size... | ALGO | 0.999985 | 6.636869 |
81345684-6195-43e3-aa28-70d225903edc | Wisc-HCI/authr | authr_pddl/paradiseo/mo/test/t-moNeighborhoodStat.cpp | #include <continuator/moNeighborhoodStat.h>
#include <continuator/moMaxNeighborStat.h>
#include <continuator/moMinNeighborStat.h>
#include <continuator/moNbInfNeighborStat.h>
#include <continuator/moNbSupNeighborStat.h>
#include <continuator/moNeutralDegreeNeighborStat.h>
#include <continuator/moSecondMomentNeighborSta... | TEST | 0.946885 | 5.414034 |
94af6f9a-f8e7-46d8-b6df-9bc40addb71c | Tylder/soliton_engine | extern/Simd/src/Simd/SimdAvx512bwBFloat16.cpp | #include "Simd/SimdMemory.h"
#include "Simd/SimdStore.h"
#include "Simd/SimdBFloat16.h"
namespace Simd
{
#ifdef SIMD_AVX512BW_ENABLE
namespace Avx512bw
{
void Float32ToBFloat16(const float* src, size_t size, uint16_t* dst)
{
size_t size32 = AlignLo(size, 32);
__mmask... | ALGO | 0.889577 | 6.215442 |
a8bdb302-4f44-4f4a-8853-2a9baa0c1977 | maeri-project/FEATHER | LayoutLoop/layoutloop/src/workload/density-models/hypergeometric-distribution.cpp | #include <bitset>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/math/distributions/hypergeometric.hpp>
#include <iostream>
#include <exception>
#include <boost/math/special_functions/binomial.hpp>
#include "workload/density-models/hypergeometric-distribution.hpp"
... | ALGO | 0.940433 | 6.435229 |
6dded91e-cd1c-4f09-8163-e7c92960aaba | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2650_17.cpp | #include <bits/stdc++.h>
long long l, r;
int K;
int main() {
scanf("%I64d%I64d%d", &l, &r, &K);
if (K == 1) {
printf("%I64d %d %I64d\n", l, 1, l);
return 0;
}
std::map<long long, long long> map;
std::vector<long long> out;
out.push_back(l);
long long answer = l;
for (int i = 0; i <= std::min(r -... | ALGO | 0.999868 | 3.657811 |
033e0de7-195f-44de-af83-dd6956f74f6d | nunu111/lab26_Containers | lab26_3.cpp | #include<iostream>
#include<set>
using namespace std;
//Write function count() here.
int count(int array[],int array_size){
int a=0;
set<int> sint;
for(int i=0;i<array_size;i++){
sint.insert(array[i]);
}
set<int>::iterator j;
for(j=sint.begin();j !=sint.end();j++){
a++;
}
return a;
}
int main(){
int da... | ALGO | 0.998429 | 4.243428 |
d7e8e9ef-7417-41a4-91b9-06e9875bee5f | Jatinthakur0202/gfg | Medium/Minimum times A has to be repeated such that B is a substring of it/minimum-times-a-has-to-be-repeated-such-that-b-is-a-substring-of-it.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
class Solution {
public:
bool issubstring(string str2, string rep1)
{
int M = str2.length();
int N = rep1.length();
// Check for substring from starting ... | ALGO | 0.999877 | 5.797538 |
e3e15342-49cb-41b8-b749-2e04e3cb9b8f | ishandutta2007/codeforces | jonathanirvings/normal/131/C.cpp | //Codeforces Beta Round #95
//25 Nov 2011
//start of jonathanirvings' template v1.1.0 (BETA)
#define jonathan using
#define ganteng namespace
#define banget std
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <deque>
#include <string>
#include <string.h>
#include <vector>
#inc... | ALGO | 0.999949 | 4.250788 |
19fa692a-91ef-462a-95a9-2c31c46502b3 | ziab/cali | src/cali/Terrain.cpp | #include "Terrain.h"
#include <IvUniform.h>
#include <IvResourceManager.h>
#include <IvTexture.h>
#include "CommonFileSystem.h"
#include "CommonTexture.h"
#include <vector>
#include "World.h"
#include "DebugInfo.h"
namespace cali
{
float lerp(float a, float b, float f)
{
return a + f * (b - a);
}
double get_... | TOOL | 0.975241 | 4.897351 |
9c23d707-00c7-41b3-a95f-1e824ab7819a | Little-W/model_upper_computer | control/src/comm.cpp | #include "comm.h"
#include "pid.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
/// @brief 打表代码:使用polynomial生成CRC-8的所有计算结果
/// @param polynomial 指定生成多项式
void GenerateCrc8Table(uint8_t polynomial)
{
uint8_t crc=0;
uint16_t i,j;
for(j = 0;j<256;j++)
{
if(!(j%... | TOOL | 0.979779 | 3.313327 |
bd7e6c4e-80d7-4ec4-a4ef-00e12a990604 | gt-retro-computing/llvm-I8080 | libcxx/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp | // <random>
// template<class RealType = double>
// class fisher_f_distribution
// template<class _URNG> result_type operator()(_URNG& g);
#include <random>
#include <cassert>
#include <vector>
#include <algorithm>
#include <cmath>
#include "test_macros.h"
double fac(double x)
{
double r = 1;
for (; x > 1;... | TEST | 0.970533 | 4.490033 |
94ed8a4d-7f08-4ac2-8900-d1b6ece975c2 | raychow/LeetCode | C++/Combinations.cpp | class Solution
{
public:
vector<vector<int>> combine(int n, int k)
{
vector<vector<int>> result;
if (n < 1 || k < 1)
{
return result;
}
vector<int> indexes;
for (int i = 1; i <= k; ++i)
{
indexes.push_back(i);
}
whil... | ALGO | 0.999972 | 5.972631 |
67ae1d09-1954-4a78-922a-33a9ed4e0f24 | mrifat1/Competitive-Programming | CP 2018-19/string codeforces.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str,str2;
int i,sum,sum2,flag,c;
cin>>str>>str2;
int len1;
len1=str.size();
for(i=0;i<len1;i++)
{
if(str[i]>='A' && str[i]<='Z')
str[i]=str[i]+32;
if(str2[i]>='A' && str2[i]<='Z')
str2[i]... | ALGO | 0.999986 | 3.423612 |
a160140b-645f-4cdb-959a-a79ab54bdbd4 | JaredYe04/CppProgramingExercises_A1 | 发奖金.cpp | // 发奖金.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include<iomanip>
using namespace std;
int main()
{
int val;
cin >> val;
double bonus=0;
if (val <= 100000)
{
bonus = val * 0.1;
}
else if (val > 100000 && val <= 200000)
{
bonus = 10000 + (val - 100000)... | ALGO | 0.987311 | 4.317417 |
c18270ea-18b5-47cb-a35f-87cc6b13485f | Vadman97/ROS-Workspace | clm_bridge/lib/3rdParty/dlib/include/dlib/test/least_squares.cpp | #include <dlib/optimization.h>
#include "optimization_test_functions.h"
#include <sstream>
#include <string>
#include <cstdlib>
#include <ctime>
#include <vector>
#include "../rand.h"
#include "tester.h"
namespace
{
using namespace test;
using namespace dlib;
using namespace std;
using namespace dl... | TEST | 0.850335 | 7.21871 |
7945fb74-7c3d-4177-84b3-7dcf1728922b | morris821028/UVa | volume128/12815 - Taking the Stairs.cpp | #include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <string.h>
#include <assert.h>
#include <map>
using namespace std;
int main() {
int testcase;
int H, W, N, x, y;
scanf("%d", &testcase);
while (testc... | ALGO | 0.999599 | 3.518468 |
f6e5ddb5-af4a-4a02-b59b-7b4d5c05cea2 | TRANMINHBIBO/DSA | BackTracking/Bai13_SoXaCach.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n , a[102] , check[102];
bool check1(int cnt)
{
for(int i = 1 ; i < cnt ; i++)
{
if(abs(a[i] - a[i - 1]) == 1)
{
return false;
}
}
return true;
}
void QL(int cnt)
{
if(cnt == n && check1(cnt... | ALGO | 0.999809 | 3.667471 |
c36392f4-7e88-40b8-bd85-898efc2899ca | Hiyabye/Baekjoon | 11xxx/11402.cpp | #include <iostream>
#include <vector>
using namespace std;
long long power(long long base, long long exp, long long mod) {
long long ret = 1;
while (exp) {
if (exp & 1) ret = ret * base % mod;
base = base * base % mod;
exp >>= 1;
}
return ret;
}
long long solve(void) {
long long n, k, m; cin >> ... | ALGO | 0.999995 | 4.695463 |
05c65a89-39f5-40eb-b482-b251f307e156 | algoamigoo/Leetcode | 334-increasing-triplet-subsequence/increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int low = INT_MAX, mid = INT_MAX;
for (int num : nums) {
if (num <= low)
low = num;
else if (num <= mid)
mid = num;
else
return true;
}
... | ALGO | 0.999961 | 6.103845 |
e7539910-eea5-4d08-b2e9-acad6fd18350 | rafaelGuasselli/exercicios | judges/vjudge/topicos_2/lista_7/a.cpp | #include<bits/stdc++.h>
using namespace std;
int matrix[100][100];
int dominator[100][100];
int marked[100];
int nTests;
int nVertices;
string input;
void dfs(int vertice, int blocked){
if (vertice == blocked) {
return;
}
marked[vertice] = 1;
if (blocked != -1) {
dominator[blocked][vertice] = 0;
}
for... | ALGO | 0.993446 | 4.721921 |
6b4084a0-38d0-466c-9dd9-b88077b2c36f | powder2005/etohari | vnoi/voi18queue.cpp | #include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
using pld = pair < ld, ld >;
using point = pair < ld, ld > ;... | ALGO | 0.999974 | 5.226518 |
6536e7f0-696e-48a2-b1b1-afc16c84d5d4 | ishandutta2007/codeforces | c_sunshine/normal/375/B.cpp | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
int n,m,ans;
char a[5005][5005];
int line[10005];
int lt[10005],rt[10005];
int st[10005],top;
int del(int p)
{rt[lt[p]]=rt[p];lt[rt[p]]=lt[p];}
int add(int p)
{
lt[p]=lt[n+1];
rt[p]=n+1;
rt[lt[... | ALGO | 0.999966 | 3.623197 |
b505a507-3804-400c-bd64-1f8fbe1759b1 | reyes115/flutter | Flutter_main/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.998614 | 6.797341 |
b5e2f669-187d-47c1-aa50-6695c231b9d7 | alexandraback/datacollection | solutions_2705486_0/C++/AekdyCoin/CC.cpp | #include<vector>
#include<list>
#include<map>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include<bitset>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<iostream>
#include<sstream>
#include<iomanip>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<str... | ALGO | 0.999784 | 3.752714 |
34b1a806-cb78-4599-bacf-b8204e007db2 | singlarohan/leetcode_sol | 1171-shortest-path-in-binary-matrix/2023-03-06 16.49.54 - Accepted - runtime 78ms - memory 21.9MB.cpp | class Solution {
public:
int shortestPathBinaryMatrix(vector<vector<int>>& grid) {
vector<int> delRow = {-1,-1,-1,0,0,1,1,1};
vector<int> delCol = {-1,0,1,-1,1,-1,0,1};
if(grid[0][0] == 1) return -1;
int m = grid.size(), n = grid[0].size();
vector<vector<int>> dis(m, vector<i... | ALGO | 0.999992 | 6.031158 |
4e185f18-c64d-4666-93d6-184e19782b25 | ishandutta2007/codeforces | brovko/normal/1342/D.cpp | #include <bits/stdc++.h>
//#define int long long
#define ld long double
#define y1 sdopgh
using namespace std;
int n, k, a[200005], b[200005], c[200005], x[200005];
vector <int> v[200005];
int32_t main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("name.in", "r", stdin);
/... | ALGO | 0.999984 | 3.553616 |
105fe384-db8c-4074-9031-3c9f8863c8b1 | lichkkkk/LeetCode_G-C | 1619-MeanOfArrayAfterRemovingSomeElements/solution.cpp | class Solution {
public:
double trimMean(vector<int>& arr) {
sort(arr.begin(), arr.end());
int offset = arr.size() / 20;
double res = 0;
for(auto it = arr.begin() + offset; it < arr.end() - offset; it++) {
res += *it;
}
return res /= (arr.size() - offset *... | ALGO | 0.999347 | 5.857755 |
273e4a2a-7a94-4533-82cf-8390869ab3a5 | sankiteth/AlgoLab | Week3_CGAL/Problems/almost-antenna/almost_antenna.cpp | #include <CGAL/Exact_predicates_exact_constructions_kernel_with_sqrt.h>
#include <CGAL/Min_circle_2.h>
#include <CGAL/Min_circle_2_traits_2.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
// typedefs
typedef CGAL::Exact_predicates_exact_constructio... | ALGO | 0.999596 | 5.198559 |
63692dd1-0552-43ca-ab93-9110467746ae | sabeelkhan99/networks | networks/drailfincypher.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
// ios::sync_with_stdio(false);
// cin.tie(0);
// cout.tie(0);
int t,n,m,i,j,k,sum=0;
string s;
cout<<"Enter the message to decrypt"<<'\n';
cin>>s;
cout<<"Enter key"<<'\n';
cin>>n;
vector<vec... | ALGO | 0.999971 | 3.680728 |
ec1afa68-c7d4-482e-8eff-b6ae82cac578 | ahsai001/simpletools-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.998693 | 6.797273 |
cf104295-f63f-408c-b184-cdef3718278d | xmg2024/Leetcode-Solutions | 1001-1500/1275-Find-Winner-on-a-Tic-Tac-Toe-Game/cpp-1275/main.cpp | /// Source : https://leetcode.com/problems/find-winner-on-a-tic-tac-toe-game/
/// Author : liuyubobobo
/// Time : 2021-05-22
#include <iostream>
#include <vector>
using namespace std;
/// Simulation
/// Time Complexity: O(|moves|)
/// Space Complexity: O(1)
class Solution {
public:
string tictactoe(vector<vect... | ALGO | 0.999787 | 6.618047 |
729aa401-cfc9-4f5d-83e2-8caa12328afa | mataiyuan/ASD-SLAM | src/3rd_party/eigen_catkin/eigen-eigen-b9cd8366d4e8/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.996866 | 6.263251 |
d7a18223-6f87-497e-960c-4ba814fce869 | moqsad/solved-problems | UVA/10341 - Solve It.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
int main()
{
int i;
double p, q, r, s, t, u, a, b, c, mid;
while(scanf("%lf %lf %lf %lf %lf %lf", &p, &q, &r, &s, &t, &u) == 6)
{
a = p*exp(0) + r*cos(0);
b = p*exp(-1)+ q*sin(1) + r*... | ALGO | 0.999951 | 3.343426 |
12874825-1ba3-4596-94ff-6bf99eb7c5b0 | ChakrabortyRajarshi2005/Codeforces | A. Cover in Water.cpp | A. Cover in Water
time limit per test1 second
memory limit per test256 megabytes
Filip has a row of cells, some of which are blocked, and some are empty. He wants all empty cells to have water in them. He has two actions at his disposal:
1
— place water in an empty cell.
2
— remove water from a cell and place it in ... | ALGO | 0.999959 | 4.596028 |
989b6444-8120-4a9d-b57f-735dcb9e43c9 | Hosssein/RS | TFIDFRetMethod.cpp | #ifndef _TFIDFRETMETHOD_CPP
#define _TFIDFRETMETHOD_CPP
#include "TFIDFRetMethod.h"
#include "Param.hpp"
#include <cmath>
#include "Index.hpp"
#include "IndexManager.hpp"
#include "DocUnigramCounter.hpp"
#include "RelDocUnigramCounter.hpp"
using namespace lemur::api;
using namespace lemur::retrieval;
bool MF;
static i... | ALGO | 0.99725 | 4.643034 |
33ff7c27-3306-43ed-865a-e5a77c2f6558 | PeizeLin/abacus-develop_ab_bak | source/module_hamilt_general/module_surchem/H_correction_pw.cpp | #include <cmath>
#include "module_base/constants.h"
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_hamilt_general/module_xc/xc_functional.h"
#include "surchem.h"
ModuleBase::matrix surchem::v_correction(const UnitCell& cell,
const Modu... | ALGO | 0.97298 | 5.311895 |
082647af-6264-44e3-a534-fd218f6662af | Nirmakaya/CPP-DSA | CircularLinkedlist.cpp | #include<iostream>
using namespace std;
//Circular linked List : When the last node is pointing to the first one.
class node{ //Structure Of Circular linked list
public:
int data;
node* next;
node(int val){
data=val;
next=NULL;
}
};
void insertAthead(node* &... | ALGO | 0.99984 | 4.28726 |
dae4cacd-e48b-4e3c-b2ff-e8418753e179 | LoadGhost810/cpp | CPP_testings/linear_search.cpp | #include <iostream>
using namespace std;
int lin(int array[],int size,int searchValue){
for (int i = 0;i<size;i++){
if (searchValue == array[i]){
return i;}
}
return -1;
}
int main(){
int a[] = {15,23,7,45,87,16};
//user input
int userValue;
cout<<"Enter nu to search:... | ALGO | 0.994575 | 4.57164 |
7e3a6afd-0d52-46b8-8e3f-9bf8ab71d2e5 | yenluu2506/CODEOFLUU | OOP/A-OOPF2/bai9-gop2daykhonggiam.cpp | #include <iostream>
using namespace std;
//int main() {
// int a[100], b[100], c[100];
// int n, m;
// cin >> n;
// for (int i = 0; i < n; i++) {
// cin >> a[i];
// }
// cin >> m;
// for (int i = 0; i < m; i++) {
// cin >> b[i];
// }
// int size = 0;
// int i = 0, j = 0;
// while (i < n && j < m) {
// if (a[i] < b[... | ALGO | 0.999988 | 3.568937 |
cc4907a0-191f-4c5f-834d-34a4e21d42f1 | vivek-30/cp-and-dsa-zone | AlgoZenith/DP_WorkShop_Vivek_Gupta/Dp_Practice/CSES/2.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf 2e18
#define minf -2e18
#define mod 1000000007
#define int long long int
#define ld long double
#define all(v) v.begin(), v.end()
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typ... | ALGO | 0.999953 | 4.021588 |
39ee82ef-ffbb-4479-b424-ab121f615248 | Pat-da-Morrissey/CS21 | 21-6/disjoint_set.cpp | /*
Patrick Morrissey pmorriss <EMAIL>
disjoint_set.cpp - Assignment 06 (Maze Generation with Union Sets)
*/
#include <iostream>
#include "disjoint_set.h"
DisjointSet::DisjointSet(int n) {
curr_sets = n;
for(int i = 0; i < n; ++i) {
MakeSet(i);
}
}
DisjointSet::~DisjointSet() {}
void D... | ALGO | 0.985472 | 4.678556 |
7f936252-1b04-4320-958a-d7b05d44f876 | BobiSimeonov/DevStylerProjects | homework/homework13/homework13/homework13.cpp | # include <iostream>
# include <vector>
# include "book.h"
# include "BookServices.h"
using namespace std;
// koito da izvejdat nai-evtina/nai-skapa kniga
int main()
{
vector<Book> books;
int number_of_books = 0;
cout << "Enter the amount of books you want to add: ";
cin >> number_of_books;
BookService bs;
for... | TOOL | 0.872517 | 5.055584 |
7bb57f13-50b9-4aeb-b038-7c07c12f187e | alaminmiah4274/Data_Structure | stl_vector/vector_find.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int> numbers = {45, 78, 97, 15, 31, 10};
auto it = find(numbers.begin(), numbers.end(), 10);
if (it != numbers.end())
{
cout << "Found" << endl;
}
else
{
cout << "Not Found" << endl;
}
return 0;
} | ALGO | 0.998146 | 4.652154 |
b0c36b67-54a4-433e-94f0-4fa082070493 | chun1000/problem-solving | source/old/cpp/BOJAlgorithm/22Y03M/10995.cpp | //별찍기
#include <iostream>
#include <ios>
#include <vector>
#include <string>
using namespace std;
void use_boj_io() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
//백준 전용 입출력 속도 개선
int N;
//풀이에 사용하는 변수
void input() {
cin >> N;
}
//입력
void solve() {
string stars = "";
for (int i = 0; i < N; ... | ALGO | 0.999936 | 4.042114 |
e9c47401-6fc8-4515-be76-3d7dbd895d59 | Alan-Lee123/POJ | Data Structure/1177.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <cmath>
#include <string>
#include <set>
#include <cstdlib>
#include <ctime>
using namespace std;
struct line
{
int a, b, h;
bool up;
line() {}
line(int a, int b, int h, bool u) : a(a), b(b), h(h), ... | ALGO | 0.997528 | 3.720397 |
a2c36c61-b82d-47a3-86d9-d24c25c71a75 | eduard-permyakov/peredvizhnikov-engine | src/worker_pool.cpp | export module sync:worker_pool;
import tls;
import lockfree_deque;
import lockfree_queue;
import shared_ptr;
import assert;
import atomic_bitset;
import platform;
import logger;
import concurrency;
import <coroutine>;
import <optional>;
import <array>;
import <string>;
import <thread>;
import <vector>;
namespace pe{... | TOOL | 0.869279 | 7.206491 |
60035624-ff57-4429-aa58-7f2b9a60028d | C0ldSmi1e/CompetitiveProgramming | Contests/Codeforces-CodeforcesRound706Div.2/C.DiamondMiner.cpp | /**
* Author: Daniel
* Created Time: 2021-03-11 23:32:05
**/
// time-limit: 1000
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ER erase
#define IS insert
#define PI acos(-1)
#define PB pop_back
#define EB emplace_back
#define lowbit(x) (x & -x)
#define SZ(x) ((int)x.size()... | ALGO | 0.999884 | 4.00776 |
87d370a4-ebba-48b6-94a9-44976a1a0c97 | bybCodeClub/CPP | trees/binary_tree_tilt.cpp | #include <iostream>
using namespace std;
// using Post-Order DFS
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
int help(TreeNode* root, int &ans){
if(root == nullptr) return 0;
int left = help(root->left, ans);
int ri... | ALGO | 0.999942 | 6.139418 |
d9044ce3-edbc-4810-8a96-38d87fd1e93b | PratikshaRK/OOPs | Notes with Code/54_polymorphism(pointer to derived class).cpp | #include <iostream>
using namespace std;
// late binding: here we dicide which display funciton is run in runtime according to the pointer type
class BaseClass
{
public:
int var_Base;
void display()
{
cout << "Displaying Base class variable var_base " << var_Base << endl;
}
};
class DerivedCla... | TOOL | 0.917265 | 6.092235 |
7de91300-2a64-4650-b62b-15916c5eb3d1 | agusaldasoro/tc-2016 | Dia1/D.cpp | #include <iostream>
#include <set>
#include <functional>
#include <queue>
using namespace std;
int main(){
int n;
while(cin >> n){
if(n == 0) break;
set<unsigned long long> aSet;
aSet.insert(1);
int i = 0;
while(i < n-1){
unsigned long long min = *(aSet.beg... | ALGO | 0.999985 | 4.112205 |
b233a990-6fde-4a89-89c4-8a48bc9fc96f | RAGHIBRIZWAN/CPP | CPP LABS/Lab1/Task1.cpp | #include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter a number: " << endl;
cin >> num;
if (num < 2) {
cout << "Not a prime number" << endl;
return 0;
}
for (int i = 2; i <= num / 2; i++) {
if (num % i == 0) {
cout << "It is not a pri... | ALGO | 0.994569 | 3.955992 |
e70f804c-5a8b-4342-b7a4-533d9ce87129 | Gumball0456/cp_solutions | codeforces/A_Second_Order_Statistics.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
int main(){
int n; cin >> n;
vector<int> arr;
set<int> st;
while(n--){
int el; cin >> el;
if(st.count(el) == 0){
st.insert(el);
arr.push_back(el);
}
}
... | ALGO | 0.999951 | 4.504428 |
e00ed334-32d5-48bf-b021-c80abfdc9527 | juliaperdigao/university-projects | C and C++/volleyball game.cpp | #include<bits/stdc++.h>
using namespace std;
class Jogador;
class Time{
protected:
string nome;
Jogador* jogador[7];
//0-levantador 1-libero 2,3-meia 4,5-ponta 6-oposto
public:
Time(){
}
Time(string nome, Jogador* levantador, Jogador* libero, Jogador* meia1, Jogador* meia2, Jogador* ponta1, Jogador* ponta2, Jog... | TOOL | 0.908969 | 3.910813 |
d31d3d58-4261-4938-8ba4-80ec56d57726 | ishandutta2007/codeforces | flowerletter/normal/1738/C.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// freopen("in.txt", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(0);
int T;
for(cin >> T; T; T --) {
int n;
cin >> n;
vector<int> a(n), cnt(2);
vector<vector<array<array<int, 2>, 2>>> f(n + 1, vector<array<array<int, 2>, 2>> (n + 1));
for... | ALGO | 0.999987 | 4.673481 |
457fe076-8aef-48a2-b228-187a903b017f | sradl1981/LIGGGHTS-PUBLIC-ParScale | lib/gpu/lal_dipole_lj_ext.cpp | /***************************************************************************
dipole_lj_ext.cpp
-------------------
Trung Dac Nguyen (ORNL)
Functions for LAMMPS access to dipole/cut acceleration routines.
_______________________... | TOOL | 0.963262 | 5.349128 |
624069bd-6f04-4afd-9f91-44b4dc7833d6 | aqeel-baloch12/-Data-Structures-and-Algorithms | insertion at spcific array.cpp | #include<iostream>
using namespace std;
int main()
{
int array[10],n,pos,x;
cout<<"enter size of array:"<<endl;
cin>>n;
cout<<"enter array element:"<<endl;
for(int i=0;i<n;i++)
{
cin>>array[i];
}
cout<<"enter insertion position location:"<<endl;
cin>>pos;
cout<<"value to insert:"<<endl;
cin>>x;
for(int i=... | ALGO | 0.999815 | 3.384313 |
37674860-073f-4f68-a734-248a1e1b7279 | a8k-lab/data-structure | test-assessment-clo1/driver.cpp | #include "driver.h"
void createList(List &L) {
first(L) = nil;
last(L) = nil;
}
address allocate(infotype Elm) {
address newElm = new ElmList;
info(newElm) = Elm;
next(newElm) = nil;
prev(newElm) = nil;
return newElm;
}
void insertLast(List &L, address P) {
if (first(L) == nil) {
... | ALGO | 0.99567 | 3.925557 |
d2f6c760-0eee-40ff-b065-dcb75f89f1f8 | VRaj361/DataStructure | Recursion/Selectionsort.cpp | #include<iostream>
using namespace std;
void selection(int *arr,int r,int c,int max){
if(r==0){
return ;
}
if(c<r){
if(arr[max]<arr[c]){
selection(arr,r,c+1,c);
}else{
selection(arr,r,c+1,max);
}
}else{
swap(arr[max],arr[r-1]);
sele... | ALGO | 0.999993 | 3.708239 |
32f3a413-001e-4878-9abd-9807902be352 | medosha249/ROS_Diploma | C++/STL/Sequence/Deque/Deque.cpp | #include <iostream>
#include <deque>
#include <algorithm>
int main()
{
std::deque<int> d = {1, 3, 5, 7, 8, 10, 2, 9, 4, 6};
auto it = d.cbegin();
std::sort(d.begin(), d.end());
for (it; it != d.cend(); ++it)
{
std::cout << *it << " ";
}
std::cout << std::endl;
d.resize(15);
... | ALGO | 0.999104 | 5.546742 |
6f23a154-be97-42e9-9216-66b17800e207 | menna1261/Leet-code-solutions | 1038-binary-search-tree-to-greater-sum-tree/1038-binary-search-tree-to-greater-sum-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.999876 | 5.424368 |
d3499d09-11e1-4320-8f9d-1685526af645 | JaeHyoNi/BackJoon | code_race/4.cpp | #include <bits/stdc++.h>
using namespace std;
int arr[2][500000];
bool jum(char A,char B){
if(A>B) swap(A,B);
if(A=='l' && B=='l') return true;
if(A=='o' && B=='o') return true;
if(A=='x' && B=='x') return true;
if(A=='s' && B=='s') return true;
if(A=='z' && B=='z') return true;
if(A=='n' &&... | ALGO | 0.999682 | 3.570875 |
1b450665-0a2e-4870-8a42-454be9246e12 | wszk1992/LeetCode-Team | Codes/Yangkun Huang/Tree/110. Balanced Binary Tree.cpp | bool isBalanced (TreeNode* root) { // 直接return height
return balancedHeight (root) >= 0; // return 子树是否平衡可以?
}
int balancedHeight (TreeNode* root) { // postorder
if (root == nullptr) // NULL= nullptr
return 0;
int left = balancedHeight (root->left);
int right = balancedHeight (root-... | ALGO | 0.999478 | 4.541615 |
7f6709f0-62d5-4db8-9b0b-26976b96b5c6 | T1duS/CompetitiveProgramming | Olympiad/Baltic/21-xanadu.cpp | // --------------------------------------------------<TEMPLATE>--------------------------------------------------
// --------------------<optimizations>--------------------
/*
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx,avx2,fma")
*/
// -------------------</optimizations>--------------------
/... | ALGO | 0.999873 | 4.118761 |
5c050b8f-d343-4202-8c81-9e0423732c7c | abhaygupta08/Hacktober-2022 | codechef/closetoleft.cpp | #include<bits/stdc++.h>
using namespace std;
int getcloseleft(int *arr,int n,int val){
int lo=-1,hi=n;
while(hi-lo>1){
int mid=(lo+hi)>>1;
if(arr[mid]>=val){
hi=mid;
}
else{
lo=mid;
}
}
return hi;
}
int main(){
int n,k,val;
cin>>n>>... | ALGO | 0.999993 | 4.204958 |
70852e2b-2efb-41bc-a652-326e945e33bd | sing-dance-rap-basketball/leetcode | zxq/cpp/162-find-peak-element.cpp | /*
* @lc app=leetcode id=162 lang=cpp
*
* [162] Find Peak Element
*/
/*
√ Accepted
√ 59/59 cases passed (4 ms)
√ Your runtime beats 96.86 % of cpp submissions
√ Your memory usage beats 82.96 % of cpp submissions (8.5 MB)
*/
class Solution {
public:
int findPeakElement(vector<int>& nums) {
... | ALGO | 0.999768 | 5.575456 |
4535953b-bf0d-48d8-8ec8-5210551b7060 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3587_28.cpp | #include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
ios::sync_with_stdio(0);
solve();
return 0;
}
const long long KInf = 100000000000000LL;
const int KMax = 2;
int N, M;
long long sum[KMax][KMax];
long long dp[KMax][KMax];
void solve() {
cin >> N >> M;
for (int i = 0; i < N; i++) {
fo... | ALGO | 0.999982 | 3.941469 |
da6a9fdd-4b88-476d-a9d5-289abf23ca7e | Mumeikawaiii/University-C | w7_hw-1/w7_hw-1.cpp | #include <iostream>
#include<math.h>
using namespace std;
bool is_prime(int num)
{
/*******************
is_prime(int)->boll
ex:
is_prime(2)-> true
is_prime(97)->true
is_prime(10)->false
********************/
int temp;
if (num == 2) return true;
for (int counter = 2; counter <... | ALGO | 0.999092 | 3.771793 |
429ef05f-50dd-4fe2-9bc1-b80c77c7abc9 | prateek-guwalani/Placement-Guru | temp/ah4pmcq.cpp | #include <stdio.h>
int main()
{int a,b,c;
scanf("%d%d",&a,&b);
c=a+b;
printf("%d",c);
return 0;
}
| ALGO | 0.981382 | 3.208195 |
cfb8a3a4-0ffc-4719-86ce-ddddd9f76a4f | hakjun2/codetree-TILs | 240711/별 찍는 것을 5번 반복하기/repeat-shooting-the-stars-five-times.cpp | #include <iostream>
using namespace std;
void PrintStar(){
for(int i = 0 ; i <10 ; i++){
cout << "*";
}
cout << endl;
}
int main() {
for(int j = 0 ; j < 5 ; j++){
PrintStar();
}
// 여기에 코드를 작성해주세요.
return 0;
} | ALGO | 0.992833 | 3.353266 |
1801b33b-29e5-4ffb-ac29-8771ac0b6ce1 | parthosarothi46/Introduction-to-CPP-for-DSA | Module 2.5/M_Capital_or_Small_or_Digit.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char X;
cin >> X;
if (X >= 48 && X <= 57 )
{
cout << "IS DIGIT" << endl;
}
else
{
if (X >= 65 && X <= 90)
{
cout << "ALPHA" << endl;
cout << "IS CAPITAL" << endl;
}
else... | ALGO | 0.988901 | 3.199027 |
9aeebb6a-2469-4f06-9e63-c77118dc13c7 | RodrigoRossetti/URI-OJ | Volume 25 (2500 - 2599)/2556/2556.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
while (cin >> n) {
vector<int> v(n);
for (int i = 0; i < n; i++)
cin >> v[i];
sort(v.begin(), v.end());
cout << n/2 << " " << v[n/2] - v[n/2-1] << endl;
}
return 0;
} | ALGO | 0.997662 | 3.496434 |
0e04bb52-fcb2-4bc6-8aa2-c38dee92c180 | dangbach3107/PTIT_cpp | quayvongdayso-1.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define el '\n'
#define F(i, a, b) for(int i = a; i < b; i++)
#define pb push_back
#define fast() ios_base::sync_with_stdio(0); cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define MAXN 1000005
int main(){
fast();
int t; cin >> t;
... | ALGO | 0.999803 | 3.300483 |
e6443247-c3a9-4f42-badf-5ef97815ff81 | rushi19383/Leetcode-daily | 729-my-calendar-i/729-my-calendar-i.cpp | class MyCalendar {
public:
vector<pair<int,int>>calendar;
MyCalendar() {
}
bool book(int start, int end) {
for(auto [s, e]:calendar)
if(max(s,start) < min(e, end)) return false;
calendar.push_back({start, end});
return true;
}
};
/**
* Your MyCale... | ALGO | 0.999783 | 6.142322 |
357df1a4-7686-44b9-bfd8-562b56e57ba5 | ruturajch/Code | NeetCodeGraphs/1584MinCostToConnectAllPoints.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int minCostConnectPoints(vector<vector<int>> &points)
{
int n = points.size();
vector<pair<int, int>> adjList[n];
for (int i = 0; i < n; i++)
{
for (int j = i + 1; j < n; j++)
... | ALGO | 0.999942 | 5.386927 |
6470a052-625e-4fc7-95b4-821942fb36b9 | Henrik-Yao/NEUQ-ACM-Solution | week3/贺达/双周赛/7-2.cpp | #include<bits/stdc++.h>
using namespace std;
void hlt(int n,string a,string b,string c)
{
if(n==1)
{
cout<<a<<"->"<<c<<endl;
}
else
{
hlt(n-1,a,c,b);
cout<<a<<"->"<<c<<endl;
hlt(n-1,b,a,c);
}
}
int main()
{
int n;
cin>>n;
string a,b,c;
cin>>a>>b>... | ALGO | 0.999982 | 3.970567 |
424af544-c1d3-4f1f-9320-bdb35a8383d2 | gawd-gamer/cp_codes | 0-1_BFS.cpp | #include<bits/stdc++.h>
using namespace std;
const int INF=INT_MAX;
int n;
vector<int> d(n, INF);
vector<vector<pair<int,int>>>adj(n);
void bfs(int s){
d[s] = 0;
deque<int> q;
q.push_front(s);
while (!q.empty()) {
int v = q.front();
q.pop_front();
for (auto edge : adj[v]) {
int u ... | ALGO | 0.999298 | 3.034274 |
be5c77da-b7ba-4960-a90d-d4174fb3ab3e | nathimike102/leetcode_solutions | 200-number-of-islands/number-of-islands.cpp | class Solution {
public:
void helper(vector<vector<char>>& grid, int i, int j) {
if (i < 0 || i >= grid.size() || j < 0 || j >= grid[0].size() ||
grid[i][j] == '0') {
return;
}
grid[i][j] = '0';
helper(grid, i + 1, j);
helper(grid, i - 1, j);
... | ALGO | 0.999989 | 6.987617 |
2852257f-4d91-4515-ac35-2c0eca3815bd | tnsgud/AlgorithmsWithCpp | src/baekjoon/string/2908.cpp | //
// Created by qkrtn on 2021-12-27.
// Link : https://www.acmicpc.net/problem/2908
#include <iostream>
#include <string>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int out[2];
string in[2];
cin >> in[0] >> in[1];
for (int i = 0; i < 2; ++i) {
... | ALGO | 0.999563 | 3.311879 |
a1a07575-0029-47c6-a656-f5ff8b9cdd74 | pavelsimo/ProgrammingContest | uva/11804_Argentina/P11804.cpp | /* @BEGIN_OF_SOURCE_CODE */
/* @JUDGE_ID: 11804 C++ "Brute Force" */
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cstring>
using namespace std;
#define FOR(i,x,y) for(int i=(int)(x);i<=(int)(y);++i)
#define REP(i,n) FOR(i,0,n-1)
#define FORD... | ALGO | 0.998453 | 4.875683 |
8a933e65-d8b7-49a6-8cb1-79e2c874d341 | AkashSingh3031/Striver-SDE-Sheet-Challenge | 01]. Day-1 (Arrays)/CodeStudio/5]. Sort an array of 0’s 1’s 2’s.cpp | #include <bits/stdc++.h>
void sort012(int *arr, int n)
{
// Write your code here
int low = 0, mid = 0, high = n-1;
while(mid <= high) {
switch(arr[mid]) {
case 0:
swap(arr[low++], arr[mid++]);
break;
case 1:
mid++;
... | ALGO | 0.999609 | 4.957054 |
6c8e6819-c3aa-49e1-b554-f62b5666272f | Ritik-Kumar01/Leetcode | 0104-maximum-depth-of-binary-tree/0104-maximum-depth-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.99959 | 6.442711 |
f54e8b10-f08c-460d-b8ce-3d481ce87862 | vishaljoshi2020/C-_codes | c++_volume.cpp | #include<iostream>
using namespace std;
class volume
{
public:
int l;
int b;
int h;
int vol(int l=0,int b=0,int h=0 )
{
return l*b*h;
}
};
int main()
{
volume b1;
volume b2;
cout<<b1.vol(2,5,6)<<endl;
cout<<b2.vol(3,5,6);
return 0;
} | TOOL | 0.862886 | 3.615215 |
e92edc2b-2956-4b59-8722-78e7635c4bb4 | DaDaMrX/Sophomore | Algorithm/DP或贪心 (最小点覆盖集-贪心2).cpp | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 1500 + 10;
const int M = 1500 + 10;
struct Edge
{
int to, next;
} edge[2 * M];
int adj[N], no;
void init()
{
memset(adj, -1, sizeof(adj));
no = 0;
}
void add(int u, int v)... | ALGO | 0.999752 | 4.157943 |
10412a5b-fc1f-4581-b6b9-abbadef57d98 | jindalabhay2003/CSES_Solutions | Introductory Problems/Weird_Algo.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repl(i,a,b) for(ll int i=a;i<b;i++)
#define vil vector<ll int>
#define vvil vector<vector<ll int>>
#define pil pair<ll int,ll int>
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x)... | ALGO | 0.999983 | 3.995296 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.