uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
94909308-5579-4308-b3a2-7df53c514629 | infotoarchit2012/ArchitKumarSingh_DS_2A | DS9.cpp | #include<iostream>
using namespace std;
int main()
{
int m;
cout<<"Archit Kumar Singh\n";
cout<<"Enter the size of array A:\n";
cin>>m;
cout<<"Enter the elements of array A:\n";
int a[m];
for(int i=0;i<m;i++)
{
cin>>a[i];
}
int n;
cout<<"Enter the size of array B:\n";... | ALGO | 0.999643 | 3.206056 |
838454f9-b5f8-4c06-9572-970e7d31d0fb | adiboy6/MRnD-C | C-Strings2-Worksheet/CommonRoute.cpp | /*
There are two friends Hack and Code . They have decided to go on a world tour which consists of only Islands.
There are a total of 26 Islands in the world ,where Each Island has a name from A ,B ,C ,D ... till Z .
[Each Island name is restricted to only 1 Letter]
Hack and Code seperately made their travel lists ,wh... | ALGO | 0.999886 | 4.833495 |
17c86503-a687-42f7-8373-32517674026b | IMIdealDragon/algorithm-learning | acwing/qsort2.cpp | #include <iostream>
const int N = 100000 + 10;
using namespace std;
void quick_sort(int q[], int l, int r)
{
if(l >= r) return ;
int i = l - 1, j = r + 1, x = q[l];
while(i < j)
{
while(q[++i] < x);
while(q[--j] > x);
if(i < j) swap(q[i], q[j]);
else break;
}
q... | ALGO | 0.999989 | 3.679676 |
770b6cfb-e8a4-4216-8332-503d9414d665 | Tex-Tang/Competitive-Programming | Codeforces/900/0540A.cpp | #include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
int n,ans = 0;cin >> n;
string a,b;
cin >> a;
cin >> b;
for(int i = 0;i < n;i++){
int x = a[i] - '0', y = b[i] - '0';
ans += min(abs(x-y), min(x,y) + 9 - max(x,y) + 1);
}
cout << ans;
} | ALGO | 0.999636 | 4.092317 |
99a9955b-cc9e-40cd-93d6-701d178279cd | Zobio/atCoder-works | work/ans196e.cpp | #include <iostream>
#include <numeric>
#include <algorithm>
using namespace std;
using ll = long long;
const ll INF = numeric_limits<ll>::max() / 4;
void chmin(ll& a, ll b){ if(a > b) a = b; }
void chmax(ll& a, ll b){ if(a < b) a = b; }
int main(){
ll N;
cin >> N;
ll low = -INF, high = INF, add = 0;
fo... | ALGO | 0.999955 | 4.839821 |
8d7f399f-df81-4eaf-b27a-b9c067e5ff5e | ShiboBrady/cpp | 0711/sort/sort2.cpp | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Student{
string name_;
int age_;
int score_;
bool operator< (const Student &other) const{
if(score_ != other.score_){
return score_ < other.score_;
}
if(name_ ... | ALGO | 0.967763 | 4.720157 |
093f6dc2-482c-4b49-ae70-c39af972482e | MaiWael25/Machine_project | 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 |
c71ae95d-d378-45e6-828f-45841b62daae | gangwar1234/CP | New_Codeforces/121.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long lo;
typedef vector<lo> vl;
typedef vector<vl>vll;
#define MOD 1000000007
#define all(v) (v).begin(), (v).end()
#define debug(x) cerr<<#x<<" = "<<x<<endl;
#define REPV(a, b, c) for (lo(a) = b; (a) < (c); (a)++)
#define REP(a,b) for(lo i =(a) ;i<(b);i++)
t... | ALGO | 0.999968 | 3.440758 |
f33bf361-d7fe-481a-af2b-f23d878e1ebd | sabujsarker382/codeforce_problem | array.cpp | #include<iostream>
using namespace std;
int main()
{
int X=0;
int t;
cin>>t;
string s;
while(t){
cin>>s;
if(s=="++X" || s=="X++"){
X++;
}else{
X--;
}
t--;
}
cout<<X;
return 0;
}
| ALGO | 0.999461 | 3.489935 |
b032f3b4-babf-4536-934e-0e14687834c7 | GlodonOpenSrc/Qt5.5.1_Glodon | qtwebkit/Source/WebCore/platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp | #include "config.h"
#if ENABLE(FILTERS) && ENABLE(OPENCL)
#include "FEColorMatrix.h"
#include "FilterContextOpenCL.h"
namespace WebCore {
#define COLOR_MATRIX_KERNEL(...) \
int2 sourceCoord = (int2) (get_global_id(0) + x, get_global_id(1) + y); \
float4 sourcePixel = read_imagef(source, sampler, sou... | TOOL | 0.929138 | 7.260265 |
3ecbf72b-efb8-470c-afd2-eb782745b265 | moritzheep/anisotropic-screen-meshing | src/main.cpp | #include <iostream>
#include <pmp/io/io.h>
#include <cmath>
#include <pmp/algorithms/Triangulation.h>
#include "smp/algorithms/TightIntegration.h"
#include "smp/algorithms/NormalScreenRemeshing.h"
#include "utility/ImageLoader.h"
#include "utility/ArgumentParser.h"
#include "smp/algorithms/ScreenMeshing.h"
#include <b... | ALGO | 0.975372 | 5.336522 |
a7ebba5e-e614-4d35-a572-200af8755ce5 | bryanluu/HackerRank | Data Structures/printLinkedList.cpp | #include <iostream>
// #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList ... | ALGO | 0.999329 | 5.552586 |
b7ffda49-37b5-4418-a8a7-4c18336629dc | Penguin134/SUSTech_IME | 数据结构与算法分析(DSAA)/Lab7/F.cpp | #include "cstdio"
#include "vector"
#include "cstring"
using namespace std;
#define maxn 100010
typedef int Position;
struct TreeNode{
bool visited = false;
int priority = 0;
vector<int> edges;
}node[maxn];
bool out[maxn],visit[maxn];
int dist[maxn];
void init(){
memset(out,0,sizeof out);
for (int... | ALGO | 0.999907 | 3.935225 |
dbf109ad-87f5-4125-b5bf-391f8ae3c4af | suyasho786/LEETCODE_PROBLEMS | 2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp | class Solution {
public:
#define ll long long int
ll dfs(vector<ll>adj[],vector<ll>&vis,ll node){
vis [node]=1;
ll ans=0;
for(auto it:adj[node]){
if(!vis[it]){
ans+= dfs(adj,vis,it);
}
}
return ans+1;
}
long long countPairs(int n,... | ALGO | 0.99995 | 4.912446 |
63c96efe-b792-43a6-b644-14f651430489 | ch-ms/cpp-white-belt | week4/reverse-function-1/Function.cpp | #include <algorithm>
#include <vector>
using namespace std;
class FunctionPart {
public:
FunctionPart(const char& op, const double& val) {
operation = op;
value = val;
}
void Invert() {
operation = operation == '-' ? '+' : '-';
}
double Apply(const double& argument) const {
... | ALGO | 0.999199 | 5.854718 |
a724f7f2-5658-4384-9b3b-e05424741b30 | HemangTheHuman/hacktoberfest-2022 | DSA in CPP/Array Adt/BinarySearch.cpp | #include <iostream>
using namespace std;
struct Array
{
/* data */
int A[10];
int size;
int length;
};
int BinarySearch(struct Array arr, int key)
{
int l, h, mid;
l = 0;
h = arr.length - 1;
while (l <= h)
{
mid = (l + h) / 2;
/* code */
if (key == arr.A[mid])
... | ALGO | 0.99988 | 4.539079 |
e0060f31-00ef-446a-af4d-2605d03b2c2e | alexandraback/datacollection | solutions_5744014401732608_0/C++/codecracker4/#check3.cpp | //Author : Jatin Goyal
//codecracker4
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007 //NA
#define N 111111
#define ll long long int
#define dt int
#define all(c) c.begin(), c.end()
#define dcl(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(dt i=a;i<=(dt)(b);i++)
#define tr(container, it) for(vec... | ALGO | 0.999084 | 3.495673 |
cf77ffe6-5e59-4cfe-bb23-d8d3b15685ae | a-ddollar-cs/Portfolio | C++/Min Priority Queue/minpriority.cpp | /**
* @file minpriority.cpp Implements a min priority queue
*
* @brief implements a min priority queue which
* is a priority queue based on a min heap
*
* @author Austin Dollar
*
* @date March 9, 2020
*
*/
#include <fstream>
#include <functional>
#include <iostream>
#include <sstream>
#include <string>
#incl... | ALGO | 0.993598 | 4.75882 |
f8710ed2-175a-4367-afa9-a9b1e43d8474 | nperaya/nperayaLab13 | lab13_3.cpp | #include<iostream>
using namespace std;
void mySwap(int &,int &);
int main(){
int x,y;
cin >> x >> y;
cout << "Before swapping:\n";
cout << "x = " << x << ", y = " << y << "\n";
mySwap (x,y);
cout << "After swapping:\n";
cout << "x = " << x << ", y = " << y << "\n";
return 0;
}
void mySwap(int &x,int &y){
... | ALGO | 0.997056 | 4.482041 |
e1410980-5082-4dcf-a895-9a66f1e61c02 | chappi17/algorithm | algorithm/Programmers/LV.1/18.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string phone_number) {
string answer = "";
for (int i = 0; i < phone_number.size(); i++)
{
if (phone_number.size() - 4 <= i)
{
answer += phone_number[i];
}
else
... | ALGO | 0.99952 | 4.887609 |
cff26281-f273-4a50-85b2-ac846c79d722 | gyauelvis/DSA-IN-CODES | LeetCodeProblems/palindromeQuestion.cpp | // Given an array of strings words, return the first palindromic string in the array. If there is no such string, return an empty string ""
// A string is palindromic if it reads the same forward and backward.
// Ex 1:
// Input: words = ["abc","car","ada","racecar","cool"]
// Output: "ada"
#include <iostream>
#include... | ALGO | 0.999651 | 6.207404 |
14a7199a-de62-4e38-a9a0-d04600173e52 | brenimcode/CompetitiveProgramingSolving | matematica_computacional/Number Theory/miniCalculadora.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
int mdc(int a, int b){
if(b == 0) return a;
return mdc(b,a%b);
}
int mmc(int a,int b){
return (a*b)/mdc(a,b);
}
int32_t main(){
int c,d,q; // C = valor maximo da calc, D = dividendo, Q = divisor
cin >> c >> d >> q;
// Ver se... | ALGO | 0.999924 | 4.987985 |
67398918-7337-4c4f-9b1a-0332d8434779 | mahadodla4/Leetcode_solutions | 0189-rotate-array/0189-rotate-array.cpp | class Solution {
public:
void rotate(vector<int>& nums, int k)
{
k%=nums.size();
reverse(nums.begin(),nums.end());
reverse(nums.begin(),nums.begin()+k);
reverse(nums.begin()+k,nums.end());
}
}; | ALGO | 0.999987 | 6.059193 |
456a5923-7f3d-4ad1-b78e-7a881527fda4 | raincross7/code-similarity | codes/train_code/problem458/problem458_180.cpp | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(a) (a).begin(), (a).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
void solve()
{
string s;
cin >> s;
int n = s.size();
rep(i, n)
{
if (i == 0 || i % ... | ALGO | 0.999895 | 3.683392 |
080d690f-86cf-4ece-a80b-74623f999049 | Aryasharma001/Codeforces | CodeForces/GNU C++14/1721A | Image/170840630.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
string s1,s2;
cin>>s1;
cin>>s2;
int hsh[100]={0};
for(int i=0;i<2;i++){
hsh[int(s1[i]-'a')]++;
}
for(int i=0;i<2;i++){
hsh[int(s2[i]-'a')]++;
... | ALGO | 0.999929 | 4.251423 |
091ce7f3-76af-4937-bcd6-fa09f8cf7527 | takadashin/LeetCodeSolution | 622. Design Circular Queue/Solution.cpp | class MyCircularQueue {
struct QNode {
int val;
QNode* next;
QNode() {
val = -1;
next = NULL;
}
};
QNode* root;
QNode* tail;
int size;
public:
MyCircularQueue(int k) {
root = new QNode();
QNode* p = root;
k--;
... | ALGO | 0.999705 | 5.610209 |
d64465d5-0adb-452f-bce8-7cc53b5dc551 | martinbudden/SuperSlicer | src/libigl/igl/facet_components.cpp | template <typename DerivedF, typename DerivedC>
IGL_INLINE void igl::facet_components(
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedC> & C)
{
using namespace std;
typedef typename DerivedF::Index Index;
vector<vector<vector<Index > > > TT;
vector<vector<vector<Index > > > TTi;
... | ALGO | 0.935443 | 6.826066 |
73de01f8-bef9-4478-8d36-97ef03fbe5cb | silverwest8/Baekjoon | codePlus/Basic/Math/10430.cpp | #include <iostream>
int main(int argc, char* argv[]) {
int A, B, C;
std::cin >> A >> B >> C;
std::cout << (A+B)%C << "\n" << ((A%C) + (B%C))%C << "\n" <<(A*B)%C << "\n" << ((A%C) * (B%C))%C;
return 0;
} | ALGO | 0.999741 | 4.275404 |
ab88206b-550e-4eaf-ada7-552a8c1e48b6 | AparaV/project-euler | Problem 069/Problem_069.cpp | /* Problem 069: Totient Maximum
* Author: Aparajithan Venkateswaran
*/
#include <iostream>
#include <vector>
using namespace std;
vector<int> primeList(int upperLimit);
int answer() {
int n = 1, limit = 1000000, i = 0;
vector<int> primes = primeList(limit);
while (primes[i] * n < limit) {
n *= primes[i];
i... | ALGO | 0.999774 | 5.47539 |
c2b589d3-4fc7-47b2-b092-c4cc3ef3fec1 | hyunseok0114/iwallet | 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.998784 | 6.761023 |
f38e675e-e8a5-4907-8ce5-5e0bb6f32a36 | SetsunaChyan/OI_source_code | 2017-2018 Northwestern European Regional Contest (NWERC 2017)/F.cpp | #include <bits/stdc++.h>
using namespace std;
int n,a[1000005],L[1000005],R[1000005],last[10000005],fa[1000005];
vector<int> p[10000005];
void seive()
{
int n=10000000;
for(int i=2;i<=n;i++)
if(p[i].size()==0)
for(int j=i;j<=n;j+=i) p[j].push_back(i);
}
bool gao(int rt,int l,int r)
{
... | ALGO | 0.999993 | 3.296711 |
e2699113-df66-472e-9cb5-805b86d67f69 | ahahahahah1/CP | CodeForces/CPP_Codes/Contests/16th Dec/P4.cpp | #include <bits/stdc++.h>
using namespace std;
queue<pair<int,int>> q;
int main() {
int n, j, x, y, nums[n - 1], pow_2 = 2;
string s;
set<int> winning_nums;
pair<int, int> p, l;
cin >> n >> s;
if(s[n - 1] == '0')
q.push(make_pair(0, 1));
else
q.push(make_pair(1, 0));
... | ALGO | 0.999964 | 3.453483 |
0fe19caf-2dbe-4842-9a68-a0f06f12c416 | PRAKHARSAHUJI/Codeforces-Question | 900 RATING/Gravity_Flip.cpp | // https://codeforces.com/problemset/problem/405/A
// Implementation, Greedy Sortings
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
// sort(arr, arr + n, greater<int>());
sort(arr, arr + n... | ALGO | 0.999945 | 5.455498 |
ac5560c3-b2e2-4c30-970f-8527cc598768 | gawainx/buptac | 277.cpp | #include<cstdio>
#include<map>
#include<climits> //new things
using namespace std;
int buf[105];
int req[105];
int main(){
int T,N,M;
scanf("%d",&T);
while(T--){
map <int,int> loc;
map <int,int>::iterator j;//req-index
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("... | ALGO | 0.999878 | 3.15318 |
1cd4e9a2-1bf9-4b4d-8b53-c06d464e6b9a | uniqss/leetcodecpp | 0025/25_ReverseNodesinkGroup2.cpp | #include "../inc.h"
class Solution {
public:
ListNode* reverseKGroup(ListNode* head, int k) {
if (head == nullptr || head->next == nullptr || k <= 1) return head;
ListNode dummy(0, head);
ListNode* prev = &dummy;
while (true) {
head = prev->next;
ListNode*... | ALGO | 0.999225 | 5.709703 |
ff35a068-a75c-4f47-9710-96c099ee5245 | Tomcruseal/dImageProcessor | include/boost_1_77_0/libs/compute/perf/perf_stl_prev_permutation.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.996545 | 5.428024 |
166691d4-b0df-48d5-a7ff-7ce2599511f8 | navyg18/dsa-tracker | LinkedList-2/segregate012.cpp | ListNode *segregate012(ListNode *head)
{
ListNode*zero=new ListNode(-1);
ListNode*zero1=zero;
ListNode*one=new ListNode(-1);
ListNode*one1=one;
ListNode*two=new ListNode(-1);
ListNode*two1=two;
ListNode*temp=head;
while(temp){
if(temp->val==0){
zero1->next=temp;
... | ALGO | 0.999887 | 4.279079 |
c471e60f-0f9c-4260-ad91-ebab421d0aa9 | samuelzurowski/datastructures | lec05/Templates.cpp | #include <iostream>
#include <string>
#include "Pair.hpp"
#include "Stack.hpp"
// Function template
template <typename T>
T maximum(T a, T b){
return a > b ? a : b;
}
int main(void){
using namespace std;
cout << maximum<double>(1.0, 5.0) << endl;
cout << maximum<char>('w', 'a') << endl;
cout <<... | ALGO | 0.986642 | 4.518507 |
c2eb5274-335a-4e8f-988f-4e5cefe59465 | SeleDreams/godot-2-3ds | modules/chibi/cp_player_data_filter.cpp | /*************************************************************************/
/* cp_player_data_filter.cpp */
/*************************************************************************/
/* This file is part of: */
/* ... | CONFIG | 0.935214 | 4.054182 |
2fa8b86a-d836-4715-b65a-3f760aa6fc89 | whotfvasu/Leetcode | 235-lowest-common-ancestor-of-a-binary-search-tree/lowest-common-ancestor-of-a-binary-search-tree.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)
{
while (root)... | ALGO | 0.999993 | 6.296391 |
9e3f520d-1902-4b3f-a1e9-6a5de80da66b | moinymoh/Leetcode | 0062-unique-paths/0062-unique-paths.cpp | class Solution {
public:
int solve(int i, int j, int m, int n, vector<vector<int>>& dp) {
if(i >= m || j >= n) {
return 0;
}
if(i == m -1 && j == n - 1) {
return 1;
}
if(dp[i][j] != -1) {
return dp[i][j];
}
int righ... | ALGO | 0.999946 | 6.337214 |
7fc02d17-f687-40a6-9b34-277e82f7611c | WilliamLCobb/iNDS | desmume/src/android/7z/CPP/myWindows/mySplitCommandLine.cpp | #include "StdAfx.h"
#include "../Common/StringConvert.h"
#include "myPrivate.h"
#ifdef HAVE_LOCALE
#include <locale.h>
#endif
extern void my_windows_split_path(const AString &p_path, AString &dir , AString &base);
void mySplitCommandLine(int numArguments,const char *arguments[],UStringVector &parts) {
{ // defi... | TOOL | 0.935766 | 4.268727 |
5bbbd927-b1c5-4b97-96c6-c782571be4b1 | Christoph9402/CarND-Path-Planning-Project | src/Eigen-3.3/unsupported/doc/examples/MatrixSine.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
MatrixXd A = MatrixXd::Random(3,3);
std::cout << "A = \n" << A << "\n\n";
MatrixXd sinA = A.sin();
std::cout << "sin(A) = \n" << sinA << "\n\n";
MatrixXd cosA = A.cos();
std::cout << "cos(A) = \n" << cos... | ALGO | 0.949915 | 5.919294 |
612fb7d5-049c-4413-ae31-b10de26bbd3d | Alex2740/chwit-plays | broadcaster/sources/opencv/modules/ml/src/nbayes.cpp | #include "precomp.hpp"
namespace cv {
namespace ml {
class NormalBayesClassifierImpl : public NormalBayesClassifier
{
public:
NormalBayesClassifierImpl()
{
nallvars = 0;
}
bool train( const Ptr<TrainData>& trainData, int flags ) CV_OVERRIDE
{
CV_Assert(!trainData.empty());
... | ALGO | 0.99599 | 6.632894 |
81dfbc98-804f-4692-a75c-fe3106995d29 | SahilPrajapati/Coding-Practice | Linked Lists/82. Remove Duplicates from Sorted List ll.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* deleteDuplicates(ListNode* head)
{
ListNode* prev = NULL;
ListNode* node = head;
whi... | ALGO | 0.999924 | 5.663371 |
6982bc03-0d2c-4d95-8ca5-1083ddb94abd | NTMyDung/Demo | 148/main.cpp | #include <iostream>
using namespace std;
float gannhaunhat ( float a[], int n){ //ham tim khoang cach nho nhat cua 2 so trong mang
float kc=abs(a[1]-a[2]);
for( int i=1; i<n; i++){
for( int j=i+1; j<=n; j++){
if(abs(a[i]-a[j])<kc) kc=abs(a[i]-a[j]);
}
... | ALGO | 0.999898 | 3.649336 |
7b569eaf-fcf4-4f6e-9441-1b1d70217df9 | Rakeshducs/SOFTWARE-ENGINEER | DATA STRUCTURE/TestingBST.cpp | #include<iostream>
using namespace std;
class TestingBST
{
public:
struct Node
{
int data;
Node *next;
Node *prev;
}*temp,*first,*last;
TestingBST()
{
temp=NULL;
first=NULL;
last=NULL;
}
void insert();
// void rec_preorder(Node *);
void display();
};
void TestingBST::insert()
{
temp... | ALGO | 0.998996 | 4.560486 |
8f8aba16-05a8-4e90-8b95-e17018d93a96 | tr1ten/DNA | 575671J.cpp | #include <bits/stdc++.h>
using namespace std;
#define ss second
#define ff first
#define int long long
#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define per(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define tkv(vec,sz) rep(i,0,sz) cin>>vec[i]
#define srv(vec) sort(vec.begin(), vec.end())
#define all(x) x.begin... | ALGO | 0.99987 | 4.879244 |
ae1bed7f-90f7-4b93-a48a-ff2f4c0175d8 | chrwinkler/B-W.Algorithms-Data-Structures | Week 1-2/Week_02/point/test_point_plus.cpp | using namespace std;
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include <assert.h>
#include <vector>
#include "point_plus.h"
int main(int argc, char* argv[]) {
int i, j, cnt = 0, equ = 0;
if (argc != 3) {
cout << "Usage: test_point_plus n d" << endl;
return -1;
}
srand(time(0));
int N = at... | ALGO | 0.998387 | 4.080837 |
3e572096-1768-40b0-a457-fdd539eaf06e | WIZARD-CXY/pl | lintcode/uniquepaths.cpp | class Solution {
public:
/**
* @param n, m: positive integer (1 <= n ,m <= 100)
* @return an integer
*/
int uniquePaths(int m, int n) {
// wirte your code here
vector<int> dp(n,1);
for(int i=1; i<m; i++){
for(int j=1; j<n; j++){
dp[j]=d... | ALGO | 0.999977 | 6.03958 |
adfe1058-6a9f-4b45-8f49-a43c2fa83e5e | ishandutta2007/codeforces | bench0310/normal/461/B.cpp | #include <bits/stdc++.h>
using namespace std;
const long long mod=1000000007;
const int N=1000005;
vector<int> v[N];
vector<int> c(N,0);
vector<vector<long long>> dp(N,vector<long long>(2,0));
long long fpow(long long b,long long e)
{
long long res=1;
while(e)
{
if(e&1) res=(res*b)%mod;
b... | ALGO | 0.999954 | 3.629071 |
ff7ab34e-74fc-441d-a0c5-b52dd213944e | tlsgkdns/study | BfsAndDfs/21609_sharkMiddleSchool.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int rainbowBlk = 0, blackBlk = -1, emptyBlk = -2;
int dy[4] = { -1, 1, 0, 0 };
int dx[4] = { 0, 0, -1, 1 };
int N, M, score = 0;
vector<vector<int>> grid;
void applyGrav()
{
grid;
vector<int> bottom(N, N);
for (int i = N - 1; i >= 0... | ALGO | 0.999784 | 4.604716 |
f2ebe197-3a32-4e6e-85bf-3df1c256fc11 | kharismaharanii/Pemrograman-Dasar | Matriks/Matriks.cpp | #include <iostream>
#include <windows.h>
using namespace std;
int MatriksA[50][50];
int MatriksB[50][50];
int HasilJumlah[50][50];
int HasilKurang[50][50];
int HasilKali[50][50];
void Input_Nilai_Matriks(int BarisA, int KolomA, int BarisB, int KolomB);
void Output_Nilai_Matriks(int BarisA, int KolomA, int BarisB, in... | ALGO | 0.9976 | 4.238442 |
9ccc47f1-8a61-415a-b37c-1debe9a043f4 | DywangIT/PTIT-Programing | PTIT-C++/SAP_XEP_SINH_VIEN_THEO_LOP.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FASTER() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
// Dywang //
class NhanVien{
public:
string id, name, clas, mail;
public:
friend istream& operator >> (istream& in, NhanVien& a){
sca... | ALGO | 0.999048 | 3.918637 |
e505a8f1-4bbb-43ff-abe0-537add4c891b | LSH3333/PS | baekjoon/2206 (2).cpp | #include <iostream>
#include <queue>
using namespace std;
#define INF 100000000
int N, M;
char board[1010][1010];
int visited[1010][1010][2];
int dr[] = {-1,0,1,0};
int dc[] = {0,1,0,-1};
struct Info {
int r, c, wall;
};
void bfs() {
queue<Info> q;
visited[0][0][1] = 1;
visited[0][0][0] = 1;
q.p... | ALGO | 0.999938 | 5.119194 |
e69ccfb7-4f66-4481-b49f-852b2ccc9034 | wenjiesun1024/Leetcode | Cpp/601~1250 HardOnly/786. K-th Smallest Prime Fraction.cpp | class Solution {
public:
vector<int> kthSmallestPrimeFraction(vector<int>& A, int K) {
double left = 0, right = 1.0;
int n = A.size();
while (left < right) {
double mid = (right + left) / 2;
int cnt = 0;
vector<int> res{0, 1};
for(int i = 0, j ... | ALGO | 0.999964 | 5.174664 |
05d94fa9-81a7-4017-8dba-ea0222a04298 | nirvana369/UVA-problem-solved | 825.cpp | /*
Hoang Linh
*/
#include <cstdlib>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <iostream>
#define fi "825.inp"
#define fo "825.out"
/**/
using namespace std;
/**/
struct toado{
int x,y;
};
toado h[4] = {-1,0,
... | ALGO | 0.999581 | 4.017397 |
943240c4-a367-433c-9a15-cdd33a5eb8f8 | kmjp/procon | leetcode/biweekly/041-080/049/1814.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999899 | 5.480919 |
771ef5d5-dc40-49e2-8cdf-1521cb019231 | perchuts/CompetitiveProgramming | AtCoder/abc057/b.cpp | #include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define endl '\n'
#define pb push_back
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int ll
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ii = pair<int,int>;
us... | ALGO | 0.999986 | 4.540784 |
353080bb-ab54-4faf-afd4-1030e72e03b4 | cran/DStree | src/lik.cpp | #include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double lik(NumericVector S, NumericVector pi,
NumericVector ncens, NumericVector nuncens) {
int n = S.size();
double out=0;
for(int i=0;i<n;i++){
if(S[i]==0)
S[i]=1;
if(pi[i]==0)
pi[i]=1;
out+= nuncens[i]*lo... | TOOL | 0.977027 | 4.508415 |
f6044420-8d5d-4f6f-9a6d-08554d62be42 | VedikaJK/DSA-notebook | Graph/scc_kosaraju.cpp |
// Online IDE - Code Editor, Compiler, Interpreter
#include<bits/stdc++.h>
using namespace std;
/* ------------------------------
VERSION 1: RETURNS BOOLEAN IF GRAPH IS SCC OR NOT
*/
void dfs(vector<vector<int>> adj, int src, vector<bool>& vis){
vis[src]=true;
for(auto v: adj[src]){
if(!vis[v]... | ALGO | 0.999922 | 5.304167 |
c0ee5e71-fb5b-4ced-ab42-31ebb35931ad | ual/DOE-repo-deliverable | traffic-simulator-extended/LivingCity/traffic/cudaTrafficSimulator.cpp | #include "CUDATrafficSimulator.h"
//#include <cuda.h>
//#include "cudaCODE_trafficSimulator.h"
//#include "ModelVBO.h"
#include "../global.h"
#include "../LC_GLWidget3D.h"
#include "../LC_UrbanMain.h"
#include <thread>
#define DEBUG_TRAFFIC 0
#define DEBUG_SIMULATOR 0
namespace LC {
LCUrbanMain* clientMain;
//cons... | ALGO | 0.857322 | 3.17726 |
d7cb43ca-7fd4-4990-a8d3-f66740fc2f02 | Avishi2407/Leetcode-Solutions-in-Java-C- | 226-invert-binary-tree/invert-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.999972 | 6.444042 |
9485f53d-d914-4c4c-917a-e8e8ef91d88d | maurice-schuppe/my-sync | C_CPP_sync/cppds-4.1.5/source/testavl.cpp | #ifndef AVLTREE_CPP
#include "avltree.cpp"
#endif
#ifndef LONESTRING_H
#include "lonestr.h"
#endif
#include <iostream.h>
//=================================================================================
//
//-------------------------------------------------------------------------
//
// TESTBST.CPP -- Test... | TEST | 0.927031 | 5.836532 |
384d0248-a17e-4c22-9338-725b43c23779 | AkshatAggarwal14/cp-solutions | atcoder/abc241/B.cpp | #ifdef LOCAL
#include "Akshat.hpp"
#else
#include "bits/stdc++.h"
using namespace std;
#define dbg(...)
#endif
using ll = long long;
auto sz = [](const auto &container) -> ll { return ll(container.size()); };
#define all(x) (x).begin(), (x).end()
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
void Solution() {
ll n,... | ALGO | 0.999998 | 4.009357 |
552a28ed-7258-4d45-84d3-fe36df073363 | Varad163/DSA | Recursion/recursion6.cpp | #include <iostream>
using namespace std;
int factorial(int n)
{
// Base case
if (n == 0 || n == 1)
return 1;
return n * factorial(n - 1);
}
int main()
{
int num;
cout << "Enter a number: ";
cin >> num;
cout << "Factorial of " << num << " is " << factorial(num) << endl;
ret... | ALGO | 0.99803 | 5.491866 |
33e1f3c9-ca80-46e6-8077-4483f07008ff | BinomialSheep/CompetitiveCpp | AtcoderContest/ABCなにか20230209/D.cpp | #pragma region header
#include <bits/stdc++.h>
// デバッグ用マクロ:https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
using namespace std;
using ll = long long;
using vi = vector<int>... | ALGO | 0.999977 | 5.09557 |
c6145626-27f5-4198-a2ba-9629afb4dacf | bconfiden2/daily-ps | boj/2020/09.September/2193.cpp | #include <iostream>
using namespace std;
int n;
pair<unsigned long,unsigned long> nums[91]; // <끝이 0 으로 끝나는 숫자, 끝이 1 로 끝나는 숫자>
int main(void)
{
cin >> n;
nums[1] = {0, 1}; // 1자리 숫자는 1 밖에 없기 때문에 <0,1> 로 시작
for(int i = 2 ; i <= n ; i++) // 2자리 숫자부터 n 자리 숫자... | ALGO | 0.999924 | 3.821564 |
ade0346a-77d4-479b-b64d-5a947b82b86e | ProIModi/practice | 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.998799 | 6.776823 |
61caaac9-bb34-4452-89ac-7b941131734b | geitanksha/projects-software | c-cpp-projects/LeetCode-solutions/88. MergeSortedVectors.cpp | /**
* @file MergeSortedVectors.cpp
* @author <EMAIL>
* @brief 88. Merge Sorted Array
* @version 0.1
* @date 2022-07-19
*
* @copyright Copyright (c) 2022 // LeetCode
*
*/
class MergeSortedVectors
{
public:
void merge(vector<int> &nums1, int m, vector<int> &nums2, int n)
{
int i = m + n - 1;
... | ALGO | 0.999971 | 6.064097 |
f813da46-6aaf-4043-ae9f-5f03cc69b6e6 | bitsta/BitKey | src/lib/librootcoin.cpp | //###############################################################
//# project: librootcoin #
//# author: bitsta #
//# date: 26.11.2014 #
//# spec: Type-definition for librootcoin. #
//# version: 0.1 - THIS IS EXPERIMENTAL SOFTWARE! #
//######################################... | WEB | 0.911988 | 4.36035 |
d1af4ace-c066-4df7-bd45-ae82ce1aa01f | vucongtuanduong/cpp-codeptit | self/practice_final/16/2/2_1.cpp | #include <bits/stdc++.h>
using namespace std;
void testCase() {
long long n;
cin >> n;
long long a[n];
map<long long,long long> mp;
for (int i = 0; i < n; i++) {
cin >> a[i];
mp[a[i] % 28]++;
}
// for (auto x : mp) {
// cout << x.first << endl;
// }
long long... | ALGO | 0.999788 | 3.684413 |
2795d4ce-8d68-4df7-b47b-9b8a8ec4f22b | ERichman0/CSCI-1300 | hw5/insert.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int insert(int arr[], int numElements, int size, int newElement);
int main(){
}
int insert(int arr[], int numElements, int size, int newElement){
int pos;
if(size<=numElements){
return numElements;
}
for(int i=0; i<numElements; ... | ALGO | 0.999611 | 4.495581 |
a5d77f84-e870-47d0-a7c2-a82d65b75a57 | Mitesh12ehd/DSA | 16. Stacks/q25_number_of_nge_to_right.cpp | #include<iostream>
#include<vector>
#include<stack>
using namespace std;
//GFG
//Number of greater elements to the right
//see notes
//brute force
//time = O(queries * n)
//space = O(1)
vector<int> count_NGE(int n, vector<int> &arr, int queries, vector<int> &indices){
vector<int> ans;
for(auto index:indices... | ALGO | 0.99996 | 5.09706 |
6822fa49-a875-4f93-9086-caf7b0338146 | avniamitkumar/CODING-PLATFORM-PRACTICE | typeit_potd.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function template for C++
class Solution {
public:
string longestRepeatedSubstring(string str)
{
int n = str.length();
int LCSRe[n+1][n+1];
// Setting all to 0
memset(L... | ALGO | 0.999837 | 6.290868 |
890a393f-827c-4573-a86c-1e6b50e73857 | sanmitha-23/Cryptography | affine_cipher.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
string uc(string s)
{
string encry_uc = "";
for (int i = 0; i < s.length(); i++)
{
encry_uc += (s[i] - 32);
}
return encry_uc;
}
string encrypt(string msg, int k1, int k2)
{
string res = "";
for (int i =... | ALGO | 0.99986 | 4.384763 |
f6d2754f-5975-468e-906c-228dfbb76fbc | Ritax2003/GeeksForGeeks-POTD | Easy/Roman Number to Integer/roman-number-to-integer.cpp | //{ Driver Code Starts
// Initial template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution {
public:
int romanToDecimal(string &str) {
unordered_map<char,int>m;
m['I']=1;
m['V']=5;
m['X']=10;
m['... | ALGO | 0.999863 | 7.009477 |
a182f462-609b-473e-b23d-948a766ba220 | trzeciak20p/my-cses-solutions | sorting_and_searching/ferris_wheel/ferris_wheel.cpp | #include <iostream>
int main(int argc, char const *argv[])
{
int n = 0;
int x = 0;
std::cin >> n;
std::cin >> x;
int ppl[n]{};
for (int i = 0; i < n; i++)
{
std::cin >> ppl[i];
}
int gondolas_count = n;
for (int i = 0; i < n; i++)
{
if (ppl[i] > 0)
... | ALGO | 0.999977 | 4.51107 |
44b4b29b-3c28-4fe3-a94d-22f4ea080f3f | yetanothergeek/fxite | jef/compat.cpp | #include <fx.h>
#include "compat.h"
#ifdef WIN32
#include <windows.h>
#define _WIN32_IE 0x0400
#include <shlobj.h>
#include <sys/stat.h>
bool IsDir(const FXString &dn)
{
if (dn.empty()) { return false; }
struct stat st;
if (strchr("/\\", dn[dn.length()-1])) {
FXString tmp=dn.text();
tmp.trunc(dn.length(... | TOOL | 0.861919 | 5.7682 |
b564c7ba-6cb1-4879-868c-e7141491b405 | ishandutta2007/codeforces | sugim48/normal/1007/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
typedef long long ll;
typedef pair<int, int> i_i;
int main() {
int N; cin >> N;
map<int, int> mp;
rep(i, N) {
int x; scanf("%d", &x);
mp[x]++;
}
int rest = 0, ans = 0;
for (i_i z: mp) {
int x ... | ALGO | 0.99998 | 3.777902 |
e91cb105-9de4-4b3c-866a-0d6356941665 | TheDev05/CARDIO | Domains/Trees/LC814.cpp | #include <bits/stdc++.h>
using namespace std;
class TreeNode
{
public:
int val;
TreeNode *left, *right;
TreeNode(int temp)
{
this->val = temp;
this->left = this->right = NULL;
}
};
TreeNode *traverse(TreeNode *root)
{
if (root == NULL)
return NULL;
root->left = tr... | ALGO | 0.99994 | 5.067779 |
a8350efd-2c0a-4ac3-823e-fa2557ff0784 | EoinDavey/Competitive | Kattis/Kayaking_Trip.cpp | #include<bits/stdc++.h>
using namespace std;
constexpr int MX_N = 100001,INF=300000000;
int N,cnt[3],s[3],c[MX_N];
int ord[][2] = {{0,0},{0,1},{0,2},{1,1},{1,2},{2,2}};
bool check(int v){
int lcnt[] = {cnt[0],cnt[1],cnt[2]};
for(int i=0; i < N; ++i){
int mncst = INF;
int ans = 0;
for(... | ALGO | 0.999972 | 3.817003 |
e89b050b-596e-4287-9b0b-0770e0a1abb7 | rjsnhk/CSE205_DSA | UNIT 5/30/33/Mythili implement both Max Heap Sort and Min Heap Sort to compare their performance.cpp | #include <stdio.h>
void MaxHeapify(int arr[], int N, int i) {
int largest = i;
int left = 2 * i + 1;
int right = 2 * i + 2;
if (left < N && arr[left] > arr[largest])
largest = left;
if (right < N && arr[right] > arr[largest])
largest = right;
if (largest != i) {
int t... | ALGO | 0.999986 | 4.515375 |
37b8f9ec-77dc-476b-a715-616e9a65e61f | yjaiswal05/Face-recognition- | opencv/OpenCV 4.5.2.tar/opencv-opencv-39d2578/samples/cpp/tutorial_code/TrackingMotion/cornerSubPix_Demo.cpp | /**
* @function cornerSubPix_Demo.cpp
* @brief Demo code for refining corner locations
* @author OpenCV team
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace cv;
using namespace std;
/// Global variables
Mat src, src_gray;
int maxCorners = 10;
int maxTrackbar ... | ALGO | 0.999546 | 7.014394 |
c4f68491-a8bc-4db3-9f5a-9b19b0678f6e | Time1ess/MyCodes | LintCode/1304-H-Index/solution.cpp | class Solution {
public:
/**
* @param citations: a list of integers
* @return: return a integer
*/
int hIndex(vector<int> &citations) {
// write your code here
int n = citations.size();
sort(citations.begin(), citations.end());
for(int i = 0; i < n; i++) {
... | ALGO | 0.999974 | 6.196465 |
1b9cc2c8-4d6a-49a2-8109-438ea113ac24 | ishandutta2007/codeforces | hollwoq_pelw/normal/1328/F.cpp | #include <bits/stdc++.h>
using namespace std;
int64_t n, k, a[200002], x, y, z;
int main(){
cin >> n >> k;
for (int i = 0; i < n; i++) cin >> a[i];
sort(a, a + n);
for (int i = 0; i <= n-k; i++)
if (a[i] == a[i+k-1]) return cout << 0, 0;
for (int i = 0; i < n; i++){
if (i < k){
... | ALGO | 0.99995 | 3.976198 |
cb7cd4a4-8406-4cea-be00-9c1b68dde6db | CFXS/llvm-strip-l0 | llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | #include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/PDB/PDB.h"
#include "llvm/DebugInfo/PDB/PDBContext.h"
#include "llvm/DebugInfo/Symbolize/DIFetcher.h"
#include "llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h"
#inc... | TOOL | 0.877934 | 4.975757 |
6b1a2161-ffa3-43d4-9846-e483da4e1194 | Jiang0407/gratuation-code | eigen3/bench/benchmarkXcwise.cpp | // g++ -O3 -DNDEBUG benchmarkX.cpp -o benchmarkX && time ./benchmarkX
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef VECTYPE
#define VECTYPE VectorXLd
#endif
#ifndef VECSIZE
#define VECSIZE 1000000
#endif
#ifndef REPEAT
#define REPEAT 1000
#endif
int main(int argc, c... | ALGO | 0.983056 | 3.923818 |
625db49d-ef05-4403-bb0a-fe32cb58a5db | kaiesmahmud/structure-C-programming-solution-cse-113 | If-else/if-else 14.cpp | //Write a C program to calculate the profit or loss
#include<stdio.h>
int main()
{
int buy,sell ;
printf("\n Enter the selling rate of a product: ");
scanf("%d",&sell);
printf("\n Enter the buying rate of a product: ");
scanf("%d",&buy);
if (buy > sell) printf("\n Loss Amount is %d", buy-se... | ALGO | 0.998937 | 3.947391 |
38d44650-837a-4e59-bac6-1d7b6bcc3643 | yoloeww/strong | 2021.9.12.指针数组字符串不等长.cpp | # include<stdio.h>
# define N 4
# include<string.h>
int main(void)
{
void sort(char *p[]);
int i;
char *p[10],str[10][20];
for(i=0;i<N;i++)
p[i]=str[i];
printf("input ten string:\n");
for(i=0;i<N;i++)
scanf("%s",p[i]);
sort(p);
printf("now is :\n");
for(i=0;i<N;i++)
printf("%s\n",... | ALGO | 0.999738 | 3.547132 |
ba108f36-6731-4fc1-a8bd-8c179e0b8a71 | ywb2018/C-plus-plus | 剑指offer/第一个只出现一次的字符.cpp | //在一个字符串(0<=字符串长度<=10000,全部由字母组成)中找到第一个只出现一次的字符,并返回它的位置,
// 如果没有则返回 -1(需要区分大小写).
class Solution {
public:
int FirstNotRepeatingChar(string str)
{
map<char,int>my_map;
for(int i=0;i<str.size();i++)
my_map[str[i]]++;
for(int j=0;j<str.size();j++)
if(my_map[str[j]]==1)
... | ALGO | 0.999756 | 4.818897 |
d63bb1dc-6de5-445f-a476-ec01f9dc5f5c | g-nato/ACA-Project | OpenMP/main.cpp | #include "point.h"
#include "kmeans.h"
#include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <string>
#include <chrono>
#include <cstdlib>
#include <ctime>
int main(int argc, char* argv[]) {
if (argc != 5) {
std::cerr << "Uso: " << argv[0] << " <dataset_path> <num_clusters> <... | ALGO | 0.987631 | 5.603007 |
75e59da9-9abc-4c82-b11c-b70f6a5fb1ab | Lu-Yujie/BSX | utility/graphoperations.cpp | #include "graphoperations.h"
#include <memory.h>
#include <queue>
void GraphOperations::getKCore(const Graph *graph, int *core_table) {
int vertices_count = graph->getVerticesCount();
int max_degree = graph->getGraphMaxDegree();
int* vertices = new int[vertices_count]; // Vertices sorted by degre... | ALGO | 0.999747 | 4.523758 |
b80982d2-e56c-4029-88c7-1cdd6fa63e8f | AbhishekMaira10/InterviewPrep-CP | Practice/Miscellaneous/printpattern.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t,i,j;
cin>>t;
while(t--)
{
int n,k,first=1,diff=1;
cin>>n;
for(i=1;i<=n;i++)
{
int add=i;
for(j=1;j<=n;j++)
{
if(j==1)
{
cout<<first<<" ";
k=first;
}
else if(j!=1)
{
if((i+j)>(n+1))
... | ALGO | 0.999946 | 3.405452 |
97a07398-b4a5-453e-8e6d-e1ba4395b2c6 | yangsej/AlgorithmPractice | 알고리즘/h1SW.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <ctime>
using namespace std;
int main() {
int n, k, i;
FILE* fp = fopen("C:/Python27/randomcount.txt", "r");
fscanf(fp, "%d %d", &n, &k);
vector<int> v(n);
for (int i = 0; i < n; i... | ALGO | 0.999892 | 3.386237 |
6a38c82e-da3f-4d58-a57a-c0a150d4b8f6 | allwinner-ics/platform_external_llvm | lib/CodeGen/Splitter.cpp | #define DEBUG_TYPE "loopsplitter"
#include "Splitter.h"
#include "llvm/Module.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveStackAnalysis.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llv... | ALGO | 0.993824 | 5.33153 |
df0a9f89-1323-457f-a5a9-48c094879936 | ishandutta2007/codeforces | l1ll5/normal/1517/E.cpp | #include <bits/stdc++.h>
#define N 400005
#define LL long long
using namespace std;
inline int read()
{
int x=0,f=1;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
const int inf = 1000000000;
const int mod = 99824... | ALGO | 0.999891 | 3.705486 |
7b5dce38-f211-4408-8b8e-ec4f032955e9 | CodeWiz23/CodeExtraa | exam 07.cpp | //A class name intake 51.
// A nonmember function will compare the highest CGPA of two students
// and return which student has highest CGPA.
// A member function will display the student name who
// got the highest CGPA and his CGPA. Now implement the class.
#include<iostream>
using namespace std;
class intake51... | TOOL | 0.888581 | 4.247715 |
9a1df0bb-29ed-41d3-9ee5-a9daf62a7df6 | colinblundell/mojo-apps | third_party/skia/src/core/SkImageFilter.cpp | #include "SkImageFilter.h"
#include "SkBitmap.h"
#include "SkChecksum.h"
#include "SkDevice.h"
#include "SkLazyPtr.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkRect.h"
#include "SkTDynamicHash.h"
#include "SkTInternalLList.h"
#include "SkValidationUtils.h"
#if SK_SUPPORT_GPU
#include "GrContext.... | TOOL | 0.892982 | 7.395078 |
90d40565-e510-4728-ad6d-abee846fca80 | tklenze/monosat-ctl | geometry/PointSet.cpp | #include "PointSet.h"
#include <algorithm>
template<>
void PointSet<2, double>::buildClockwise() {
points_clockwise.clear();
double centerX = 0;
double centerY = 0;
for (auto & p : points) {
centerX += p.x;
centerY += p.y;
}
centerX /= points.size();
centerY /= points.size();
//from http://stackoverflow.c... | ALGO | 0.999324 | 5.632265 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.