uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fce13f75-cfea-433f-898d-8fecc41daac0 | D3v3sh5ingh/Code | temp/rph001.cpp | #include <iostream>
#include<string>
#include<algorithm>
using namespace std;
#define lli long long int
lli rev(lli num)
{
lli rev_num = 0;
while (num > 0)
{
rev_num = rev_num*10 + num%10;
num = num/10;
}
return rev_num;
}
int main()
{
int t;
cin>>t;
while(t--)... | ALGO | 0.999759 | 5.274692 |
7b3011fb-c52c-4e90-bc23-e2b5d3fe6f58 | arunnsit/allcodes | files/pattern.cpp | #include<stdio.h>
int main()
{int i=0,j=1,k=1,col,row=1,n;
scanf("%d",&n);
while(row<=n)
{i=0;j=1;k=1;
while(j<=n-row+1){printf("*");j++;}j=1;if(row==1){j++;}
while(k<=2*row-3){printf(" ");k++;}
while(j<=n-row+1){printf("*");j++;}
printf("\n");row++;
}row--;
while(row>0)
{i=0;j=1;k=1;
while(j<=n-row+1){printf("*");j++;... | ALGO | 0.999964 | 3.145765 |
017bfb4d-f9ab-4a3a-99f2-e300f3d676d8 | Jhn63/Heuristic_Algorithms_TSP | neighborhood.cpp | #include "neighborhood.h"
void swap(Solution &s, int i, int j) {
std::vector<int>::iterator it1, it2;
s.cost += compute_swap(s,i,j);
it1 = s.route.begin() + i;
it2 = s.route.begin() + j;
std::swap(*it1, *it2);
}
double compute_swap(Solution &s, int i, int j) {
Data data = Data::getInstanc... | ALGO | 0.999988 | 4.799995 |
67b7f99e-c81e-42f8-b0c2-be364e2048ff | Kimjimmy/Algoritm | BOJ/String_deque_5430.cpp | #include<iostream>
#include<algorithm>
#include<deque>
#include<string>
#include<sstream>
using std::cout; using std::cin;
using std::deque; using std::string;
int n, t;
string p;
string s_arr;
deque<int> split(string input, char delimeter) {
deque<int> answer;
input.erase(input.begin()); //input.erase(0) '['
... | ALGO | 0.999349 | 5.273403 |
54b5d302-ae6f-44e6-8c1d-9f80f973021d | Rhysoshea/daily_coding_challenges | other/cpp_exercises/maps.cpp | // Map Template:
// std::map <key_type, data_type>
// Declaration:
// map<string,int>m; //Creates a map m where key_type is of type string and data_type is of type int.
// Size:
// int length=m.size(); //Gives the size of the map.
// Insert:
// m.insert(make_pair("hello",9)); //Here the pair is inserted into the ma... | ALGO | 0.998203 | 4.750288 |
a74b82c5-4291-44d8-8a2a-28470d0993b0 | JeongGoEun/algorithm_study | Programmers/징검다리.cpp | #include <string>
#include <vector>
#include<iostream>
#include<algorithm>
using namespace std;
int solution(int distance, vector<int> rocks, int n) {
int answer = 0;
sort(rocks.begin(), rocks.end());
long long mid=0, s=1, e=distance;
while (s <= e) {
int cnt = 0, prev = 0;
mid = (s + ... | ALGO | 0.999873 | 4.988551 |
a4e4fa98-a70b-4467-af34-a5e130b33416 | thesilentline/DSA-code_on_every_line | dynamicprogramming/optimalstrategy.cpp | //~ author : DSB
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define ll long long
#define pint pair<int,int>
#define plong pair<long long,long long>
#define vlong vector <long long>
#define vint vect... | ALGO | 0.999991 | 3.89079 |
c14c9c92-a08f-49cf-8b4d-7081902e513d | singhpranshu72/My-LeetCode-Solutions | Express as sum of power of natural numbers - GFG/express-as-sum-of-power-of-natural-numbers.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{
private:
int recu(vector<int> &v, int target, int p, int idx, vector<vector<int>> &dp){
if(target == 0) return 1;
if(idx==0) retu... | ALGO | 0.999827 | 5.957533 |
0a1dc60a-6628-4c22-9c5e-a649ca45dc12 | cyrustabatab/C- | iterators.cpp | #include <iostream>
#include <vector>
void display(const std::vector<int>& nums) {
for(auto num: nums) {
std::cout << num << ' ';
}
std::cout << std::endl;
}
int main() {
std::vector<int> nums{1,2,3,4};
std::vector<int> neg_nums{-2,-1};
display(nums);
nums.insert(nums.beg... | ALGO | 0.996272 | 5.044472 |
75b58ab5-c2da-43f0-8e56-e8f0ef5e0f3f | shawn233/OnlineJudge | Sjtu-OJ/1234/main.cpp | #include <iostream>
#include <cstdio>
using namespace std;
class OutOfBound {};
class DisjSets {
public:
explicit DisjSets(int numElements) ;
int find (int x) const;
int find (int x) ;
void unionSets(int root1, int root2);
private:
int * arr;
int length;
};
template <class elemType>
class seqQueue {
privat... | ALGO | 0.999901 | 3.705474 |
a9aea1c7-0e6f-4955-b61b-6ef1063d2df4 | Anup050/DSA | 0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.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* deleteDupli... | ALGO | 0.999945 | 6.28531 |
2cde4db3-839b-482e-aade-534e7d9bae74 | Zamanof/CPP_FSDE_Oct_24_8_ru | CPP 13. Reference/Reference.cpp | #include<iostream>
using namespace std;
void changeValuePtr(int* number) {
*number += 10;
}
void changeValueRef(int& number) {
number += 10;
}
void swapPtr(int* left, int* right) {
int tmp = *left;
*left = *right;
*right = tmp;
}
void swapRef(int& left, int& right) {
int tmp = left;
left = right;
right = t... | ALGO | 0.993277 | 4.136945 |
92773015-e4f0-4b52-bf52-29b6b50db102 | GeCao/LBM-SC-method | LBM_D2Q9_IBM.cpp | #include "LBM_D2Q9_IBM.h"
void LBM_D2Q9_IBM::dump_file(string filename) {
int i = 0, j = 0, k = 0, rr = 0;
FILE* fp;
//Compute Vorticity.
int ileft = 0, iright = 0, jup = 0, jdown = 0;
#pragma omp parallel for private(i, j, ileft, iright, jup, jdown)
for (i = 0; i <= l; i++) {
ileft = (i > 0) ? (i - 1) : (l);
... | ALGO | 0.995942 | 3.735473 |
9bae73bb-02ec-4264-87f7-7d63d42fbd79 | HandsomeLuoyang/alalgorithm_2024 | leetcode/dynamic_programming/2466-count-ways-to-build-good-strings.cpp | /**
* Created by leiyang on 2024/6/3 15:55
*/
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int countGoodStrings(int low, int high, int zero, int one) {
int MOD = 1e9 + 7;
vector<int> dp(high + 2, 0);
// f(i) = f(i-zero)+f(i-one)
dp[0] = 1;
int an... | ALGO | 0.999949 | 5.130936 |
4709c9c9-fa37-4c78-85eb-d9fea3d3988f | Harsh-rjn21/cp | two pointers/stylish_cloth.cpp | /*Gleb loves shopping. Once, he got the idea to choose a cap, a shirt, pants and shoes so that they look as stylish as possible. In Gleb's understanding clothes are more stylish when the difference in color of the elements of his clothes is small.
There are n1 caps, n2 shirts, n3 pants and n4 shoes (1≤ni≤100,000). Eac... | ALGO | 0.999975 | 3.328849 |
0fc15e7d-148c-4a19-a195-2ad169f953a2 | LiquidPlayer/LiquidCore | deps/boost_1_66_0/libs/math/example/numerical_derivative_example.cpp | #ifdef _MSC_VER
# pragma warning (disable : 4996) // assignment operator could not be generated.
#endif
# include <iostream>
# include <iomanip>
# include <limits>
# include <cmath>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_floating_point.hpp>
#include <boost/math/special_functions/next.hpp>... | ALGO | 0.997656 | 7.277137 |
7d158cc3-6679-4333-b798-6934734ec4ff | iamrahman/DataStructure | Stack/Balance_paranthesis.cpp | #include <iostream>
using namespace std;
#define MAX 25
int top = -1;
char stack[MAX];
void push(char ch){
top = top+1;
stack[top] = ch;
}
int checkBalance(string str, int l){
int result = 0;
for(int i=0;i<l;i++){
if(str[i]=='[' || str[i]=='{' || str[i]=='('){
push(str[i]);
}
else{
if(str[i] == ')'){... | ALGO | 0.997348 | 5.216681 |
3acb592b-7f2f-463e-ae91-580b847e05c5 | TanmayVig/6Companies30days | day21-25[Intuit]/t5q13.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int minSwaps(vector<vector<int>> &grid)
{
int n = grid.size();
vector<int> t(n);
for (int i = 0; i < n; i++)
{
int count = 0;
for (int j = n - 1; j >= 0 && grid[i][j] == 0; j--)
... | ALGO | 0.999975 | 5.273683 |
a4a42ce9-37e1-45ce-8c14-a7b258d81cbf | netpipe/CDIFF | stable-diffusion.cpp/ggml/examples/simple/simple-ctx.cpp | #include "ggml.h"
#include "ggml-cpu.h"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <map>
#include <string>
#include <vector>
// This is a simple model with two tensors a and b
struct simple_model {
struct ggml_tensor * a;
struct ggml_tensor * b;
/... | ALGO | 0.92793 | 6.212088 |
d6798133-a0d3-4b67-8056-77d7ceac20e2 | Neel16/HackerRank-CPP | Classes/VirtualFunctions.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
class Person{
protected:
int age;
string name;
public:
Person(){
age=0;
name ="";
}
~Person(){}
virtual void getdata(){
cin>>name>>age;
... | ALGO | 0.934827 | 3.337772 |
3d33c1e8-b352-4113-a34c-24bb4adb458b | Robin329/CPlusPlusThings | learn_algorithms/leetcode/1_Inverted_bits.cpp | //
// Created by renbin jiang on 2021/4/5.
//
//*************************************************
//题目:
//
//颠倒给定的 32 位无符号整数的二进制位。
//
//提示:
//
//请注意,在某些语言(如
// Java)中,没有无符号整数类型。在这种情况下,输入和输出都将被指定为有符号整数类型,
// 并且不应影响您的实现,因为无论整数是有符号的还是无符号的,其内部的二进制表示形式都是相同的。在
// Java 中, 编译器使用二进制补码记法来表示有符号整数。因此,在上面的 示例 2
// 中,输入表示有符号整数 -3,输出... | ALGO | 0.999747 | 5.682231 |
badd2613-b41c-41f0-a24d-3c4f4c440094 | MerrriMari/AbstractionSeminars | AbstractionCodes/Sem11/Sem1_1.cpp | //
// Sem1_1.cpp
// Blank Project
//
// Created by Mariam Samkharadze on 19.04.24.
//
#include <stdio.h>
#include "console.h"
#include "simpio.h"
#include "grid.h"
#include <fstream>
#include "tokenscanner.h"
// 2
bool isLinkWithAll(Grid<bool> &grid, Vector<int> graph, int curr) {
for(int i = 0; i < graph.size... | ALGO | 0.998744 | 4.719945 |
f34e68f9-b182-4d92-9c74-232295ecee92 | Fovir-GitHub/My_Algorithm | LeetCode/561.array-partition/561.array-partition.cpp | /*
* @lc app=leetcode id=561 lang=cpp
*
* [561] Array Partition
*/
#include <bits/stdc++.h>
using namespace std;
// @lc code=start
class Solution {
public:
int arrayPairSum(vector<int> & nums) {
int sum = 0;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size(); i += 2)
... | ALGO | 0.999721 | 6.090842 |
c9a31d51-17e0-467e-9b28-be09a4dd2d59 | ADITYAGABA1322/DSA-using-C---and-C | PriorityQueue.cpp | // // Heap.cpp
// #include <iostream>
// #include <queue>
// #include <vector>
// using namespace std;
// class PriorityQueue
// {
// vector<int> pq;
// public:
// bool isEmpty()
// {
// return pq.size() == 0;
// }
// int getSize()
// {
// return pq.size();
// }
// int ... | ALGO | 0.999328 | 4.799903 |
80961706-0a76-455e-acd4-edfc67936fd0 | LonxunQuantum/Lammps_for_PWMLFF | lammps_neigh_mlff_20230508/src/SPIN/pair_spin_magelec.cpp | // clang-format off
/* ------------------------------------------------------------------------
Contributing authors: Julien Tranchida (SNL)
Aidan Thompson (SNL)
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massivel... | TOOL | 0.979859 | 7.228565 |
8bd79597-5cd5-4da0-98e4-407af0e70ec6 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11843_11.cpp | #include <bits/stdc++.h>
#pragma GCC optimize "O3,no-stack-protector"
using namespace std;
const int MAXN = 1e5 + 7;
vector<int> G[MAXN];
bool blo[MAXN];
short odw[MAXN];
bool tried[MAXN];
int n, m;
bool dfs(int v) {
if (blo[v] == true) return false;
odw[v] = 1;
for (auto w : G[v]) {
if (odw[w] == 0) {
... | ALGO | 0.999962 | 4.457669 |
f90b36f5-58c0-4a32-a414-5e78dc6fd82d | Bibobaer/Third_Semestr | C++/Matrix/Matrix/main.cpp | #include "Matrix.h"
int main(void) {
Matrix mat(std::cin);
Matrix A(std::cin);
mat = mat * A;
mat.Print();
return 0;
} | ALGO | 0.986571 | 3.567694 |
60de99a0-f970-4362-9968-94bc43d1d11e | devangi2000/Data-Structures-Algorithms-Handbook | Linked-Lists/OddEvenLinkedList328.cpp | // Given the head of a singly linked list, group all the nodes with odd indices together
// followed by the nodes with even indices, and return the reordered list.
// The first node is considered odd, and the second node is even, and so on.
// Note that the relative order inside both the even and odd groups should rem... | ALGO | 0.999974 | 6.211787 |
9a753b98-3c22-4bdb-95ef-3bc25e76de1f | DimishRegmi/assignmentcp | 35.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
cout << "Enter a string: ";
cin >> str;
int start = 0;
int end = str.length() - 1;
while (start < end)
{
char temp = str[start];
str[start] = str[end];
str[end] = temp;
star... | ALGO | 0.985147 | 5.567171 |
fb42ab0d-f4ad-407a-a38c-12bf1e62d0c2 | peterspackman/occ | src/3rdparty/libecpint/Q022.cpp | namespace libecpint {
namespace qgen {
void Q0_2_2(const ECP& U, const GaussianShell& shellA, const GaussianShell& shellB, const FiveIndex<double> &CA, const FiveIndex<double> &CB, const TwoIndex<double> &SA, const TwoIndex<double> &SB, const double Am, const double Bm, const RadialIntegral &radint, const AngularIntegr... | ALGO | 0.992976 | 3.611893 |
2b45d659-f29c-4a46-a896-0fe6df81ace6 | SUBHAJITMONDAL-03/Leetcode_Question_Solving | Seating Arrangement - GFG/seating-arrangement.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function Template for C++
//User function Template for C++
class Solution{
public:
bool is_possible_to_get_seats(int n, int m, vector<int>& seats){
// Write your code here.
... | ALGO | 0.999874 | 6.526275 |
4ef47a64-f3fb-4cff-acb5-4e61a946517a | linneszyx/DSA-2 | Stack and Queue/redundamt_paranthesis.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkRedundant(string str)
{
stack<char> s;
for (char ch : str)
{
if (ch != ')')
{
s.push(ch);
}
else
{
bool operater_found = false;
while (!s.empty() and s.top() != '(')
... | ALGO | 0.999691 | 5.030527 |
eda30650-4eec-4ca9-8382-88f953313b0d | MiGene/Algorithm | n-queen/main.cpp | #include <iostream>
#include<vector>
#include<queue>
using namespace std;
bool check(vector<int> vec, int ind){
for (int i=1; i<ind; i++){
int dx = abs(vec[i] - vec[ind]);
int dy = abs(i - ind);
//cout <<"//" <<dy << " "<<dx << "//";
if (dy == dx) return false;
}
return tr... | ALGO | 0.999855 | 4.108833 |
c2d9f63d-5c74-46e2-9894-4a0dfc74b742 | NikhilK06/Leet | solutions/1737. Change Minimum Characters to Satisfy One of Three Conditions/1737.cpp | class Solution {
public:
int minCharacters(string a, string b) {
const int m = a.length();
const int n = b.length();
vector<int> countA(128);
vector<int> countB(128);
for (const char c : a)
++countA[c];
for (const char c : b)
++countB[c];
int ans = INT_MAX;
int prevA = ... | ALGO | 0.999961 | 5.828488 |
bb3c9f17-31ee-443f-9bad-dd4665dfa2c0 | ArtNazarov/leetcode-solutions | 3353-existence-of-a-substring-in-a-string-and-its-reverse/existence-of-a-substring-in-a-string-and-its-reverse.cpp | #include <algorithm>
using namespace std;
class Solution {
public:
bool isSubstringPresent(string s) {
string rv = s;
string v = s;
reverse(rv.begin(), rv.end());
int rotation = 0;
int g = 2;
do {
for (int k = 1; k<=s.size()-1; k++){
... | ALGO | 0.999904 | 5.496912 |
34dd09a8-09ca-4f8a-8bc8-d3d8edb5b80a | kriaaa/CrackYourPlacement | 0908-middle-of-the-linked-list/0908-middle-of-the-linked-list.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 *... | ALGO | 0.999859 | 5.441525 |
9d1eb533-44c3-4bf3-a02f-3390b999cbda | ahmedSamy22/social_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
e5a13e53-a856-4fa2-abb0-fef86ba4cbdf | alexandraback/datacollection | solutions_2463486_0/C++/yyysb/c.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
long long l[1000];
int T,n;
long long a,b;
char s[100];
bool check(long long t){
sprintf(s,"%lld",t);
int m = strlen(s);
for(int i=0; i<m; ++i)
if(s[i]!=s[m-i-1]) return false;
re... | ALGO | 0.99965 | 3.995669 |
71202e8a-31de-474d-b1f8-a06a743f1584 | TejaswiniKurade/Code | 7252/7256/thrededbinary.cpp | #include <bits/stdc++.h>
using namespace std;
int MAX_VALUE=66666666;
int n=0;
class Node
{
public:
int key;
Node *left, *right;
bool leftThread, rightThread;
Node(){
left=NULL;
right=NULL;
key=0;
leftThread=false;
rightThread=false;
... | ALGO | 0.999768 | 4.320066 |
c19ce90c-35db-498a-98b6-cddef6f52b47 | aiurmanzarhanov/CPP_2023 | Task_1_S41.cpp | #include <iostream>
using namespace std;
int squared_sum(double a, double b){
double c;
c = (a + b)*(a+b);
return c;
}
int main(){
setlocale(0, "Russian");
double a, b;
cout<<"Введите первое число:";
cin>>a;
cout<<"Введите второе число:";
cin>>b;
cout<<"Квадрат суммы чисел равен:"<<squared_sum(... | ALGO | 0.997667 | 4.211811 |
5c4f5f99-702e-4589-84d4-bfecd49260d3 | zhongchong7/opencalib | lidar2camera/joint_calib/src/lidar2camera.cpp | #include <fstream>
#include <iostream>
#include <sstream>
#include "camera_calibrator.hpp"
int main(int argc, char **argv) {
if (argc != 3) {
std::cout << "Usage: ./main camera_dir csv file"
"\nexample:\n\t"
"./bin/lidar2camera data/intrinsic/ data/circle.csv"
<< ... | TOOL | 0.883101 | 5.79838 |
b2b93e60-0811-49e1-a5df-61dbc11079bb | galacticglum/casino-game-simulations | simulate_probabilities.cpp | /**
* Simulates the probabilities.
*/
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <random>
#include <iterator>
typedef unsigned long long ull;
#define TRIALS 100000000
#define MARBLE_COUNT 4
#define MAX_SUM 24
const std::vector<int> board = {
4, 3, 2, 4, 1, 4, 2... | ALGO | 0.999176 | 5.433042 |
f8eb60ea-9563-4d6e-ba49-e676dbaf747e | Generalnuh/open-cv | modules/features2d/src/affine_feature.cpp | /*
Guoshen Yu, Jean-Michel Morel, ASIFT: An Algorithm for Fully Affine
Invariant Comparison, Image Processing On Line, 1 (2011), pp. 11-38.
https://doi.org/10.5201/ipol.2011.my-asift
*/
#include "precomp.hpp"
#include <iostream>
namespace cv {
class AffineFeature_Impl CV_FINAL : public AffineFeature
{
public:
... | ALGO | 0.992557 | 6.87281 |
d692a654-83e5-4c0a-a011-51e2dcfd5018 | Coconut-X/30DaysOfLeetCode | 2571-find-the-pivot-integer/find-the-pivot-integer.cpp | class Solution {
public:
int pivotInteger(int n) {
for(int i=1;i<=n;i++)
if(2*i*i==n*(n+1)) return i;
return -1;
}
}; | ALGO | 0.999815 | 5.847517 |
7e35864d-33fa-4f21-9b9a-98f9d81564f0 | iamendless10/leetcode | 15-3sum/3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> res;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size(); i++) {
if (i > 0 && nums[i] == nums[i-1]) {
continue;
}
int j... | ALGO | 0.99995 | 6.270833 |
c591b31e-299d-47f2-a9ec-c46e0917ede8 | shvshn/dsa-cpp | patterns and basics/pattern18.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n = 5;
for(int i = 0; i < n; i++) {
char ch = 'E'-i;
for(int j = 0; j <= i; j++) {
cout << ch;
ch++;
}
cout << endl;
}
return 0;
}
| ALGO | 0.999741 | 3.589416 |
c29b6890-7af7-4238-b26e-6514ce90e9a4 | robparrish/lightspeed | src/cpp/intbox/intbox.cpp | #include <lightspeed/intbox.hpp>
#include <lightspeed/tensor.hpp>
#include <lightspeed/resource_list.hpp>
#include <lightspeed/pair_list.hpp>
#include <lightspeed/ecp.hpp>
#include <lightspeed/ewald.hpp>
namespace lightspeed {
namespace {
bool is_terachem_ready(
const std::shared_ptr<ResourceList>& resources,
... | ALGO | 0.976816 | 5.275076 |
cd8df749-adf6-408b-a9d6-6d272dd7001c | pamaral148/cpp | part_one/Assignment02/Assignment02/main.cpp | //
// main.cpp
// Assignment02 for Comp 2617
//
// Created by Paulo Amaral on 2014-10-02.
//
#include <iostream>
#include <iomanip>
using namespace std;
const long double MIN_TERM = 1.0E-20; // minimum term result to kill loop in part 3 function
long long computeFactorial(int base); // factorial computing functi... | ALGO | 0.999664 | 4.438129 |
fac27cf5-75db-4dbe-adfe-1011cbf1167d | create-dan/CP-DSA__Templates_Level3 | AA-oops/heapify.cpp | // C++ code to depict
// the implementation of a max heap.
#include <bits/stdc++.h>
using namespace std;
// A class for Max Heap.
class MaxHeap {
// A pointer pointing to the elements
// in the array in the heap.
int* arr;
// Maximum possible size of
// the Max Heap.
int maxSize;
// Number of elements in the... | ALGO | 0.999932 | 5.425126 |
a5a3cc17-9091-42bc-a248-281fef8a29fc | ResilientSpring/C-Plus-Plus_homogeneous | CH44-Algorithms/transform() options and alternatives 2/midpoint.cpp | // Demonstrate the transform() algorithm.
//
// Both versions of transform() are used within the program.
// The first alters the sequence of doubles so that it contains reciprocal values.
// The second creates a sequence that contains the midpoints between the values in
// two other sequences.
#include <iostream>
#... | ALGO | 0.998836 | 6.108304 |
94c46097-14bd-4bfa-83df-292f15ce443b | ishandutta2007/codeforces | cheissmart/normal/600/B.cpp | #include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl
using namespace std;
typede... | ALGO | 0.999996 | 3.999265 |
782f25ef-e5a9-4434-8e08-6439e6285375 | Akash-Chowdhury/Leetcode-Practice | Generate Parentheses - GFG/generate-parentheses.cpp | //{ Driver Code Starts
//Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
vector<string> AllParenthesis(int n) ;
// } Driver Code Ends
//User function Template for C++
// N is the number of pairs of parentheses
// Return list of all combinations of balanced parantheses
class Solution
{
publ... | ALGO | 0.999665 | 6.24433 |
52513e19-e1c8-4fc7-b9c2-bb097348570f | tayu0110/atcoder | abc/abc217d.cpp | #include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
using namespa... | ALGO | 0.999792 | 3.769585 |
e2d772a7-8f72-4057-9dc1-adbc34817213 | HexHive/Sourcerer | libcxx/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp | // <algorithm>
// template<RandomAccessIterator Iter>
// requires ShuffleIterator<Iter> && LessThanComparable<Iter::value_type>
// constexpr void // constexpr in C++20
// pop_heap(Iter first, Iter last, Compare comp);
#include <algorithm>
#include <cassert>
#include <functional>
#include "test_macros.h"
#incl... | TEST | 0.961778 | 5.987416 |
fe37038f-5993-4c3f-b92d-adc9496dca6d | PiotrChmielewski01/Sorting_Algorithms | lab1.cpp |
#include <iostream>
#include <fstream>
#include <string>
#include <conio.h>
#include <chrono>
#include <windows.h>
#include <map>
#include <sstream>
#include <list>
#include <algorithm>
using namespace std;
///////////////////// config //////////////////////////////
map<string, string> load_config(string... | ALGO | 0.99741 | 4.396048 |
dd837c91-d94f-4256-9715-272e2ecaa1da | jszhujun2010/LeetCode | getIntersectionNode/main.cpp | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x): val(x), next(NULL) {}
};
class Solution {
public:
ListNode *getIntersectionNode(ListNode *headA, ListNode *headB) {
if (headA == NULL || headB == NULL)
return NULL;
ListNod... | ALGO | 0.99985 | 4.915547 |
427383a5-6db1-4a2a-a578-f2e3170cf308 | alexandraback/datacollection | solutions_5658282861527040_1/C++/StephYDX/main.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int bitat(long long x, int pos) {
return (x >> pos) & 1;
}
long long A, B, K;
long long memo[32][2][2][2];
long long dp(int i, int a, int b, int k) {
if (i >= 32) {
return a && b && k;
}
long long &ret = memo[i][a]... | ALGO | 0.999699 | 4.709148 |
a614ea38-b4f7-499a-99b8-9e6a626a5f83 | migowav/LabWinter24 | Homework/MiguelFlores_Assignment_1/Gaddis_9thEd_Chap2_prob4_RestrauntBill /main.cpp | /*
* File: main.cpp
* Author: Miguel Flores
* Created on January 6, 2024, 5:32 PM
* Purpose: Circuit Board Pricing
*/
//System Libraries
#include <iostream> //Input-Output Library
using namespace std;
//User Libraries
//Global Constants- Math,Physics,Chemistry,Conversions
const float proft_prcnt = 0.35; ... | ALGO | 0.977151 | 3.923827 |
7229999a-c1e0-4c7f-b1ff-2638a7b0f247 | xtstc131/mall0x_Leetcode | Patterns/In-placeTraversalOfLinkedList/206_reverse_linked_list.cpp | #include "header.hpp"
// Definition for singly-linked list.
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(nullptr) {}
};
class Solution
{
public:
ListNode *reverseList(ListNode *head)
{
ListNode *pre = nullptr;
auto cur = head;
while (cur)
... | ALGO | 0.999916 | 5.542309 |
42094dcc-6072-43a0-b650-4147d4b9f383 | ayushikhandelwal99/C_basic_to_adv | DSA/Stack_in_C_plusplus.cpp | #include<iostream>
using namespace std;
class STACK
{
private:
struct node
{
int data;
node *next;
}*TOP = NULL;
public:
STACK()
{
TOP = NULL;
}
void push(int);
void pop(void);
void peek(void);
void display(void);
void search(int);
};
void STACK::push(int num)
{
node *temp;
temp = new... | ALGO | 0.991426 | 3.618583 |
905fb87a-267b-4ace-bfcb-e98b7210ea9b | LBiff/subjects_2020 | CanWinNim.cpp | //你和你的朋友,两个人一起玩 Nim 游戏:桌子上有一堆石头,每次你们轮流拿掉 1 - 3 块石头。
// 拿掉最后一块石头的人就是获胜者。你作为先手。
// 你们是聪明人,每一步都是最优解。 编写一个函数,来判断你是否可以在给定石头数量的情况下赢得游戏。
bool canWinNim(int n)
{
return n % 4;
} | ALGO | 0.995707 | 4.760466 |
9d7ed121-721f-454b-bb8c-4969ace2da84 | andrewsmith1996/C-Plus-Plus-Tasks | pointerarithmetic.cpp | #include <iostream>
int main() {
int array[10];
int* index = array;
//Prints Location of array in memory
std::cout << index << std::endl;
int* indexCount = &array[0];
//Prints Location of first element of array in memory
std::cout << indexCount << std::endl;
//... | ALGO | 0.927327 | 3.485699 |
65786fde-3c80-4faa-a8dd-5c610fe499ab | SlimShaggy/InterSquish | comp/iuRSA/Prime.cpp | /* PRIME.C - primality-testing routines
*/
#include "global.h"
#include "rsaref.h"
#include "r_random.h"
#include "nn.h"
#include "prime.h"
#pragma package(smart_init)
static unsigned int SMALL_PRIMES[] = { 3, 5, 7, 11 };
#define SMALL_PRIME_COUNT 4
static int __fastcall ProbablePrime(NN_DIGIT *, unsigned int);
stat... | ALGO | 0.998113 | 7.110444 |
28911b03-fdcd-4a23-83c3-ec075014a96f | abhishekumar-tyagi/node | deps/icu-small/source/tools/toolutil/uoptions.cpp | #include "unicode/utypes.h"
#include "cstring.h"
#include "uoptions.h"
U_CAPI int U_EXPORT2
u_parseArgs(int argc, char* argv[],
int optionCount, UOption options[]) {
char *arg;
int i=1, remaining=1;
char c, stopOptions=0;
while(i<argc) {
arg=argv[i];
if(!stopOptions && *arg... | TOOL | 0.940132 | 5.024667 |
09379b8b-a955-46e3-9f68-71531a05d59a | andrew-wang-2015/intro-programming-methods | Week2_2016/angleSort.cpp | /**
* @file
* @author The CS2 TA Team <<<EMAIL>>>
* @version 1.0
* @date 2013-2014
* @copyright This code is in the public domain.
*
* @brief An example of sorting (x, y) pairs by angle.
*
*/
#include "structs.h"
#include <vector>
using namespace std;
// TODO Modify one of your sorting functions (bubble sort... | ALGO | 0.999595 | 4.972701 |
461a8f11-1f44-492c-b25e-31a969867dd0 | Madhu-Biradakota/Mutation-Testing-using-DeepState | Final_SM_2/StringManipulator.mutant.849.cpp | #include "StringManipulator.h"
#include <algorithm>
#include <cctype>
#include <sstream>
#include <iterator>
#include <map>
#include <stdexcept>
#include <locale>
#include <regex>
#include <numeric>
std::string StringManipulator::reverse(const std::string& str) {
std::string reversed = str;
std::reverse(revers... | TOOL | 0.875108 | 6.472422 |
d5dd7fab-8863-4830-9e9c-1a0138d68028 | gautam56863/6Companies30Days | GoldmanSachs/#12All_Elements_in_Two_Binary_Search_Trees.cpp | class Solution
{
public:
vector<int> v;
void pre(TreeNode *root)
{
if (!root)
return;
v.push_back(root->val);
pre(root->left);
pre(root->right);
}
vector<int> getAllElements(TreeNode *root1, TreeNode *root2)
{
pre(root1);
pre(root2);
... | ALGO | 0.999969 | 5.611044 |
4cbe885f-62cb-4ee3-84a5-ee88cae2d989 | lucas54neves/GCC216-Data_Structures | Exercícios/4 - Pilhas e filas/Exercícios do Dredd/questao-4.cpp | #include <iostream>
typedef int Dado;
class Fila {
public:
Fila(unsigned cap = 80);
~Fila();
// Remove e retorna o próximo elemento da fila.
Dado Desenfileira();
// Insere um valor na fila. Retorna um booleano que informa se a inserção foi realmente
// realizada.
... | ALGO | 0.989135 | 4.976256 |
3a2c4779-47c6-4a20-93f5-91b65bf59177 | gnorambuena/randomCodes | c++/binString.cpp | #include <iostream>
#include <string>
using namespace std;
string genNextNum(string s){
for(int i = s.size()-1 ; i >=0 ; i--){
if(s[i]=='0'){
s[i]='1';
break;
}
else if(s[i]=='1'){
s[i]='0';
}
}
return s;
}
bool checkZeros(string s){
for(int i = 0 ; i < s.size() ;i++){
if(s[i]=='1')return false;... | ALGO | 0.999795 | 3.600803 |
8e39db90-f249-4513-bc3a-aa8fb98b9cec | Brikaa/problem-solving | contests/assignment-5-graphs/i/main.cpp | #include <vector>
#include <cstdio>
#include <queue>
typedef unsigned int ui;
typedef unsigned long long ull;
const ui N = 1e5 + 5;
std::vector<std::vector<ui>> adj;
ui ans[N];
ui in_degrees[N];
int main()
{
ui n, k;
scanf("%u%u", &n, &k);
adj.resize(n + 5);
for (ui mgr = 1; mgr <= k; ++mgr)
{
ui no;
... | ALGO | 0.999997 | 3.751582 |
531af628-031b-41f1-a6b6-756f48ac4f9a | SAgarwal-24/algorithms | binary-search/the-k-weakest-rows-in-a-matrix.cpp | #include "binary-search.h"
/*
* Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians),
* return the indexes of the k weakest rows in the matrix ordered from the weakest to the strongest.
A row i is weaker than row j, if the number of soldiers in row i is less than the number of... | ALGO | 0.999967 | 5.698016 |
ffb9768a-925a-4536-8f7e-aac4a5db82b9 | ishandutta2007/codeforces | risujiroh/normal/827/D.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define DEBUG(...)
#endif
template <class T> struct tree {
struct edge {
int u, v;
T w;
};
const int n;
vector<edge> es;
vector<vector<int>> g;
vector<int> pv, pe, sz, dep, vs, in, out, head;
vector<T> dist;
tr... | ALGO | 0.999985 | 4.496166 |
76fac3b4-0ce9-494f-9c4d-f46e43e7dd82 | virresh/CompetitiveProgrammingCodes | 2017/CP1/JulyPractiseSet/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz 100005
int leftT[sz];
int rightT[sz];
int a[sz];
int finalTime[sz];
int main()
{
int n;
cin>>n;
for(int i=1; i<=n; i++)
{
cin>>a[i];
}
leftT[0]=0;
for(int i=1; i<=n; i++)
{
leftT[i] = min(leftT[i-1]+1,a[i]);
}
r... | ALGO | 0.999974 | 4.140522 |
1cf336b6-9635-44a0-bc02-06d88d1b8ae4 | girishpatil3012/Leetcode-Solutions | Pattern 1 - GFG/pattern-1.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
void printSquare(int n)
{
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= n; j++)
{
cout<<"* ";
}
cout<<endl;... | ALGO | 0.99974 | 5.173406 |
74ca6ba4-696e-44e7-badb-1f535d1e7b96 | nvcuoq12/DSA | Sinhketiep/hoanvidayso.cpp | #include <bits/stdc++.h>
using namespace std;
int key=1;
void next(int b[], int n){
int i=n-2;
while (b[i]>b[i+1]){
i--;
}
if (i<0) key=0;
else {
int j=n-1;
while (b[j] < b[i]){
j--;
}
swap(b[i],b[j]);
reverse(b+i+1, b+n);
}
}
int main(... | ALGO | 0.999993 | 3.812071 |
5f0d4f88-231e-4214-99ed-154e702537da | chuongg3/llvm-function-merging | libcxx/test/libcxx/fuzzing/pop_heap.pass.cpp | // UNSUPPORTED: c++03, c++11
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <vector>
#include "fuzz.h"
extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, std::size_t size) {
if (size < 2)
return 0;
std::vector<std::uint8_t> working(data, data + size);
std::make_h... | TEST | 0.948526 | 4.610919 |
a9466496-12c6-4983-9344-93b38993bd79 | sher-Muhammad-jessar/Robert-Lafore_exercise | Exercise chapter 5/task 2.cpp | #include<iostream>
using namespace std;
int power(int n,int p=2){
int result=1;
for(int i=1;i<=p;i++){
result=result*n;
}
return result;
}
int main(){
int n,p;
cout<<"Enter number:";cin>>n;
cout<<"Enter power:";cin>>p;
cout<<n<<" raise to power "<<p<<" is : "<<power(n,p);
}
| ALGO | 0.999451 | 4.634755 |
ef12a5c7-0861-4a8c-ad42-4ea2065b7e75 | ishandutta2007/codeforces | natsugiri/normal/808/B.cpp | #include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##... | ALGO | 0.999274 | 3.264665 |
fbe4e855-ee54-443c-becb-285223e43b1f | abramhindle/marsyas-fork | src/marsyas/Compressor.cpp | #include <cmath>
#include "Compressor.h"
#include "common_source.h"
using std::ostringstream;
using namespace Marsyas;
Compressor::Compressor(mrs_string name):MarSystem("Compressor", name)
{
addControls();
}
Compressor::Compressor(const Compressor& a) : MarSystem(a)
{
}
Compressor::~Compressor()
{
}
MarSystem*
C... | ALGO | 0.937287 | 4.234796 |
e480486c-6508-48fd-8d1b-9d5e2d1fbb72 | risacker/Leetcode_Solutions | 173-binary-search-tree-iterator/173-binary-search-tree-iterator.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.999838 | 6.207151 |
f7570d4b-7fc0-4194-8f02-b77f6d1b63f7 | hanras97/Freicar-Autonomous-Driving | ros_code/freicar_control_/src/controller/pure_pursuit.cpp | /*
* Author: Johan Vertens (<EMAIL>)
* Project: FreiCAR
* Do NOT distribute this code to anyone outside the FreiCAR project
*/
/* A ROS implementation of the Pure pursuit path tracking algorithm (Coulter 1992).
Terminology (mostly :) follows:
Coulter, Implementation of the pure pursuit algoritm, 1992 and
... | ALGO | 0.997812 | 4.756332 |
f2a82f9b-62ac-4895-b495-599fdd56a212 | voidmind26/cpp | 787div3/a.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
bool ok = 1;
int a, b, c, x, y;
cin >> a >> b >> c >> x >> y;
if (a < x) {
if (c >= (x - a))
c ... | ALGO | 0.999868 | 3.329484 |
6d34c890-d96b-44a6-9387-235acf7ac1b8 | rafinhadufluxo/GEX624-OPT | A10/main2.cpp | #include <bits/stdc++.h>
#include <iomanip>
typedef long long ll;
const int MOD = 1000000007;
#define endl "\n";
#define deb(x) cerr << #x << " is " << x << endl;
#define IOS ios:: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(a) a.begin(), a.end()
using namespace std;
void resolve() {
int n, k; cin >> n ... | ALGO | 0.999977 | 4.669124 |
9ab925fb-0689-48cf-95b1-a05a0a76193e | akshatj2209/LeetProblems | add-two-numbers/add-two-numbers.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* addTwoNumbe... | ALGO | 0.999939 | 6.194499 |
0ec383a8-02ef-425f-aaf4-8df899b7ae91 | KrisKeshav/To_do_List_app | test_drive/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.997739 | 6.76775 |
11dbff1d-1778-41ba-bb79-3141848e6e53 | codeAbinash/leetcode-solutions | leetcode/problems/cpp/number-of-islands.cpp | // by @codeAbinash
// Time : O(n)
// Space : O(1)
#include "vector"
using namespace std;
class Solution {
void dfs(vector<vector<char>>& grid, int i, int j, int m, int n) {
if (grid[i][j] != '1') return;
grid[i][j] = '*';
if (i + 1 < m) dfs(grid, i + 1, j, m, n);
if (i - 1 >= 0) dfs(grid, i... | ALGO | 0.999763 | 5.864369 |
51e66ac4-7e1d-408a-ab7e-3ab9a06b4ae3 | buyunwang/CS426 | CPSC426_A4/include/eigen/unsupported/bench/bench_svd.cpp | // Bench to compare the efficiency of SVD algorithms
#include <iostream>
#include <bench/BenchTimer.h>
#include <unsupported/Eigen/SVD>
using namespace Eigen;
using namespace std;
// number of computations of each algorithm before the print of the time
#ifndef REPEAT
#define REPEAT 10
#endif
// number of tests of t... | TEST | 0.996602 | 6.26191 |
7e1010ee-884f-48e4-90c2-66281c8fa559 | FranticLOL/ITMO_Parallel_Algorithms | MPI18/src/slave.cpp | #include "mpi.h"
int main(int argc, char **argv)
{
int rank;
MPI_Comm intercomm;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_get_parent(&intercomm);
if (rank < 2)
MPI_Send(&rank, 1, MPI_INT, 0, rank, intercomm);
else
{
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Send(&... | TOOL | 0.951019 | 3.542957 |
e26a8312-5a23-42e9-a1f9-82352c544d43 | BorisPenchev1/Informatics-competitive | D group/Lectures 2025/Eratosthenes/ex1.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int MAXN = 1e6 + 7;
int n;
vector <int> divisors;
void solve()
{
cin >> n;
int dmax = sqrt(n);
int d = 1;
while (d * d < n)
{
if (n % d == 0)
{
divisors.push_back(d);
divisors.push_... | ALGO | 0.999594 | 5.289186 |
4243a398-e79a-4345-a673-2a3a33c4db16 | wangxianghust/leetcode | OfferBook/366Fibonacci.cpp | /* Problem: Fibonacci
*/
#include <iostream>
using namespace std;
class Solution{
public:
/**
* @param n: an integer
* @return an integer f(n)
*/
int fibonacci(int n) {
// write your code here
int first = 0;
int second = 1;
if(n == 1) return first;
if(n... | ALGO | 0.999869 | 5.385238 |
fdffb0dc-492f-41b3-a31b-0b874016baf2 | VladoVarbanov/CPP_Basics | First_Steps_Exercise/04_VacationBooksList/04_VacationBooksList.cpp | #include <iostream>
using std::cout;
using std::cin;
using std::string;
using std::endl;
int main()
{
int pagesCount, pages, daysCount;
cin >> pagesCount >> pages >> daysCount;
int allTimeForReading = pagesCount / pages;
int timeNeededPerDay = allTimeForReading / daysCount;
cout << timeNeededPer... | ALGO | 0.999802 | 3.481002 |
30b42a09-4431-4df1-9b3f-a791dc67f097 | Yeahoon-Kim/Baekjoon-Code | 프로그래머스/unrated/142085. 디펜스 게임/디펜스 게임.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(int n, int k, vector<int> enemy) {
int enemyNum = 0, left, right, mid, i, partSum;
vector<int> chance, partArr;
left = 0;
right = enemy.size();
while(left + 1 < right) {
mid = (left + right... | ALGO | 0.999973 | 5.064511 |
fc4429f4-e117-42ec-9aa6-ae734dad24ae | P-X-G/C-C- | 10_BT_C++/Bai1/Source/main.cpp | /*
* File Name: main.cpp
* Author: Giao Pham
* Date: 23/04/2023
* Description: This is file to calculate distance and area of triangle in 2D Space
*/
# include "Bai1.h"
int main(int argc, char const *argv[])
{
Diem diemA(5,2);
Diem diemB(2,3);
Diem diemC(6,9);
PhepToan tinhtoan(diemA,diemB);
Phep... | ALGO | 0.987847 | 5.454399 |
8bc8b61d-edd8-4f2f-a9bb-7a8071c94a89 | Imagaverse/CitraEmu | externals/dynarmic/src/dynarmic/backend/x64/emit_x64_vector.cpp | #include <algorithm>
#include <bit>
#include <bitset>
#include <cstdlib>
#include <type_traits>
#include <mcl/assert.hpp>
#include <mcl/bit/bit_count.hpp>
#include <mcl/bit/bit_field.hpp>
#include <mcl/bitsizeof.hpp>
#include <mcl/stdint.hpp>
#include <mcl/type_traits/function_info.hpp>
#include <xbyak/xbyak.h>
#incl... | TOOL | 0.908084 | 7.056684 |
aa467c5a-fb7d-4b24-b473-599cf0dff788 | manikanta2901/ubuntu | .history/imp/cpp/Algorithm/GraphTheory.cpp/AdjacencyList_20200803125656.cpp | #include<iostream>
#include<vector>
using namespace std;
int nodes = 0;
vector <int> adj[10];
void printAdjacecyList(){
for(int i = 1;i <= nodes;++i){
cout << "Adjacency list of node " << i << ": ";
for(int j = 0;j < adj[i].size();++j){
if(j == adj[i].size() - 1)
cout... | ALGO | 0.998407 | 4.790956 |
f9110c73-1068-4cf4-84fa-a5143d78d529 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10223_1.cpp | #include <bits/stdc++.h>
using namespace std;
int deg[100010], par[100010];
map<int, int> M[100010];
bool taken[100010];
std::vector<int> v;
int findpar(int u) { return par[u] = (par[u] == u) ? u : findpar(par[u]); }
int main() {
int n, m, x, y;
cin >> n >> m;
for (int i = 0; i < m; i++) {
cin >> x >> y;
... | ALGO | 0.999707 | 4.703708 |
debb32dd-343f-4269-a8e2-1e5f22c4f915 | Nic-bit/essential | boost-1.85.0/libs/compute/perf/perf_inner_product.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/inner_product.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
... | TEST | 0.98755 | 5.369026 |
21f7c0bb-32dc-4c09-843f-9b89aadfb833 | b-man/xnu-deps-linux | cctools-836/ld64/src/ld/ld.cpp | // start temp HACK for cross builds
//extern "C" double log2 ( double );
//#define __MATH__
// end temp HACK for cross builds
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/sysctl.h>
#include <fcntl.h>
#include <errno.h>
#include <limits.h>
#include <unistd.h>
#inc... | TOOL | 0.940836 | 5.799249 |
33dd8d4d-ebb8-4f38-aabc-a5802d5fdc6c | dnfwlq8054/coding_test | baekjoon/gold/Cubeditor_1702.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int answer = 0;
string s;
cin >> s;
for(int idx = 0; idx < s.size() - 4; idx++){
string temp = s.substr(idx, s.size());
vector<int> table(temp.size());
int j = 0;
... | ALGO | 0.999965 | 3.829682 |
c72aaf10-2097-4bec-9dd0-4f114e1326f3 | AkifAzwad/cp_repo | random/K. Max and Min.cpp | #include "bits/stdc++.h"
using namespace std;
/////////data types/////////
using ll = long long;
/////////constants/////////
//const int mod = 1e9 + 7;
//////////methods//////////
///////////////////////////
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int a, b, c; cin >> a >> b >> c;
cout << min({a... | ALGO | 0.999668 | 4.169079 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.