uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b9cb4b35-843c-4e59-a074-9fc95d2fa958 | AhmedSarg/CppVs | ProblemSolving/Contests/BFCAI STL2(Map,Set)/Chat Order/Chat Order/Source.cpp | #include <bits/stdc++.h>
#define AhmedSarg ios_base::sync_with_stdio(false),cout.tie(NULL),cin.tie(NULL)
#define ll long long
using namespace std;
bool cmp(pair<string, int>& p1, pair<string, int>& p2) {
return p1.second > p2.second;
}
int main() {
AhmedSarg;
int n;
cin >> n;
map<string, int>m;
... | ALGO | 0.999967 | 3.99566 |
d3d4c78d-81b0-469c-be6a-9b74c40be47e | rishigithub001/Data-Structures | C prgm Fact of a num.cpp | #include <stdio.h>
#include <conio.h>
int main()
{
int i, num;
printf("Enter a number: ");
scanf("%d", &num);
int factorial = 1;
for (i = 1; i <= num; i++)
{
factorial *= i;
}
printf("The factorial of %d is %d\n", num, factorial);
return 0;
}
| ALGO | 0.997958 | 3.795456 |
a9473364-c56d-4930-91a9-f8988ff51e63 | Vimal2710/Vimal_Cpp | p 18. decimal to octal.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b,count=0;;
cin>>a;
int a1=a;
while(a>0)
{
b=a%8;
count=count+1;
a=a/8;
}
int j,c[count];
int i=0;
while(a1>0)
{
b=a1%8;
c[i]=b;
a1=a1/8;
i++;
}
for(j=count-1;j>=0;j--)
{
cout<<c[j]<<" ";
}
return 0;
}
| ALGO | 0.99982 | 3.104342 |
f71bd3e8-8fd3-471b-b3df-01d20055bf82 | AmarShukla1/Competitive-Programming | Desktop/C.P/Sublime Text 3/programs/find_maximum_1600_rated.cpp | //Tonight's the night and it is going to happen again and again.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define T ll t; cin>>t; while(t--)
#define mod 1000000007
#define mem(name,val) memset(name,val,sizeof(name))
#define f(n) for(ll i = 0;i<n;i++)
#... | ALGO | 0.999963 | 4.22353 |
157107de-ffac-477c-9178-a83ebaa4113b | ishandutta2007/codeforces | greencis/normal/373/B.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <fstream>
#include <cstdio>
#include <string>
#include <cmath>
#include <vector>
#include <stack>
#include <cstdlib>
#include <iomanip>
using namespace std;
char p[25];
long long cnt(long long a) {
if (a == 0) return 1;
long long q = 0;
... | ALGO | 0.999583 | 3.376265 |
e56f86b0-9436-48c5-978a-76e40e05f5a7 | alifalhasan/CP-code-vault | Codeforces/Codeforces Round/Codeforces Round 616 (Div. 2)/D - Irreducible Anagrams/139473098.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
template<typename temp>using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistics_node_update>;
//order_of_key(k) ... | ALGO | 0.999949 | 4.467041 |
59ec9164-6e48-412d-8a26-cc5b69e3b89e | sxu39/TP-RPMD | lammps-stable_2Aug2023_update2/src/npair_halffull_newtoff.cpp | #include "npair_halffull_newtoff.h"
#include "error.h"
#include "my_page.h"
#include "neigh_list.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
NPairHalffullNewtoff::NPairHalffullNewtoff(LAMMPS *lmp) : NPair(lmp) {}
/* ------------------------------------... | ALGO | 0.992926 | 5.512198 |
f2ca851b-77eb-4cf0-b43c-90c87f993353 | kwakukbaryeh/Parallel | asst3/examples/sqrt.cpp | /**
* sqrt: calculate the square root of a set of random numbers
*
* Usage: sqrt numberOfProcessors
*
*/
#include <math.h>
#include <omp.h>
#include <stdio.h>
#include <sys/time.h>
#define MAXNUMBER 8
struct gm_t {
int Index; /* Used by processors to find out which input to take */
double input[MAXNUMBER]; ... | ALGO | 0.999976 | 4.120123 |
90756ab6-6fc2-423d-b08a-a3e2e982e752 | vivekprojects-GIT/DSA | 48_0-1 Knapsack Problem/Ideal Solutions/zeroOneKnapsack.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[2005][2005]; // using dp array to store values of overlapping sub-problems, also we are using top-down recursive approach
int zeroOneKnapsack(int N, int W, int value [], int weight []) {
// helper function to calculate the maximum value of knapsack
if(N <= 0... | ALGO | 0.999982 | 4.630148 |
0c73fdd4-a770-40e6-b750-17913c6a2f61 | shadowfax11/pbrt | pbrt-v3-dvs/src/core/reflection.cpp | // core/reflection.cpp*
#include "reflection.h"
#include "spectrum.h"
#include "sampler.h"
#include "sampling.h"
#include "interpolation.h"
#include "scene.h"
#include "interaction.h"
#include "stats.h"
#include <stdarg.h>
namespace pbrt {
// BxDF Utility Functions
Float FrDielectric(Float cosThetaI, Float etaI, Floa... | ALGO | 0.995439 | 7.821028 |
aa01c594-0205-4f2c-b6d6-cdf18fa91f1b | thegamer1907/Code_Analysis | contest/1542584749.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9+7;
#ifndef M_PI
const double M_PI = acos(-1.0);
#endif
int stat[100*10001][4];
int main(){
int n, k;
cin>>n>>k;
for(int i=0; i<n; ++i){
for(int j=0; j<k; ++j){
scanf("%d", &stat[i][j]);
stat[i][j] = !stat[i... | ALGO | 0.999927 | 4.211295 |
cc9fe284-b7cb-4c37-a7ff-79a0589024a6 | Nedj/CG-Blizzlike | src/server/scripts/EasternKingdoms/boss_kruul.cpp | /* ScriptData
SDName: Boss_Kruul
SD%Complete: 100
SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back.
SDCategory: Bosses
EndScriptData */
#include "ScriptPCH.h"
#define SPELL_SHADOWVOLLEY 21341
#define SPELL_CLEAVE 20677
#def... | TOOL | 0.883717 | 6.279391 |
1b474b35-ca96-4257-8710-bbd1318674d2 | firiexp/contest_log | atcoder/ABC/073C.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
static const int INF = 1000000007;
using ll = long long;
using namespace std;
int main() {
map<int, int> m;
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
m[a]^=1;
}
int ans = 0;
... | ALGO | 0.999991 | 4.720378 |
1caa894f-518d-484c-9e5b-1ed9e351ebea | evpo/EncryptPad | deps/stlplus/portability/wildcard.cpp | ////////////////////////////////////////////////////////////////////////////////
// Simple wildcard matching function.
// WARNING: wheel re-invention follows
// Given that all shells perform wildcard matching, why don't the library writers put it in the C run-time????????
//////////////////////////////////////... | TOOL | 0.908016 | 6.502998 |
f3cbd1a5-9632-48f9-90fc-58f1a4dc1899 | Shahraaz/CP_S5 | codeforces/1493/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/debug.h"
#else
#define db(...)
#endif
#define all(v) v.begin(), v.end()
#define pb push_back
using ll = long long;
const int NAX = 2e5 + 5, MOD = 1000000007;
void solveCase()
{
int n, k;
cin >> n >> k;
string str;
cin >> str;
i... | ALGO | 0.999854 | 4.843646 |
a4fd0f51-a69c-4282-a92f-80967249d9ce | 6plosive/hkoi | J100.cpp | #include <bits/stdc++.h>
using namespace std;
void J100(){
int n;
cin>>n;
int line=n-1;
int count=1;
for(int i=0;i<n*2-1;i++){
for(int j=1;j<n-abs(line);j++){
cout<<count<<' ';
count++;
}
line--;
cout<<count<<endl;
count++;
}
}
int main(){
J100();
} | ALGO | 0.999924 | 3.530137 |
ccf341cc-9d3c-46e5-8d62-a61d244b4798 | RoseAlice2018/Algorithm2024 | 202406/0625.cpp | #include<vector>
#include<stack>
#include<queue>
#include<string>
#include<unordered_map>
#include<unordered_set>
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... | ALGO | 0.99995 | 5.910319 |
a8c23924-edfd-4166-9d89-6a9073695502 | surakuma/communication-scheuling | ExperimentalData/binpack.cpp | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <utility>
#include <cassert>
#include <limits>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <numeric>
#include <random>
#define MAXNUMBEROFTASKS 10000
#ifndef CAPACITY
#define CAPACITY 0
#endi... | ALGO | 0.999535 | 3.949888 |
0926b759-4678-4c56-8248-73678be5be9e | raincross7/code-similarity | codes/train_code/problem079/problem079_269.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
ll factorial(int i) { //階乗
if (i == 0) return 1;
return (factorial(i - 1)) * i;
}
int main() {
ll mod = 1000000007;
int n... | ALGO | 0.999992 | 4.308118 |
284e35b4-849c-4a02-99d9-5bfe5a390327 | ishandutta2007/codeforces | benq/normal/1042/E.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
typedef long long ll;
typedef long double ld;
typedef complex... | ALGO | 0.999833 | 4.297392 |
aa563c09-525e-488d-bb5a-cab18abbef03 | A-AboElnaga/CP-Solutions | CodeChef/C++17/EXPENSES/81887692.cpp | #include <iostream>
#include <string>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <valarray>
#include <queue>
#include <unordered_set>
#include <map>
#include <stack>
#include <deque>
#define FIn \
cin.tie(0); \
cout.tie(0); \
ios_base... | ALGO | 0.999784 | 3.974962 |
bbc09d50-6d90-41a7-9184-ffad5dc26bbf | precisionconage/COMP8551-Assign3 | Assign3/src/Gaussian.cpp | #include "Gaussian.h"
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
// Returns an index into a 1d array from a pair of 2d array indicies
int pos(int x, int y, int width)
{
return x + (y * width);
}
// Generates a Gaussian filter
void GaussianFilter(float* filter)
{
// 2D representation of the filte... | ALGO | 0.988927 | 5.641002 |
17145b64-56c7-494f-8339-85a824fe0d73 | nileshshirkemet/DACMarch2022 | CodingSamples/Fundamentals/Polymorphism/adttest.cpp | #include "series.h"
#include <cstdio>
double Compute(Series::Sequence& seq, int count)
{
return seq.Sum(count) / count;
};
int main(void)
{
int n;
printf("Number of Terms: ");
scanf("%d", &n);
Series::LinearSequence a(2, 5);
printf("Cmputation result for linear sequence = %lf\n", Compute(a, n));
Series::Powe... | ALGO | 0.998231 | 4.17652 |
7ef4a6b7-2fc5-48da-a64d-07396d7bdc81 | TobiasMeisel/ogs-taurus | Applications/FileIO/Gmsh/GMSHPolygonTree.cpp | #include "GMSHPolygonTree.h"
#include <sstream>
#include "GMSHAdaptiveMeshDensity.h"
#include "GMSHFixedMeshDensity.h"
#include "GeoLib/AnalyticalGeometry.h"
#include "GeoLib/GEOObjects.h"
#include "GeoLib/Point.h"
#include "GeoLib/Polygon.h"
#include "GeoLib/PolygonWithSegmentMarker.h"
#include "GeoLib/PolylineWithS... | TOOL | 0.96494 | 7.088547 |
2bc7b4a5-e1fd-43d1-b570-6241c0eee856 | zezehz/ccc | opencv-3.4.1/modules/cudawarping/src/warp.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
void cv::cuda::warpAffine(InputArray, OutputArray, InputArray, Size, int, int, Scalar, Stream&) { throw_no_cuda(); }
void cv::cuda::buildWarpAffineMaps(InputArray, bool, Size, OutputArray, OutputArra... | TOOL | 0.994456 | 7.052229 |
bd080d87-20f8-4d39-8eb1-ad4630d834dd | AkhilSoni0102/Learning-Data-Structures | Graphs/Is_Connected.cpp | #include<bits/stdc++.h>
using namespace std;
void DFS(int** edges, int n, int sv, bool* visited){
visited[sv] = true;
for(int i = 0; i < n;i++){
if(i == sv)
continue;
if(edges[sv][i] && !visited[i]){
DFS(edges, n, i, visited);
}
}
}
bool isConnected(int** ed... | ALGO | 0.999979 | 4.354237 |
7da3e7ba-0a73-4461-9b75-3609244d06ba | Nitin0333/Competitive-Programming | Codeforces/Codeforces Round 972 (Div. 2)/B2.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "../debug.h"
#else
#define debug(...)
#endif
void solve() {
int n, m, q;
cin >> n >> m >> q;
vector<long long> v(m);
for (int i = 0; i < m; i++)
cin >> v[i];
sort(v.begin(), v.end());
for (int i = 0; i < q; i++) {
long long a;
cin... | ALGO | 0.9999 | 4.241158 |
4011f3a2-6da1-4267-bf13-57b73e50ee8a | akostanda/Ucode-marathon-Cpp | Sprint01/t03/src/vampireRabbits.cpp | #include "vampireRabbits.h"
void yearsIncrease(std::list<Rabbit>& rabbits) {
for (auto& r : rabbits) {
r.age++;
}
}
void killRabit(std::list<Rabbit>& rabbits) {
rabbits.remove_if([](const Rabbit& rabit) {
if ((rabit.age > 3 && rabit.isVampire == false)
|| (rabit.age > 8 && rabi... | TOOL | 0.893424 | 4.842309 |
aa2e10cd-41da-40ed-8f96-1a33e11a63f6 | sarvex/leetcode-clojure | solution/0300-0399/0333.Largest BST Subtree/Solution.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.999975 | 6.848977 |
ec49d572-28ff-4bcb-b373-20bbadd2649e | hiraditya/origin | origin/sequence/algorithm.test/reverse.cpp | #include <cassert>
#include <iostream>
#include <vector>
#include <origin/sequence/algorithm.hpp>
using namespace std;
using namespace origin;
int
main ()
{
using V = vector<int>;
V v0{ 1, 2, 3, 4, 5 };
V v1 = v0;
V v2 = v0;
reverse (v1);
reverse (v2.begin (), v2.end ());
assert (v1 == v2);
v1 = v... | TEST | 0.904469 | 5.441514 |
ce847bd1-88af-48da-8247-82e9ad7a63ab | mohitk064/LeetCode | 0033-search-in-rotated-sorted-array/0033-search-in-rotated-sorted-array.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int left = 0;
int right = nums.size() -1;
while(left <= right){
int mid = (left + right) / 2;
if(nums[mid] == target){
return mid;
}
else if(nums[mid] >= nums[... | ALGO | 0.999976 | 6.251065 |
0fb263cb-f661-4cc2-a326-b2708692e006 | tanuchaurasiya/GeeksforGeeks | Medium/Number of occurrence/number-of-occurrence.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
/* if x is present in arr[] then returns the count
of occurrences of x, otherwise returns 0. */
int count(int arr[], int n, int x) {
// code here
int count=... | ALGO | 0.999906 | 5.826066 |
fd85ecc2-c434-4c6c-a3ad-7f61c02fcfe6 | nithashifana/leetcode-submissions | 2652.cpp | // Sum multiples
// Easy
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int sumOfMultiples(int n) {
int sum = 0;
for(int i = 1; i <= n; i ++) {
if(i%3 == 0 || i%5 == 0 || i%7 == 0) sum += i;
}
return sum;
}
}; | ALGO | 0.999907 | 4.777335 |
11533f83-66ba-4b5d-8e58-80ab683e2959 | Aerma7309/codingblocks | Help_Ramu.cpp | // @author: Abhimanyu Maurya
#include <iostream>
using namespace std;
#ifndef ONLINE_JUDGE
FILE *fr = freopen("input.txt", "r", stdin);
FILE *fw = freopen("output.txt", "w", stdout);
#endif
int main()
{
int test, c1, c2, c3, c4, r, c, rcost, ccost, t;
cin >> test;
while (test--)
{
cin >> c1 >> ... | ALGO | 0.99973 | 3.054926 |
ce88b33a-e58e-4615-af43-b1016523f852 | Autonomy2024/PX4_Firmware | src/modules/local_position_estimator/sensors/mocap.cpp | #include "../BlockLocalPositionEstimator.hpp"
#include <systemlib/mavlink_log.h>
#include <matrix/math.hpp>
extern orb_advert_t mavlink_log_pub;
// required number of samples for sensor
// to initialize
static const uint32_t REQ_MOCAP_INIT_COUNT = 20;
static const uint32_t MOCAP_TIMEOUT = 200000; // 0.2 s
// set p... | ALGO | 0.973286 | 5.495322 |
8ab5a1f3-e6ef-4069-b722-bd7eaf984488 | parkes811-inu/codetree-TILs | 240326/안전 지대/comfort-zone.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
vector<int> areas;
int map[51][51];
bool visited[51][51];
int dx[4] = {0, 0, -1, 1};
int dy[4] = {1, -1, 0, 0};
bool InRange(int x, int y) {
return (x >= 0 && y >= 0 && x < n && y < m); // m으로 수정
}
void dfs(int x, int y)... | ALGO | 0.999987 | 5.907471 |
2e862978-3089-4869-b091-c0b08542d988 | jayjaisswal/Data-Structure | DSA Using cpp/Leetcode/69sqrt.cpp | class Solution {
public:
int mySqrt(int x) {
int low = 0;
int high = x;
while(high>=low){
int mid = low+ (high - low)/2;
long long m =(long long)mid;
long long y =(long long)x;
if(m*m==y) return mid;
else if(m*m>y) high = mid-1;
... | ALGO | 0.999949 | 5.274404 |
7408a64b-be85-4177-ba06-df460583ce73 | ishandutta2007/codeforces | kiyoshi0205/normal/1534/E.cpp | #pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #include<ext/pb_ds/tag_and_trait.hpp>
// using namespace __gnu_pbds;
// #include<boost/multiprecision/cpp_int.hpp>
// nam... | ALGO | 0.99996 | 3.904859 |
8bdccba0-58a1-42f4-a864-635146b5eb5c | ishandutta2007/codeforces | natsugiri/normal/1695/C.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("unroll-loops")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while... | ALGO | 0.99977 | 3.519668 |
a359ecea-9fd5-482d-99d1-ed48a8ec4876 | MehediHasan-75/code | Company_Queries_II.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
const int mxN=2e5+10, Log=21;
vector<ll>graph[mxN], depth(mxN, 0);
vector<vector<ll>>up(mxN, vector<ll>(Log, 0));
ll n;
void dfs(ll u){
for(auto &v: graph[u]){
depth[v]=depth[u]+1;
up[v][0]=u;
for(int j=1; j<Log; j++){
... | ALGO | 0.99999 | 4.441113 |
642848b3-e0a5-46e6-a856-fdab14aef20a | saisirram/Competitive-Coding | Arrays/Max_Subarray_Sum.cpp | /*
Maximum Subarray Sum in an Array (Kadanes Algorithm):
reference link : https://takeuforward.org/data-structure/kadanes-algorithm-maximum-subarray-sum-in-an-array/
Given an integer array arr, find the contiguous subarray (containing at least one number)
which has the largest sum and return its sum.
Input 1:
9
-2 1 ... | ALGO | 0.999989 | 5.308232 |
8dd99cb6-722c-443c-bcd7-40a42a68efb6 | CardioidYang/myLeetCode | easy/Length of Last Word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
istringstream in(s);
string tmp;
for (string word; in >> word;) {
tmp = word;
}
return tmp.size();
}
}; | ALGO | 0.990281 | 5.747163 |
1551b1af-6a3e-44ff-aa88-a77f1310d5f2 | subodhnarayan/100DayofCoding | day482.cpp |
-- -- -- -- -- -- -- -- -Leetcode - POTD - 23 / 04 / 2025 -----------------------------------
Unique Number II
Difficulty: MediumAccuracy: 36.9%Submissions: 165K+Points: 4Average Time: 15m
Given an array arr[] containing 2*n + 2 positive numbers, out of which 2*n numbers exist in pairs whereas only two number occur ex... | ALGO | 0.999851 | 5.96307 |
aff1b72f-66c4-479e-ab64-ae7feb4db15e | rajeev0521/Leetcode-Submissions | 0268-missing-number/0268-missing-number.cpp | class Solution {
public:
int missingNumber(vector<int>& nums) {
int sum = 0;
for(int num : nums){
sum += num;
}
int n = nums.size();
int sum2 = (n*(n+1))/2;
return sum2-sum;
}
}; | ALGO | 0.999856 | 5.74545 |
bf06d797-1d8e-4c71-ad1f-666b7449acbd | ChavanAtharv/CPP | Program206.cpp | #include<iostream>
using namespace std;
class DigitX
{
public:
int iNo;
DigitX()
{
iNo = 0;
}
DigitX(int i)
{
iNo = i;
}
int SumEvenDigit()
{
int iSum = 0;
int iDigit = 0;
while(iN... | ALGO | 0.999393 | 4.569421 |
3c3fa1c6-6412-41da-abad-ef1b25f5663c | abhishek18124/PPCPPJune2024 | Lecture 25/001NQueens2.cpp | /*
N Queens Problem
The problem is to place 'n' queens on an 'n x n' chessboard, so that no two queens are attacking
each other, this means that no two queens are in the same row, the same column, or the same diagonal.
Example
Input : N = 4
Output:
_ Q _ _ _ _ Q _
_ _ _ Q Q _ _ _
Q _... | ALGO | 0.99996 | 5.775959 |
6d0f5952-593e-442f-ba0b-c6c5d3aa4542 | mcalisadeghi/simple-app-with-dark-mode | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
b55f2650-8478-4c5d-9477-b82cba72e57a | BernardoOrtiz/RISC_V_perf_model | RISC_V_perf_model/branch.cpp | // Author: Bernardo Ortiz
// <EMAIL>
// cell: 949/400-5158
// addr: 67 Rockwood Irvine, CA 92614
#include "ROB.h"
void missed_branch(branch_vars* branch, branch_type* branch_exec, UINT64 clock, UINT mhartid, UINT debug_unit, FILE* debug_stream) {
int debug = 0;
branch->total[branch_exec->addr & 0x0fff] = branch->cou... | ALGO | 0.869291 | 4.648246 |
32f04dd8-ae17-4d97-a6d0-f27f4f979623 | muhammadhasan01/cp | Library/Graph/Minimum_Spanning_Tree_Kruskal.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define inf INT_MAX
#define MOD 1000000007
#define MEM(a,b) memset(a,(b),sizeof(a))
#define ll long long
#define pll pair<long long,long long>
#define pii pair<int,int>
using namespace std;
// source : https://github.c... | ALGO | 0.99998 | 4.67763 |
0c83ea10-f9ac-457f-a365-fc259e750921 | jordandong/mylintcodes | LINT_00072_ConstructBinaryTreeFromInorderAndPostorderTraversal.cpp | /*
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
*/
/**
* Definition of TreeNode:
* class TreeNode {
* public:
* int val;
* TreeNode *left, *right;
* TreeNode(int val) {
* this->val = val;
* ... | ALGO | 0.999979 | 6.200007 |
ef5017be-05e7-459c-8d21-45469ccb237b | chanyowthea/RecastStudy | Recast/RecastRasterization.cpp | #define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include "Recast.h"
#include "RecastAlloc.h"
#include "RecastAssert.h"
//两个AABB是否相交
inline bool overlapBounds(const float* amin, const float* amax, const float* bmin, const float* bmax)
{
bool overlap = true;
overlap = (amin[0] > bmax[0] || amax[0] < bmi... | ALGO | 0.987953 | 3.749552 |
67b98f0f-5ffe-4312-a4d5-af4ec08f51fa | Pavan-Chavan/Competitive_Program_Stuff | DiagonalDifference.cpp | /*Given a square matrix, calculate the absolute
difference between the sums of its diagonals. */
//Title:- Diagonal Difference
//coder:- Pavan Chavan
//Email:- <EMAIL>
//date:- 3/7/2021
#include <bits/stdc++.h>
using namespace std;
string ltrim(const string &);
string rtrim(const string &);
vector<string> split(co... | ALGO | 0.999996 | 5.481582 |
33205130-b150-48a9-ba67-ba8c8c8261dd | catupper/AOJans | vol05/0519/Worst_Sportswriter.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int parent[5250], n, m, a, b;
vector<int> edge[5250], ans;
bool used[5250];
void topo(int x){
if(used[x])return;
used[x] = true;
for(int i = 0;i < edge[x].size();i++){
topo(edge[x][i]);
}
cout << x << endl;
ans.push... | ALGO | 0.999934 | 4.214303 |
84ebcc9b-9edf-4f0f-8a5d-92a10dbbcbdb | Dongdong-NEU/D_VINS | vins_estimator/src/initial/initial_aligment.cpp | #include "initial_alignment.h"
void solveGyroscopeBias(map<double, ImageFrame> &all_image_frame, Vector3d* Bgs)
{
Matrix3d A;
Vector3d b;
Vector3d delta_bg;
A.setZero();
b.setZero();
map<double, ImageFrame>::iterator frame_i;
map<double, ImageFrame>::iterator frame_j;
for (frame_i = all... | ALGO | 0.937617 | 3.17132 |
ee69bb96-d6dc-4955-aa3e-20f4b9fd7381 | vinay030901/Algorithms | 450/matrix/3findMedianInRowWiseSortedMatrix.cpp | /*
We are given a row-wise sorted matrix of size r*c, we need to find the median of the matrix given. It is assumed that r*c is always odd.
Examples:
Input : 1 3 5
2 6 9
3 6 9
Output : Median is 5
If we put all the values in a sorted
array A[] = 1 2 3 3 5 6 6 9 9)
Input: 1 3 4
2 5 6
7 8 ... | ALGO | 0.999988 | 4.830137 |
e5d80d45-1932-4052-88e8-b9b60b41a5b4 | vaishalipandey-11/DSA | Arrays/75. Sort Colors.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
void sortColors(vector<int>& nums) {
int l =0; int m =0 ;int h =nums.size()-1;
while(m<=h){
if(nums[m]==0){
swap(nums[l],nums[m]);
l++;
m++;
... | ALGO | 0.999669 | 5.674767 |
d750b1cf-5ed6-472f-b9f1-a9998e160bbd | SwapnanilHalder/CodingFiles | AlgoZenith/Applied_Learning_of_STL/Pattern_Problem_2.cpp | #include <bits/stdc++.h>
#define SPEED1 ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
using namespace std;
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <fstream>
#include <queue>
#include <deque>
#include <bitset>
#includ... | ALGO | 0.999691 | 3.800917 |
0e28f900-7fd3-441b-846a-758043bc066b | limJhyeok/cpp-coding-test | app/programmers/day-7/181920.cpp | // 카운트 업
#include <iostream>
#include <vector>
using namespace std;
vector<int> solution(int start_num, int end_num) {
vector<int> answer;
for (int i = start_num; i <= end_num; i++) {
answer.push_back(i);
}
return answer;
}
int main() {
int start_num = 3;
int end_num = 10;
vector<int> answer = solut... | ALGO | 0.999389 | 3.846577 |
8771423d-70fa-41c0-ac70-ea491850f50f | vaishnavirajj/CodeWithDSA | Patterns/half_pyramid.cpp | //Printing hald pyramid
#include<iostream>
using namespace std;
int main() {
int n;
cout<<"enter no of rows: ";
cin>>n;
for (int i=0 ; i<n ; i++ ) {
for (int j=0 ; j<i+1 ; j++) {
cout<<"* ";
}
cout<<endl;
}
} | ALGO | 0.999526 | 3.473463 |
1a6fa595-b361-4153-8dae-5151dacba263 | vaishalipandey-11/DSA | Arrays/605. Can Place Flowers.cpp |
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
int m = flowerbed.size();
for (int i = 0; i < m; i++) {
if (flowerbed[i] == 0) {
bool left = (i == 0 || flowerbed[i - 1] == 0)... | ALGO | 0.99999 | 6.390362 |
c3f35654-c6f2-4251-9fff-68d9d5ae2178 | ishandutta2007/codeforces | roundgod/normal/1245/C.cpp | #include<bits/stdc++.h>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int t,n,a,b,c;
string str;
int dp[MAXN];
void add(int &a,int b) {a+=b; if(a>=MOD) a-=MOD;}
int main()
{
cin>>str;
n=(int)... | ALGO | 0.999933 | 3.837885 |
0ef7c471-1fd6-4735-8cf6-f686fcc62cd8 | leekkang/StudyEngineering | EncodingAlgorithm/EncodingAlgorithm.cpp |
#include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
#include <functional>
#include <algorithm>
#include <chrono>
#include "Huffman.h"
#include "LZWAlgorithm.h"
int main() {
std::string input {"test encoding test test of Huffman and LZW Algorithm. is it work correctly?"};
constexpr boo... | TEST | 0.989595 | 4.822588 |
2b253f85-2bde-4a02-8b85-5915d0c397e1 | Shafiahuma/DSA | 01.07.23/ATC-B.cpp | #include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> c(n);
for (int i = 0; i < n; i++) {
cin >> c[i];
}
vector<string> d(m);
for (int i = 0; i < m; i++) {
cin >> d[i];
}
vector<int> p(m ... | ALGO | 0.999833 | 4.559415 |
4568878b-1abd-4833-a9f6-7351584b829c | NestZ/competitive-programming | AtCoder/PopularVote.cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int ll;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c... | ALGO | 0.999989 | 3.641283 |
62472614-55e3-407d-af62-4653bec08060 | Caerind/Arthropoda | Sources/Math/Vector4.cpp | #include "Vector2.hpp"
#include "Vector3.hpp"
#include "Vector4.hpp"
namespace oe
{
Vector4::Vector4()
: x(0.0f)
, y(0.0f)
, z(0.0f)
, w(0.0f)
{
}
Vector4::Vector4(const Vector2& v, F32 z, F32 w)
{
set(v, z, w);
}
Vector4::Vector4(const Vector3& v, F32 w)
{
set(v, w);
}
Vector4::Vector4(const Vector4& v)
{
... | TOOL | 0.873504 | 6.256588 |
69a7a4a5-c935-459b-99b9-2f2cafeb5a1f | ChloeAmelinda/TrangVT-lap-trinh-C-session-5 | ss5 bai 3.cpp | #include<stdio.h>
int main()
{
int n ;
int tong;
printf("Moi ban nhap so bat ki : ");
scanf("%d", &n);
while(n>0)
{
tong += n%10;
n /=10;
}
printf("Tong cac chu so la : %d\n",tong);
return 0;
}
| ALGO | 0.999602 | 3.139231 |
b9e3b65b-4772-4bf5-bd5b-4224690f68fa | abhishek-dhnma/LeetcodeSubbmisson2024 | 1927-maximum-ascending-subarray-sum/1927-maximum-ascending-subarray-sum.cpp | class Solution {
public:
int maxAscendingSum(vector<int>& nums) {
int maxSum = nums[0];
int runSum = nums[0];
for(int i=1; i<nums.size(); i++){
runSum = (nums[i] > nums[i-1]) ? runSum + nums[i] : nums[i];
maxSum = max(maxSum, runSum);
}
return maxSu... | ALGO | 0.999951 | 6.368691 |
b9a29d38-900e-4f82-832b-8458c31f08a0 | jmarko02/LeetCode | Trees/1448CountGoodNodesInBinaryTree.cpp |
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), left(left), right(right) {}
};
#include <algorithm>
using name... | ALGO | 0.999917 | 6.378971 |
6129938e-ef9e-428f-ad2a-d5b5db22ec61 | wisniewskij/CP-Solutions | CSES.FI/Graph Algorithms/1667 - Message Route.cpp | // github.com/wisniewskij/Code
// cses.fi/problemset/task/1667
// Message Route
#include <bits/stdc++.h>
#define ndl '\n'
#define ll long long
#define INF 1000000007
#define st first
#define nd second
#define debug(x) cout << #x << ": " << x << ndl
#define all(x) (x).begin(), (x).end()
using namespace std;
int main(... | ALGO | 0.99998 | 4.186092 |
d32693e9-5830-48d6-a728-696248a5e521 | tonyshenkk/leetcode | lengthOfLastWord.cpp | //#include <iostream>
//#include <string>
//
//using namespace std;
//
//int lengthOfLastWord(const char *s) {
// // Start typing your C/C++ solution below
// // DO NOT write int main() function
// int l = 0;
// const char *p = s;
// while(*p)
// {
// if (*p != ' ')
// {
// l = 0;
// while(*p && *p != ' ')
// {... | ALGO | 0.99633 | 4.245674 |
56b96bac-ec30-4ace-a978-1219c846b6cb | Eeman1113/Leetcode | Problems/78.cpp | class Solution {
public:
bool exist(vector<vector<char>>& board, string word) {
for (int i = 0; i < board.size(); ++i)
for (int j = 0; j < board[0].size(); ++j)
if (dfs(board, word, i, j, 0))
return true;
return false;
}
private:
bool dfs(vector<vector<char>>& board, const strin... | ALGO | 0.999336 | 6.447995 |
db4ac71e-3b05-4724-bb62-8e26feeb5132 | vavraj/BinaryBattles | phase_2_pointers&recursions/rec8_phnbook.cpp | #include<iostream>
#include<vector>
using namespace std;
void solve(string digits, string output,int index,string mapping[],vector<string>& ans)
{
// base condition
if(index>=digits.length())
{
ans.push_back(output);
return;
}
int number=digits[index]-'0';
string value=mapping[... | ALGO | 0.999898 | 5.450587 |
184399ae-02d6-43f4-8f87-fe7219f8e1bf | Ridham24/GFG-Potd | Nov26POTD.cpp | #include<bits/stdc++.h>
using namespace std;
void c1(int N,vector<int>& v)
{
if(N<=0)
{
v.push_back(N);
return;
}
v.push_back(N);
c1(N-5, v);
v.push_back(N);
}
vector<int> pattern(int N){
vector<int> v;
c1(N,v);
... | ALGO | 0.999174 | 3.570417 |
6852b220-532e-47e0-9dfa-1d45696556de | AnnXQ/SummaryofInterview | code/数组中的逆序对.cpp | class Solution {
public:
int InversePairs(vector<int> data) {
int datalenght = data.size();
if (datalenght == 0)
return 0;
if (datalenght == 1)
return 1;
vector<int> copy(data);
return countInversePairs(data, copy, 0, datalenght - 1);
}
int cou... | ALGO | 0.999957 | 5.2071 |
542a1433-19fc-48d4-ad08-f708b7718a43 | Cesar0067/Marlin | Marlin-2.1.1/Marlin-2.1.1/Marlin/src/libs/heatshrink/heatshrink_decoder.cpp | #include "../../inc/MarlinConfigPre.h"
#if ENABLED(BINARY_FILE_TRANSFER)
/**
* libs/heatshrink/heatshrink_decoder.cpp
*/
#include "heatshrink_decoder.h"
#include <stdlib.h>
#include <string.h>
#pragma GCC optimize ("O3")
/* States for the polling state machine. */
typedef enum {
HSDS_TAG_BIT, /* ... | ALGO | 0.884225 | 4.962111 |
718f9d75-e450-40ec-8730-8c1b25b6ed4a | daviddoria/PatchBasedInpainting | Demos/DemoSortGMHDifference.cpp | // Custom
#include "Utilities/PatchHelpers.h"
#include "DifferenceFunctions/Patch/GMHDifference.hpp"
// Submodules
#include <Helpers/ParallelSort.h>
#include <Mask/MaskOperations.h>
int main(int argc, char *argv[])
{
if(argc < 2)
{
std::cerr << "Required arguments: fileName.png" << std::endl;
return EXIT_... | ALGO | 0.897482 | 4.126123 |
c788d332-1419-4d3f-a699-5a6ffdcfe30b | yitati/LCProject | Lcode/NumberOfNodes.cpp | /*
* Laicode_NumberOfNodes.cpp
*
Return the number of nodes in the linked list.
Examples
L = null, return 0
L = 1 -> null, return 1
L = 1 -> 2 -> null, return 2
*/
#include "../Leetcode/ListNode.h"
int numberOfNodes(ListNode* head)
{
int count = 0;
while(head)
{
count++;
head = head->next;
}
return co... | ALGO | 0.99219 | 5.56801 |
6c376346-13ee-4cd7-8b02-4253443006ee | motowds/android_system_core_mtk | adb/adb_utils.cpp | #define TRACE_TAG ADB
#include "adb_utils.h"
#include "adb_unique_fd.h"
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <vector>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-ba... | TOOL | 0.97761 | 7.799826 |
c7b7ac3a-6f58-4f40-a9ac-1a29f74cfb0f | steineggerlab/foldseek | lib/mmseqs/src/test/TestAlignmentTraceback.cpp | #include "SubstitutionMatrix.h"
#include "ReducedMatrix.h"
#include "KmerGenerator.h"
#include "BaseMatrix.h"
#include "StripedSmithWaterman.h"
#include "Util.h"
#include "Parameters.h"
const char* binary_name = "test_alignmenttraceback";
DEFAULT_PARAMETER_SINGLETON_INIT
struct scores{
short H;
short F;
s... | ALGO | 0.998604 | 3.658962 |
1e953e26-8a81-489c-9f1f-a1ec26f6833d | ishandutta2007/codeforces | rama_pang/normal/1451/D.cpp | #include <bits/stdc++.h>
using namespace std;
void Main() {
int d, k;
cin >> d >> k;
int lo = 0, hi = d / k + 5;
while (lo < hi) {
int md = (lo + hi + 1) / 2;
if (2ll * md * k * md * k <= 1ll * d * d) {
lo = md;
} else {
hi = md - 1;
}
}
int state = 0;
if (1ll * lo * k * l... | ALGO | 0.999915 | 5.163558 |
a81cec39-2e50-4124-bb87-1f9e12fdba8a | alexandraback/datacollection | solutions_5648941810974720_0/C++/ipaljak/A.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
using namespace std;
#define TRACE(x) cerr << #x << " " << x << endl
#define FOR(i, a... | ALGO | 0.999543 | 4.508536 |
63cbf983-3370-4ed0-8971-5ea34da25345 | chikatlarakesh/Leetcode-Progress | 696-count-binary-substrings/count-binary-substrings.cpp | class Solution {
public:
int countBinarySubstrings(string s) {
int n=s.length();
int count=0,prev=0,curr=1;
for(int i=1;i<n;i++)
{
if(s[i-1]!=s[i])
{
count+=min(prev,curr);
prev=curr;
curr=1;
}
... | ALGO | 0.999993 | 6.289586 |
bc869dbd-2f1a-4975-9198-04750dd1986f | techie-coder-github/Codechef-Long-JAN-I | PINBS.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int c=0,p=-1;
string s;
cin>>s;
int n=s.length();
if(n==1)
{
cout<<"No"<<endl;
continue;
}
for(int i=0;i<=n;i++)
if(s[i]=='1')
{
... | ALGO | 0.999981 | 3.996284 |
bc817e1a-f183-40b5-9297-897b9de36061 | CITMUniversityExercises/Physics | Physics2_class1_handout/Physics2_class1_handout/Box2D/Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.cpp | #include <Box2D/Dynamics/Contacts/b2PolygonAndCircleContact.h>
#include <Box2D/Common/b2BlockAllocator.h>
#include <Box2D/Dynamics/b2Fixture.h>
#include <new>
b2Contact* b2PolygonAndCircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, int32, b2BlockAllocator* allocator)
{
void* mem = allocator->All... | ALGO | 0.930223 | 7.291923 |
128f916b-63ab-444b-ad0b-8cb600ecf670 | fhvirus/CodeArchive | CSES/2166.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
struct Val {
ll val, sum;
Val(ll v = 0) : val(v), sum(v) {}
Val(ll v, ll s) : va... | ALGO | 0.999767 | 4.458261 |
e57d9a91-bd47-41c4-95fa-e7ecce8b246c | soki-rf/Lab_4 | number_3.cpp | #include <iostream>
#include <vector>
#include <limits>
using namespace std;
int argmax(vector<float>& m, int n){
float x = numeric_limits<float>::min();
int res, i;
if(n == 0){
return -1;
}
for(i=0; i < n; ++i){
if(m[i] > x){
x = m[i];
res = i;
}
... | ALGO | 0.999817 | 4.293022 |
cce443bb-9670-4947-9e2f-9dd8a09d794b | ELTCore/cppcode | leetcode/c2788_WIP.cpp | /*
2788. 按分隔符拆分字符串
简单
相关标签
相关企业
提示
给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 words 中的每个字符串。
返回一个由拆分后的新字符串组成的字符串数组,不包括空字符串 。
注意
separator 用于决定拆分发生的位置,但它不包含在结果字符串中。
拆分可能形成两个以上的字符串。
结果字符串必须保持初始相同的先后顺序。
示例 1:
输入:words = ["one.two.three","four.five","six"], separator = "."
输出:["one","two","three","four","five",... | ALGO | 0.999166 | 6.409307 |
13f771dd-f0cb-4d4a-a18d-2ce0762509f2 | simX/d2x-xl | tags/v1.14.66/lighting/lightrender.cpp | #ifdef HAVE_CONFIG_H
# include <conf.h>
#endif
#include <math.h>
#include <stdio.h>
#include <string.h> // for memset ()
#include "descent.h"
#include "error.h"
#include "u_mem.h"
#include "fix.h"
#include "vecmat.h"
#include "network.h"
#include "ogl_defs.h"
#include "ogl_lib.h"
#include "ogl_color.h"
#include "ogl_... | TOOL | 0.945569 | 4.290315 |
e7f8557f-24ee-4df5-9a93-4bc749f6438a | ishandutta2007/codeforces | kevinyang/normal/1722/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
cin.tie(0)->sync_with_stdio(0);
int T; cin >> T;
while (T--){
int N; cin >> N;
vector<vector<string>> a(3);
map<string, int> cnt;
for (int i = 0; i < 3; ++i){
for (int j = 0; j < N; ... | ALGO | 0.999654 | 4.905326 |
c8e6c330-ba5b-454f-8804-78c9dccc5371 | 1Nigar357/EGOI-preparation | 6-mar (DISCONNECTED - DFS ALGORITHMS)/A-(connected-components).cpp | #include <bits/stdc++.h>
using namespace std;
int g[101][101], color[101];
int n, cnt;
void dfs(int s){
color[s] = 1;
for(int i = 1; i <= n; i++){
if(g[s][i] && !color[i]){
dfs(i);
}
}
}
int main()
{
cin>>n;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++)... | ALGO | 0.99974 | 4.806598 |
1c18f01e-c13d-46a5-b6ae-e8d220707e8b | andrenatal/webspeech-vr | gfx/skia/trunk/src/opts/SkXfermode_opts_arm_neon.cpp | #include "SkXfermode.h"
#include "SkXfermode_proccoeff.h"
#include "SkColorPriv.h"
#include <arm_neon.h>
#include "SkColor_opts_neon.h"
#include "SkXfermode_opts_arm_neon.h"
#define SkAlphaMulAlpha(a, b) SkMulDiv255Round(a, b)
////////////////////////////////////////////////////////////////////////////////
// NEON... | TOOL | 0.955619 | 7.204434 |
5e6d58f9-e96d-4927-999e-5ad195eeb5ee | hrithiksagar/Competetive-Programming | Programming Questions/12. Strings/SortingAString.cpp | // "YZX" ---->(SORT) "XYZ"
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
// declaring a string
// StringKeyword Identifier
// data type analog s
string s1 = "zyx";
// wanna sort chracters
// use inbuilt sort funciton
sort(s1.begin(), s1.end());
... | ALGO | 0.999299 | 3.847008 |
0cb74bc2-e8dd-43b9-8ce2-c63ac309920b | mmcs-work/Leetcode-solutions | 0513-find-bottom-left-tree-value/0513-find-bottom-left-tree-value.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.999992 | 6.202853 |
f3a19a35-34b1-4ec3-ab3d-69171ebeb873 | lvjianjunljj/CppDemo | CppDemo/Problem914.cpp | #include "stdafx.h"
/*
In a deck of cards, each card has an integer written on it.
Return true if and only if you can choose X >= 2 such that it is possible to split the entire deck into 1 or more groups of cards, where:
Each group has exactly X cards.
All the cards in each group have the same integer.
Example 1:
I... | ALGO | 0.999866 | 5.389935 |
f5a4301d-d75c-4075-a692-bc01456ea9fb | NehaMittal1616/Leetcode-and-GeeksForGeeks | 2684-determine-the-winner-of-a-bowling-game/2684-determine-the-winner-of-a-bowling-game.cpp | class Solution {
public:
int isWinner(vector<int>& player1, vector<int>& player2) {
int n=player1.size();
int score1=0;
for(int i=0;i<n;i++)
{
if((i-1>=0 && player1[i-1]==10) || (i-2>=0 && player1[i-2]==10))
{
score1+=2*playe... | ALGO | 0.999991 | 5.199812 |
d22e5cde-7537-40bf-b6c5-89e4c7fd72ad | STEllAR-GROUP/blaze | blazemark/src/flens/DMatDMatAdd.cpp | //=================================================================================================
//=================================================================================================
//*************************************************************************************************
// Includes
//****... | ALGO | 0.995671 | 5.98596 |
2bac96a8-c66a-4766-80e4-c68afc966e09 | scharrin/ocvTut | cvTest/main equalizeHistogram.cpp | /// equalize histogram
///
#include <iostream>
#include "opencv2/opencv.hpp"
#include "dd.h"
using namespace std;
using namespace cv;
RNG rng;
int main(int argc, const char * argv[]) {
namedWindow("w");
Mat img = imread(str_path_download + "adjHistorgramTest.jpg", 0);
// Mat img = imread(str_path_d... | ALGO | 0.972898 | 3.544373 |
1545af0b-fc0a-4b70-afa6-43a9cd5066f1 | gujiangqi/MyStudying | 08_dataConstruct/09_linklist.cpp | /* 线性模板类链表测试 */
#include <iostream>
#include <cstdlib>
#include "LinkList.cpp"
using namespace std;
struct Teacher
{
int age;
char name[64];
};
int main()
{
Teacher t1, t2, t3;
t1.age = 31;
t2.age = 32;
t3.age = 33;
LinkList<Teacher> list;
list.insert(t1, 0);
list.insert(t2, 0);
... | ALGO | 0.973955 | 3.554773 |
a03017e2-0599-41a5-bff1-2a5a47a87f9b | dani-github/CodeSnippets | CPP/mayabee/ENI_2015_E1.mayabee_DDM.cpp | #include<iostream>
using namespace std;
int main( )
{
int fl1, new1, fl2, new2, fl3, new3, onefl, sum, broi;
cin >> fl1 >> fl2 >> fl3;
onefl = (fl1 + fl2 + fl3) / 3;
sum = fl1 + fl2 + fl3;
broi = 0;
if(fl1 < onefl)
{
new1 = fl1 + (onefl - fl1);
if((fl2 - (onefl - fl1)) <= 0)... | ALGO | 0.999836 | 3.781732 |
6c3a65a6-4361-4c18-985b-367f5aea7265 | Mritunjay-ranjan/Coding_Problems | DSA_LB/week_2_BasicsOfProgramming-L2/p4.cpp | //numeric palindrome equilateral pyramid
// 5
// 1
// 121
// 12321
// 1234321
// 123454321
#include<iostream>
using namespace std;
void p4(int n){
for(int i=0;i<n;i++){
for(int j=0;j<n-i-1;j++){
cout<<" ";
}
int k;
for(k=0;k<=i;k++){
cout<<k+1;
... | ALGO | 0.999851 | 4.369561 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.