uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
92f6182f-f3ad-47cb-800e-8fdf34bd0b08 | ishandutta2007/codeforces | hyperbolic/normal/1749/C.cpp | #include <stdio.h>
#include <algorithm>
int x[110];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int a;
scanf("%d",&a);
for(int i=1;i<=a;i++) scanf("%d",&x[i]);
std::sort(x+1,x+a+1);
int ans = 0;
for(int i=1;i<=a;i++)
{
int R = a, L = 1;
for(int j=1;j<=i;j++)
{
while(R>=1 && x[R]>... | ALGO | 0.999956 | 3.505947 |
bca5b093-c360-428e-822b-eef9644dd113 | srijon-32/CP-Library | Math Related/2D Prefix Sum & Difference Array/E_Counting_Rectangles.cpp | /* SRIJON
SINGHA
SAMANTA */
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define nl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define yes cout << "YES" << nl
#define no cout << "NO" << nl
#define fi first
#define sec ... | ALGO | 0.999464 | 4.28022 |
da2e70b4-dc60-486c-b1ac-f728e781b0c9 | Tobos33/My-programs | Jezyki Programowania/Jp4_poprawione_3/parabola_main.cpp | #include "parabola.h"
int main(){
float *x,*y;
x = new float;
y = new float;
cout<<"Podaj trzy punkty"<<endl;
cout<<"Punkt pierwszy"<<endl;
cin>>*x>>*y;
Point p1(*x,*y);
cout<<"Punkt drugi"<<endl;
cin>>*x>>*y;
Point p2(*x,*y);
cout<<"Punkt trzeci"<<endl;
cin>>*x>>*y;
... | ALGO | 0.998737 | 4.960685 |
83ab7fad-ef4c-4f69-b703-5882a8626ae8 | MoeinGhaniyoun/LLVM-SLH-RISCV | llvm/lib/Transforms/IPO/PartialInlining.cpp | #include "llvm/Transforms/IPO/PartialInlining.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/BlockFrequencyInfo.h"
#include "llvm/Analysis/... | ALGO | 0.996328 | 7.948613 |
6b8874a2-2221-45d5-98d9-fc151f8fc1ab | mahfahim/XPSC_Fahim | week5/Day6/G4.cpp | //********* Bismillahir Rahmanir Rahim *********
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define ull unsigned long long
#define ldb long double
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--)
{
int n;
... | ALGO | 0.999839 | 4.31093 |
91f05990-69b1-476f-98a7-c3fdd06f2ac4 | nermeenwageh10/Leetcode-Solutions | Solutions/C++/0605-can-place-flowers/0605-can-place-flowers.cpp | class Solution {
public:
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
for (int i = 0; i < flowerbed.size(); i++){
if (flowerbed[i]) continue;
if (i && flowerbed[i-1]) continue;
if (i+1 < flowerbed.size() && flowerbed[i+1]) continue;
n--;
f... | ALGO | 0.999992 | 6.86682 |
1033747c-a56e-419f-9542-566ef1051b30 | zhou-jk/code | Codeforces/CF1909 Pinely Round 3 (Div. 1 + Div. 2)/C/C.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#include<stack>
#include<algorithm>
using namespace std;
const int N=100005;
int n;
int l[N],r[N],c[N];
pair<int,int> b[N*2];
int tot;
void solve()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>l[i];
for(int i=1;i<=n;i++)
cin>>r[i];
for(int i=1... | ALGO | 0.999959 | 3.29127 |
36ecbbf1-7888-4886-8eec-b98ba8941ae8 | Ujjal-Baniya/Competitive-cpp | Codechef/Beginner/playing with matches.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int arr[10]= {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int t;
cin>>t;
while(t--){
int n1,n2,result=0;
cin >>n1>>n2;
string sum = to_string(n1+n2);
for(char x: sum){
result += arr[x -'0'];
}
cout<... | ALGO | 0.999867 | 5.464711 |
66a9c922-018e-470f-b245-465caf04bb71 | deadcoder0904/codechef-programs | id-and-ship.cpp | #include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
int t;
cin>>t;
while(t--){
char id;
cin>>id;
switch(id){
case 'B':
case 'b':
cout<<"BattleShip"<<endl; break;
case 'C':
case 'c':
cout<<"Cruiser"<<endl; break;
case 'D':
case 'd':
cout<<"Destr... | ALGO | 0.991113 | 3.183924 |
caf2d953-a7a9-4c9b-a51f-ba93e19a30d6 | weijinjie/classify | 指定目录下根据文件类型分类工具/file.cpp | #include <Windows.h>
#include "init.h"
#include "utils.h"
#include "file.h"
#include "SingleLinkedList.h"
#include "process.h"
/**
* ļ
*/
int copyFile(char *src, char *dst)//Чʵ͡Ըijɶ߳
{
FILE *fp1, *fp2;
int c;
errno_t err = fopen_s(&fp1,src, "rb");
err = fopen_s(&fp2, dst, "wb");//ļ
if (fp1 == NULL || fp2 ... | TOOL | 0.900518 | 3.446607 |
96af100b-f885-4894-a2f9-e913c349953f | prclibo/relative-pose-estimation | eigen/unsupported/doc/examples/PolynomialUtils1.cpp | #include <unsupported/Eigen/Polynomials>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
Vector4d roots = Vector4d::Random();
cout << "Roots: " << roots.transpose() << endl;
Eigen::Matrix<double,5,1> polynomial;
roots_to_monicPolynomial( roots, polynomial );
cout << "Polynomial:... | ALGO | 0.998141 | 3.999627 |
f31f431c-9ca7-43e5-9df4-fbc4fa9a2fec | Coach-Academy/Fall-1-2024 | Level 1/CPU - Standard - L1 - C107/Practice G1/Week 04/L.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main(){
int n, set_count = 1;
while(cin >> n and n != 0) {
cout << "Set #" << set_count++ << '\n';
int h[n];
int sum=0, box_per_stack=0, ctr=0;
for (int i = 0; i < n; i++) {
cin >>h[i];
sum += h[... | ALGO | 0.999779 | 3.625443 |
7a4ea28f-5316-460e-bed2-70619d5916f2 | lhleonardo/ufla-ialg | arquivos/teste.cpp | #include <iostream>
#include <fstream>
using namespace std;
// insertion sort
void ordena(int valores[], int tam) {
int aux, j;
for(int i = 1; i < tam; i++) {
aux = valores[i];
j = i - 1;
while(j>=0 and valores[j] > aux) {
valores[j+1] = valores[j];
j--;
}
valores[j+1] = aux;
}
}
void grava_no_ar... | ALGO | 0.997709 | 4.571289 |
dfef474c-6e1b-45e3-a44b-49ad892b64f0 | MeghaSilori/Code_g2 | Day-15/minStack.cpp | class MinStack {
public:
/** initialize your data structure here. */
stack<long> s;
long minele;
long val;
MinStack() {
//do nothing
}
void push(int x) {
val = long(x);
if (s.empty()) {
minele = val;
s.push(val);
}
else ... | ALGO | 0.999941 | 5.928511 |
1434c864-5c1e-4801-a10f-9930d18c5552 | joaocaraujo/AEDS1 | PUC-MINAS/List 6/part ll/1/main.cpp | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int primeiro, diferenca,n,i,final;
printf("====--PROGRESSAO ARITIMETICA--====\n\n");
printf("Digite o primeiro termo e a razao da progressao: \n");
scan... | ALGO | 0.991557 | 3.402995 |
e36d7c44-fa22-4599-b8d2-c1f2ec65cf49 | brunomelo283/C-Cpp | Beecrowd/1161.cpp | #include<iostream>
using namespace std;
long long int fatorial(long long int n){
if(n==0 || n==1)
return 1;
else
return n * fatorial(n-1);
}
int main(void){
long long int n1, n2, r1,r2, sum;
while(cin >> n1){
cin >> n2;
r1 = fatorial(n1);
r2 = fatorial(n2);
sum = r1 + r2;
cout << sum << "\n";
}... | ALGO | 0.999654 | 4.017668 |
fca17c37-12cb-4b83-aae4-bd180b7281b0 | zino23/Data_Structures_and_Algorithms | problem_sets/LeetCode/top_interview_problems/array/4_median_in_sorted_array.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
// O(logn)
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int len = nums1.size() + nums2.size();
if (len % 2 == 0) {
int l = findKth(nums1, 0, nums2, 0, len / 2);
int r = findKth(nums1... | ALGO | 0.999975 | 6.3583 |
a542e7e2-866e-4f2c-9a1d-efea3e32f196 | keisuke90/AtCoder | practice/abc148-e.cpp | #include <bits/stdc++.h>
#define rep(i, start, end) for(int i = start; i < end; i++)
using namespace std;
long long g1(long long n, int p) {
if(n==0) return 0;
return n/p + g1(n/p, p);
}
long long g2(long long n, int p) {
if(n%2==1) {
return g1(n, p) - g2(n-1, p);
}
long long res = g1(n/2... | ALGO | 0.999935 | 4.188276 |
e252181d-0c51-4d97-835e-2cc4014c2e82 | xerohour/windows_10_shared_source_kit | windows_10_shared_source_kit/windows_10_shared_source_kit/unknown_version/Source/Tests/Graphics/Graphics/DirectX/d3d/conf/DepthStencil/clamp.cpp | //////////////////////////////////////////////////////////////////////////
// clamp.cpp
// created: 2006/11/10
//
// purpose: conformance for depth clamp in the viewport struct
//////////////////////////////////////////////////////////////////////////
#include "clamp.h"
// string converstions for custom types
t... | TEST | 0.948814 | 6.901501 |
56342a19-0cbb-4a6d-9efd-f30bcb2806a4 | ckethan0429/cpp_algorithm | algorithm_003/algorithm_003/main.cpp | #include <iostream>
using namespace std;
int main(){
int N, i, sum = 1;
cin >> N;
cout << 1;
for (i = 2; i < N-1; i++){
if(N % i == 0){
sum += i;
cout << " + " << i ;
}
}
cout << " = " << sum << endl;
}
| ALGO | 0.999884 | 3.941105 |
4827550b-cb22-4994-8d9f-b39b5c026c5b | PayamEmami/OpenMS | src/topp/MapAlignerIdentification.cpp | #include <OpenMS/ANALYSIS/MAPMATCHING/MapAlignmentAlgorithmIdentification.h>
#include <OpenMS/APPLICATIONS/MapAlignerBase.h>
using namespace OpenMS;
using namespace std;
//-------------------------------------------------------------
// Doxygen docu
//-------------------------------------------------------------
/**... | ALGO | 0.971438 | 6.343053 |
15124035-7873-4b5d-8909-1773a4b7cf15 | garyellow/LC-GFG-solution | 0976-largest-perimeter-triangle/0976-largest-perimeter-triangle.cpp | class Solution {
public:
int largestPerimeter(vector<int>& nums) {
sort(nums.rbegin(), nums.rend());
int n = nums.size() - 2;
for(int i = 0; i < n; i++)
if(nums[i] < nums[i + 1] + nums[i + 2])
return nums[i] + nums[i + 1] + nums[i + 2];
r... | ALGO | 0.999833 | 5.265506 |
90d5e54d-d68f-4484-b5ab-92ad01681161 | fangding678/OnlineJudge | PAT/中国大学MOOC-翁恺-C语言程序设计习题集/d0013_mooc.cpp | #include<stdio.h>
int main()
{
int n;
int i,j;
while(scanf("%d",&n)!=EOF)
{
if(n<1||n>9) continue;
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
printf("%d*%d=%-4d",j,i,i*j);
printf("\n");
}
}
return 0;
}
| ALGO | 0.999643 | 3.400927 |
5b227a8e-b32f-42c5-969f-ba11f58a8235 | harvard-acc/smaug | smaug/operators/smv/smv_batch_norm_tiling.cpp | #include <algorithm>
#include "smaug/core/backend.h"
#include "smaug/operators/common.h"
#include "smaug/operators/smv/smv_batch_norm_op.h"
#include "smaug/operators/smv/smv_batch_norm_tiling.h"
#include "smaug/utility/debug_stream.h"
namespace smaug {
namespace smv {
namespace bn {
std::array<TilingDims, 2> TilingO... | ALGO | 0.977883 | 7.713251 |
3690d7f9-5064-4e48-baec-19525ee25be1 | mrcszk/Cpp | 20. Przechowywanie imion i nazwisk/Name.cpp | //
// Created by marci on 27.03.2019.
//
#include "Name.h"
using namespace model;
Name::Name(const string &first_names_surname) {
int i = 0;
while (first_names_surname[i] != ',') {
first_name_ += first_names_surname[i];
i++;
}
i++;
while (first_names_surname[i] != ',') {
se... | TOOL | 0.908895 | 4.508202 |
5693cb09-250f-485e-9174-77c5efb3dfbe | Haoxiang310/CSCI550_mongo | src/mongo/db/query/optimizer/utils/abt_hash.cpp | #include "mongo/db/query/optimizer/utils/abt_hash.h"
#include "mongo/db/query/optimizer/node.h"
#include "mongo/db/query/optimizer/utils/utils.h"
namespace mongo::optimizer {
static size_t computeCollationHash(const properties::CollationRequirement& prop) {
size_t collationHash = 17;
for (const auto& entry :... | ALGO | 0.993006 | 7.555823 |
495f67ec-9b18-4f2b-94de-dded40d0b2c4 | ishandutta2007/codeforces | ecnerwala/normal/1477/E.cpp | #include <bits/stdc++.h>
/** Binary-indexed tree
*
* A binary indexed tree with N nodes of type T provides the
* following two functions for 0 <= i <= N:
*
* prefix(int i) -> prefix_iterator<T>
* suffix(int i) -> suffix_iterator<T>
*
* such that size(suffix(i) intersect prefix(j)) = (1 if i < j el... | ALGO | 0.999876 | 4.443404 |
f3be6d50-8bf2-410b-b224-9e9e08350b9f | CrutoSJ/GFG-Leetcode_CPP-Python | #GFG-Daily/BfsOfGraph.cpp | // #Question:-
// Link-> https://www.geeksforgeeks.org/problems/bfs-traversal-of-graph/1
// Date-> 02/04/25
// #Solution:-
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> bfs(vector<vector<int>> &adj) {
int n=adj.size();
vector<int> res,vis(n,0);
... | ALGO | 0.999966 | 5.83022 |
ba289c57-49d8-4869-8f72-4ea2e142bbb5 | Lalitj2104/cpp | ETE2.0/mosFrequentCharacter.cpp | #include<bits/stdc++.h>
using namespace std;
void frequent(string x){
map<char,int> mp;
for(int i=0;i<x.length();i++){
mp[x[i]]++;
}
char w='\0';
int q=0;
for(auto i: mp){
if(i.second>q){
q=i.second;
w=i.first;
}
}
cout<<w;
}
int main(){
string x;
cin>>... | ALGO | 0.999866 | 3.855227 |
35a72e5b-10dd-4710-8f86-1520564943d0 | sDaCoder/LEETCODE_sDa | 2095_deleteMiddleNode.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<list>
#include<stack>
#include<queue>
#include<stdlib.h>
#include<math.h>
#include<limits.h>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode() : val(0), next(nullptr) {}
ListNode(int x) : val(x), next(nullptr) {}
... | ALGO | 0.99999 | 5.28972 |
8bfaf3dc-0f30-4fcd-a5a5-801275dba0b9 | QTune1603/SPOJ | PTIT015I.CPP | #include <bits/stdc++.h>
using namespace std;
void solve()
{
int n, t;
cin >> n >> t;
vector<int> v(n);
cin >> v[0];
for (int i = 1; i < n; i++)
{
cin >> v[i];
v[i] += v[i - 1];
}
for (int i = 0; i < n; i++)
{
if (v[i] > t)
{
cout << i << ... | ALGO | 0.999738 | 4.015617 |
373fdd42-10ef-4beb-9fbf-255f4fe20cd5 | YoungCIoud/PracticeOfFishAcmer | CodeForces/Gym/105172/J.cpp | #include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
// n^2将符合条件的区间维护出来
// dp[i][k] 第i个数是第k个区间的右括号
const int N = 3000, K = 20, Inf = 1e18;
int dp[N + 5][K + 5], a[N + 5], pre[N + 5], pref[N + 5][N + 5];
bool ok[N + 5][N + 5];
signed main()
... | ALGO | 0.999928 | 3.772644 |
777fdacb-69a0-45e8-8c39-e4950840e073 | charaneadam/cp | ACMContests/MyAncestor.cpp | #include <iostream>
#include <vector>
#include <map>
#include <set>
#include <sstream>
#include <limits>
using namespace std;
typedef vector<vector<int>> Tree;
typedef pair<int, long long> Query;
vector<long long> power;
Tree tree;
map<int, vector<long long>> queried;
map<Query, int> answered;
int solve(int p, vect... | ALGO | 0.999767 | 4.210389 |
9de48d52-0c04-468c-a11c-238baae037d4 | MDMinhazulIslamKhan/problem_solving | week6/contest_vjudge/A-Judged.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int count = 0;
;
for (int i = 0; i < 5; i++)
{
int inp;
cin >> inp;
if (inp)
count++;
}
if (count >= 4)
... | ALGO | 0.999248 | 4.230394 |
15cd1413-d350-4cc6-89f4-ce1ec661db49 | Harb2551/DsAlgo | DATA STRUCTURES AND ALGORITHMS/450/DP/maxpairsum.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
int maxSumPairWithDifferenceLessThanK(int arr[], int N, int K)
{
// Your code goes here
sort(arr,arr+N,greater<int>());
int sum = 0;
int i=0;
while(i... | ALGO | 0.999894 | 6.035398 |
0621e297-268b-46b8-9360-32b468715fb0 | fatmanour27/First-Step | Basics_C++/OOP/40_overloading_unary_operator.cpp | #include <iostream>
#include <string>
using namespace std;
class Unary
{
private:
int x, y;
public:
Unary(int f = 0, int sh = 0) //* unary is a constructor
{
x = f;
y = sh;
}
void print_value()
{
cout<<x<<" "<<y<<"\n";
}
//prefix operato... | ALGO | 0.994097 | 4.411071 |
a554b623-be33-4e99-b2d0-42aeb1147f34 | Antoniano1963/vscode_cpp | Week2/test3.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string str = "";
string str1 = "15156";
str += '5';
str += '3';
str += str1.at(1);
for (int i = 0; i < str1.length();i++){
str += str1.at(i);
}
cout << str;
} | ALGO | 0.996428 | 3.442703 |
a5caf6c5-cd32-4d28-86a7-664e155e09c8 | sheldoncodes/DSA | Functions/pythagoreanTriplet/pythagoreantriplet.cpp | #include<iostream> // code failed for negative integers but you can improve it.
using namespace std;
bool check(int i, int j, int k){
int a =max(i,max(j,k));
int b,c;
if(a==i){
b=j;
c=k;
}else if(a==j){
b=i;
c=k;
}else{
b=i;
c=j;
}
if(a*a==b*... | ALGO | 0.999422 | 4.01495 |
bcf16efd-54ab-4ff0-a626-af993c962871 | ishandutta2007/codeforces | wifiiii/normal/1322/B.cpp | #include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937_64 mrand(chrono::steady_clock::now().time_since_epoch().count());
#define ii for(int i=1;i<=n;++i)
#define ji for(int j=1;j<=n;++j)
#define jj for(int j=1;j<=m;++j)
#define ij for(int i=1;i<=m;++i)
#define sz(x) ((ll)x.si... | ALGO | 0.999986 | 3.975472 |
bef579df-82cb-4132-9824-9a5df32f9da5 | bsheth711/LeetcodeSolutions | Binary Search/1030003903.cpp | class Solution {
public:
int search(vector<int>& nums, int target) {
int start = 0;
int end = nums.size() - 1;
while (start <= end) {
int i = (end + start) / 2;
//cout << nums[i] << endl;
if (nums[i] == target) {
return i;
}
... | ALGO | 0.999862 | 6.111441 |
5ebe0d64-db6a-4ca6-ac69-db8cea39ed86 | campbell-2589/cpp-linalg-libs | MatLib/chisquaredistr.cpp | #include "chisquaredistr.h"
double chisquaredistribution(double v, double x)
{
double result;
ap::ap_error::make_assertion(ap::fp_greater_eq(x,0)&&ap::fp_greater_eq(v,1), "Domain error in ChiSquareDistribution");
result = incompletegamma(v/2.0, x/2.0);
return result;
}
double chisquarecdistribution(d... | ALGO | 0.973491 | 5.961697 |
4a8b59bf-42c5-4f4b-984b-233cbeb0ecd5 | matigodoy/IP | 3) TRABAJO PRACTICO 1 y 2 ARRAYS C++/TP 2/8.cpp | // Una empresa dedicada a la emisin de una revista informtica desea conocer cierta informacin luego de haber lanzado una campaa de promocin.
// La empresa tiene n vendedores, los cuales realizan suscripciones de clientes. A cada vendedor le ser otorgado un 2% sobre el monto de cada una de las suscripciones que haya c... | ALGO | 0.997765 | 3.497223 |
96d1c35f-94e8-4ef4-b93b-a9105220e772 | anm336/LeetCode-Questions | 1654-minimum-jumps-to-reach-home/1654-minimum-jumps-to-reach-home.cpp | class Solution {
public:
int func(unordered_map<int,int> &f, int i, int bj, int a, int b, int x, vector<vector<int>> &dp){
if(i>6000 || i<0 || bj>=2 || f.find(i)!=f.end()) return 1e9;
if(i==x) return 0;
if(dp[i][bj] != -1) return dp[i][bj];
dp[i][bj] =... | ALGO | 0.999895 | 4.920048 |
54b070ed-24b7-4048-83bb-49b14762c534 | Diamondsn/algorithm-programming | 20190310腾讯提前批/5.cpp | #include<string>
#include<vector>
#include<iostream>
#include<algorithm>
#include<stack>
#include<math.h>
#include<map>
#include<set>
using namespace std;
int main() {
int n;
cin >> n;
vector<int>vec;
for (int i = 0; i < n; ++i){
int temp;
cin >> temp;
vec.push_back(temp);
}
for (int i = 1; i < n; ++i)... | ALGO | 0.999876 | 3.068664 |
3628f05d-99d9-450f-9174-e0f6c9247d93 | saket61195/cpp-code | c++_by_harray/code/14.3parametize_contructor.cpp | #include <iostream>
// #include <math.h>//c
#include <cmath>
using namespace std;
class point
{
int x, y;
friend double distance(point, point);
public:
point(int a, int b)
{
x = a;
y = b;
}
void display()
{
cout << "the point is (" << x << "," << y << ")" << endl;
... | TOOL | 0.991428 | 4.019476 |
631d9f8c-28fa-431c-b82a-ce1c6b30e5e4 | Char1sk/AlgorithmContestBook | Course/Exercise1/ProblemC/BigIntQuickMulti.cpp | #include <iostream>
#include <string>
#include <list>
struct BigInteger
{
std::list<int> val;
int digits;
BigInteger() : val(), digits(0) {}
BigInteger(const std::string &s) : digits(s.size())
{
for (char c : s)
{
val.push_back(c-'0');
}
}
BigInteger(cons... | ALGO | 0.999803 | 5.406072 |
8e461d03-7439-4b12-8303-0952871f971a | Adi-Pandit/Data-Structure | Matrix/DiagonalMatrixCpp.cpp | #include<iostream>
using namespace std;
class Diagonal
{
private:
int n;
int *A;
public:
Diagonal()
{
n=2;
A=new int[n];
}
Diagonal(int n)
{
this->n=n;
A=new int[n];
}
void Set(int i,int j,int x);
int Get(int i,int j);
void Display();
~Diagonal()
{
delete []A;
}
};
void D... | ALGO | 0.998719 | 3.626871 |
ebcd4b20-f2d8-4720-9ba5-ac3e94ccf2db | overflow218/Algorithms | 230621-1.cpp | /*
당근 뭐로 맞추든 맞추는건 문제가 아님.
근데 비용을 최소로 해야한다는게 문제이지. 범위는 최소 ~ 최대 사이에 있는
어떤 값으로 맞추는게 비용이 최소가 될거임. 저 사이에서 이분탐색을 적용하면 좋을 것 같긴한데
문제는 이분 탐색을 했을때 어느쪽으로 가야할지가 명확하지 않다는게 문제이지...
이거 분포가 극값이 있는 그런 분포일거 같은데 그런 경우라면 3분 탐색을 활용할 수 있단말이지
1 3 5 2
2 3 1 14
*/
class Solution {
public:
long long getCost(int target, vector<int>& nums, ... | ALGO | 0.999903 | 4.993654 |
e0689403-9efb-4c1f-ad4d-fddea998811d | sbha2431/Abstractions-Learning | NaoCodeBackup/core/localization/ParticleFilter2.cpp | // #include <localization/ParticleFilter2.h>
// #include <Eigen/LU>
// #include <Eigen/Core>
// #include <iostream>
// #include <common/Random.h>
// template <int m,int n>
// ParticleFilter<m,n>::ParticleFilter(
// )
// template <int m,int n>
// void ParticleFilter<m,n>::init(){
// Ns = 1000; // Number of particle... | ALGO | 0.998773 | 4.570714 |
727bc2eb-6dbd-4b01-a62d-04b01befc9bc | jhy979/CodingTest | Baekjoon/Part1/피보나치5.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
vector<int> fibo;
fibo.push_back(0);
fibo.push_back(1);
int n = 0;
cin >> n;
for (int i = 2; i <= n; i++) {
fibo.push_back(fibo[i - 1] + fibo[i - 2]);
}
cout << fibo[n];
return 0;
}
| ALGO | 0.999983 | 4.785982 |
7db5d4b7-da2e-4fae-8187-8aba5ab190f4 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_6806_15.cpp | #include <bits/stdc++.h>
using namespace std;
const int nax = 1000 * 1007;
const int INF = 1e9;
long long int pow(long long int x, long long int y) {
long long int res = 1;
while (y > 0) {
if (y & 1) res = (res * x);
y = y >> 1;
x = (x * x);
}
return res;
}
int main() {
ios::sync_with_stdio(0);
... | ALGO | 0.99999 | 4.404215 |
fd28be63-fbfe-48f7-93ec-4078a39e8bb2 | pranavg189/Data-Structures | LeetCode/Populatin-Next-Right-Pointers-in-Each-Node-116/BFS-recursive.cpp | /* Problem Statement: Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL.
Initially, all next pointers are... | ALGO | 0.999904 | 5.412114 |
b5c6057b-9134-48db-8915-2e34d5256791 | AquaFlyRat/B2M2 | B2M2.Engine.Common/ThirdParty/Sources/Box2D/Box2D/Collision/b2BroadPhase.cpp | #include <Box2D/Collision/b2BroadPhase.h>
b2BroadPhase::b2BroadPhase()
{
m_proxyCount = 0;
m_pairCapacity = 16;
m_pairCount = 0;
m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair));
m_moveCapacity = 16;
m_moveCount = 0;
m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int32));
}
b2BroadPha... | TOOL | 0.851999 | 6.892823 |
5051b601-9510-44b1-a80e-c638b4acf7c0 | bitcoinanatomy/bitcoinanatomy | src/codebase/bitcoin-0.11.2 Github/src/pow.cpp | #include "pow.h"
#include "arith_uint256.h"
#include "chain.h"
#include "primitives/block.h"
#include "uint256.h"
#include "util.h"
unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)
{
unsigned int nProofOfWorkLimit = UintToArith256(params.... | ALGO | 0.99861 | 7.165687 |
744af8e1-7895-412c-9e6b-363c1c61a987 | Aakash5377/KPITTraining | Day1/Demo1.cpp | #include<iostream>
int main(){
int n1 =10;
int* ptr = &n1;
int **Sptr = &ptr;
//Data inside n1
std::cout<<"Data Inside n1:"<<n1<<"\n";
//Data inside Sptr
std::cout<<"Data Inside Sptr:"<<Sptr<<"\n"; //address of ptr
//Jump ptr 1 time
std::cout<<"Jump ptr 1 time:"<<*ptr<<"\n";
... | ALGO | 0.988637 | 3.248522 |
e4b12182-e40b-413e-953c-0fe91283939d | RootHex200/Wallpaper_station | 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 |
fe109593-0946-4223-8eec-61722037f90b | bbaah123/CPlusPlus | files/SOWC++EO9 Programming Challenge Solutions/Chapter06/6_12.cpp | // Chapter 6 - Programming Challenge 12, Future Value
// Given an initial deposit, an annual interest rate and a
// number of months, this program calculates how much money
// will be in the account at the end of those months.
// THIS NEW PROGRAM MUST BE REWRITTEN TO DO WHAT IS REQUESTED
#include <iostream>
#include... | ALGO | 0.984233 | 4.402276 |
bff2f7e1-767d-4c82-9e3c-3d61ec78a40a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_1221_14.cpp | #include <bits/stdc++.h>
const int N = 100;
std::pair<int, int> a[N], b[N];
std::set<int> first[N], second[N];
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0, x, y; i < n; ++i) {
scanf("%d%d", &x, &y);
if (x > y) std::swap(x, y);
a[i] = {x, y};
}
for (int i = 0, x, y; i < m; ++i) {
... | ALGO | 0.999979 | 3.794385 |
6c40fa61-ca77-44b3-9fa7-8522e0a6471a | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_155_31.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a, b, c, d, k;
set<int> good;
int main() {
cin >> n >> k;
cin >> a >> b >> c >> d;
if (k < n + 1) {
cout << "-1\n";
exit(0);
}
if (n == 4) {
cout << "-1\n";
exit(0);
}
good.insert(a);
good.insert(b);
good.insert(c);
good.insert(d);... | ALGO | 0.999945 | 3.084818 |
65da18b4-686a-4620-9d9d-b1bc0e24da80 | ngthanhtrung23/CompetitiveProgramming | ICPC/Asia/Vietnam/2021-national/L.cpp | // Let b[i] = product of prime factors of a[i]
// (a[i]^k + a[j]^k) % a[i]a[j] = 0
// <=> (a[i] + a[j])^k % a[i]a[j] = 0
// <=> (b[i] + b[j])^k % b[i]b[j] = 0
// <=> b[i] = b[j]
#include <bits/stdc++.h>
using namespace std;
const int MV = 1e7;
int main() {
std::ios::sync_with_stdio(0); std::cin.tie(0);
i... | ALGO | 0.999876 | 4.77913 |
710b9d42-e858-455a-9d50-26808be4b0ee | Himanshu91198/Logic-Building-101 | program236.cpp | using namespace std;
#include <iostream>
typedef unsigned int UINT;
bool CheckBit(UINT iNo)
{
UINT iMask = 0X400;
UINT iResult = 0;
iResult = iNo & iMask;
if (iResult == iMask)
{
return true;
}
else
{
return false;
}
}
int main()
{
UINT iValue = 0;
bool bRet... | ALGO | 0.997679 | 5.890842 |
1e714a0b-ccb0-46ce-bf2c-f06f6e98059d | Garvit/code-backup | intern study/from pawan/GOOGLE/cond-max-subarray.SOLVED/2.cpp | // Ques : find maximum sum subarray (condition-you may skip at max one element)
#include<iostream>
using namespace std;
#define maximum(a,b) (a>b?a:b)
int main()
{
int n,i,t1 = 0,t2 = 0,max = 0, skip = 0;
cin >> n;
int a[n];
for(i=0; i<n; ++i)
cin >> a[i] ;
for(i=0; i<n; ++i)
{
if(!skip)
{
if(a[i] ... | ALGO | 0.999995 | 3.809042 |
0a576988-f08f-4f39-b42f-227fbdc4c146 | theascone/stochastic-subset-bvh | src/materials/translucent.cpp | // materials/translucent.cpp*
#include "materials/translucent.h"
#include "spectrum.h"
#include "reflection.h"
#include "paramset.h"
#include "texture.h"
#include "interaction.h"
namespace pbrt {
// TranslucentMaterial Method Definitions
void TranslucentMaterial::ComputeScatteringFunctions(
SurfaceInteraction *si... | TOOL | 0.965978 | 7.812066 |
3529fde7-79b5-4946-8f76-2935df5163f4 | ishandutta2007/codeforces | karry5307_ak_noi2022/normal/1566/D1.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int ans,n,m,t,f[305][305];
struct node
{
int val,id;
int R,C;
}a[100005];
bool cmp(node x,node y){return x.val<y.val;}
bool cmp2(node x,node y){return x.id<y.id;}
int main()
{
scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&m);
... | ALGO | 0.999723 | 3.129524 |
28305a68-e884-497c-b917-b989b408967e | sorowar-cse/Algo | Kruskal’s Minimum Spanning Tree.cpp | // Kruskals Minimum Spanning Tree Algorithm in C++
#include<bits/stdc++.h>
using namespace std;
// Creating shortcut for an integer pair
typedef pair<int, int> iPair;
// Structure to represent a graph
struct Graph
{
int V, E;
vector< pair<int, iPair> > edges;
// Constructor
Graph(int V, int E)
{
this->V = V;
... | ALGO | 0.999984 | 5.852953 |
2b9498ef-66af-4e5f-b112-0103743c39fb | ishandutta2007/codeforces | maksymoboznyi/normal/875/C.cpp | #include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int N = 1e5 + 5;
vector<int> s[N], g[N];
int n, m;
bool used[N], point[N];
bool is_less(vector<int> a, vector<int> b)
{
for (int i = 0; i < min(int(a.size()), int(b.size())); i++)
if (a[i] < b[i])
return true;
els... | ALGO | 0.999998 | 3.637051 |
c46282f9-15c9-496f-9ff2-b8da51361621 | seoyeonkk/Algorithm | [BOJ] 13460 구술탈출2.cpp | #include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
struct Node {
int depth;
int rx, ry, bx, by;
Node(int e, int a,int b, int c, int d): depth(e), rx(a), ry(b), bx(c), by(d){};
};
int r_x, r_y, b_x, b_y, h_x, h_y;
int n, m;
int ans;
int map[... | ALGO | 0.999723 | 4.288879 |
2072282d-1db4-47c9-a6c5-376a3ada7914 | satyam19mishra/Striver-DSA-AtoZ-Sheet-Solution | Tree/General Tree/diameter_of_tree.cpp | //GFG solution
/* Tree node structure used in the program
struct Node
{
int data;
struct Node* left;
struct Node* right;
Node(int x){
data = x;
left = right = NULL;
}
}; */
// approach-1 TC - O(N)
class Solution {
public:
int height(Node* node,int& diameter){
... | ALGO | 0.999959 | 6.5228 |
c5524b6b-47ec-4ab5-b87e-d989ab3f4f7b | devansh-mankar/Leetcode | 1-two-sum/two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
map<int,int>mp;
int n=nums.size();
for(int i=0;i<n;i++)
{
int num=nums[i];
int rem=target-num;
if(mp.find(rem)!=mp.end())
{
return {mp[rem],i};... | ALGO | 0.99961 | 6.233563 |
3ee3483c-40f6-46aa-aa45-f3eac6cf6696 | Andrezzz9/StackOverMemes | 3rdparty/opencv/modules/video/src/bgfg_gaussmix2.cpp | /*//Implementation of the Gaussian mixture model background subtraction from:
//
//"Improved adaptive Gaussian mixture model for background subtraction"
//Z.Zivkovic
//International Conference Pattern Recognition, UK, August, 2004
//http://www.zoranz.net/Publications/zivkovic2004ICPR.pdf
//The code is very fast and per... | ALGO | 0.982142 | 6.47049 |
89778664-2c83-408d-b9f2-dfefedb30333 | competitive-verifier/zzz_idat50me_cpp_lib | combinatorics/combinatorics.cpp | #pragma once
#ifndef call_include
#define call_include
#include <bits/stdc++.h>
using namespace std;
#endif
struct COMB {
private:
vector<long long> fact, inv, finv;
const long long P;
public:
COMB(long long n, long long p) : fact(n + 1), inv(n + 1), finv(n + 1), P(p) {
assert(P < (1 << 30) - 1);
fact[0] = fa... | ALGO | 0.996846 | 4.094871 |
3a6896be-6912-42f8-ab9a-5dd2514db786 | burperring/Algorithm_Hub | 프로그래머스/1/161990. 바탕화면 정리/바탕화면 정리.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<string> wallpaper) {
vector<int> answer;
int startX = 51, startY = 51;
int endX = -1, endY = -1;
for(int i = 0; i < wallpaper.size(); i++){
for(int j = 0; j < wallpaper[i].length(); j++){
if(w... | ALGO | 0.9987 | 4.561847 |
d4d440ff-2ffe-4292-94d0-927587e7055b | MaximePremont/R-Type_Epitech | libs/boost/libs/multiprecision/performance/linpack-benchmark.cpp | /* 1000d.f -- translated by f2c (version 20050501).
You must link the resulting object file with libf2c:
on Microsoft Windows system, link with libf2c.lib;
on Linux or Unix systems, link with .../path/to/libf2c.a -lm
or, if you install libf2c.a in a standard place, with -lf2c -lm
-- in that order, at the end of the com... | ALGO | 0.99421 | 4.811018 |
45422c73-db50-4c74-a5c3-6588feb25064 | therealbeini/manylights | src/lights/spot.cpp | // lights/spot.cpp*
#include "lights/spot.h"
#include "paramset.h"
#include "sampling.h"
#include "reflection.h"
#include "stats.h"
namespace pbrt {
// SpotLight Method Definitions
SpotLight::SpotLight(const Transform &LightToWorld,
const MediumInterface &mediumInterface, const Spectrum &I,
Float totalWidth, Fl... | TOOL | 0.976686 | 6.908631 |
85803aaf-9925-425e-9ec5-8049b77883e3 | shourya-r/Pattern-Q | Pattern 8.cpp | #include <iostream>
using namespace std;
/* PRINT PATTERN
1
2 2
3 3 3 */
int main() {
int n ;
cin>>n;
for (int i = 1 ; i<=n ; i++) {
for(int j = 1; j<=i; j++) {
cout<< i<<" ";
}
cout<<endl;
}
} | ALGO | 0.999969 | 3.684794 |
ec387c44-383b-49bf-ba09-2d07f14ed663 | codulluiandrei/pbinfo | pbinfo-4166/main.cpp | int FLsiDublu(Nod *head)
{
Nod *p, *q, *r;
int n = 0;
/// numara cate noduri are lista
for (p = head; p != NULL; p = p->leg)
n++;
if (n % 2 == 1) return -1;
/// pozitionam pointerul q la nodul n/2+1
n /= 2;
for (r = q = head; q != NULL && n > 0; q = q->leg)
{
n--;
... | ALGO | 0.995314 | 3.831673 |
aaea826b-b304-429f-b885-05d8605c7b01 | AbhishekMaira10/InterviewPrep-CP | scaler/Advanced DSA/Maths/GCD/deleteOne.cpp | /* Question -
1. https://www.scaler.com/academy/mentee-dashboard/class/29489/assignment/problems/9103?navref=cl_tt_lst_sl
*/
#include <bits/stdc++.h>
using namespace std;
int solve(vector<int> &A)
{
int n = A.size();
int pre[n], back[n];
int val = A[0];
for (int i = 0; i < n; i++)
{
pre[i]... | ALGO | 0.999975 | 4.897651 |
46ed37af-7cc8-4b31-bac0-82ebd46be569 | shree1019/recipebitebook | env/Lib/site-packages/sklearn/utils/src/MurmurHash3.cpp | // Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include "MurmurHash3.h"
//-------------... | ALGO | 0.996692 | 7.198757 |
4ee41c9b-c726-4eb0-8d8d-9a04c0b7e5d5 | KaranTalreja/LeetCode | src/subsets/solution.cpp | class Solution {
public:
void helper(vector<int>& nums, int idx, vector<int> currSet, vector<vector<int>>& retval) {
if (idx >= nums.size()) {
retval.push_back(currSet);
return;
}
helper(nums, idx+1, currSet, retval);
currSet.push_back(nums[idx]);
helper(nums, idx+1, ... | ALGO | 0.999837 | 6.35934 |
a5d85c91-77a2-4800-8e9a-c485fbb4caa5 | alexandraback/datacollection | solutions_5670465267826688_0/C++/arjunbanga/codejam_3.cpp | #include<bits/stdc++.h>
using namespace std;
int arr[30][30];
int n;
string s;
int dp[10009][10][5][3];
int func(int ind, int num, int count, int neg)
{
// cout<<ind<<" "<<num<<" "<<count<<" "<<neg<<endl;
if(ind == n && num == 4 && count == 2&&!neg)
return 1;
else if(ind == n)
return 0;
if(dp[ind][num][count][n... | ALGO | 0.999938 | 3.656572 |
c86ac3fa-76b8-46ca-8462-7a5a6fc16b69 | wallix/redemption | projects/qtclient/src/client_redemption/client_config/client_redemption_config.cpp | #include "client_redemption/client_config/client_redemption_config.hpp"
#include "capture/cryptofile.hpp"
#include "core/RDP/clipboard.hpp"
#include "core/RDP/channels/rdpdr.hpp"
#include "transport/crypto_transport.hpp"
#include "transport/mwrm_reader.hpp"
#include "utils/cli.hpp"
#include "utils/sugar/unique_fd.hpp"... | TOOL | 0.935993 | 6.321953 |
bf4dbaeb-d021-4d3a-8997-7f426c508157 | roiti46/LibContest | cpp/kruskal.cpp | // need UnionFind
// O(|E|log(|V|))
template<T>
struct Kruscal {
int V;
struct edge { int u, v; T cost; };
vector<edge> es;
Kruscal(int V_) : V(V_){};
void add(int u, int v, T cost) {
es.push_back(edge{u, v, cost});
}
bool edge_comp(const edge &e1, const edge &e2) {
return e1.cost < e2.cost;
}... | ALGO | 0.999836 | 5.563628 |
a4f4fdaf-36e3-4309-b36b-fde518d80a32 | andrew-canada/competitive-programming | codeforces/problems/1200/twopointers/1582c-grandmaCapaKnitsAScarf/1582c.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 0x3f3f3f3f
#define pb push_back
void solve()
{
int n, ans;
string s;
cin >> n >> s;
ans = n + 1;
for (int i = 0; i < 26; i++)
{
int l = 0, r = n - 1, num = 0;
while (l <= r)
{
i... | ALGO | 0.999787 | 4.651082 |
27434316-f236-4359-9014-4f4d22ed06a6 | wsn1226/Mass-Spring-1D | extern/libigl/include/igl/copyleft/cgal/half_space_box.cpp | #include "half_space_box.h"
#include "assign_scalar.h"
#include <CGAL/Point_3.h>
#include <CGAL/Vector_3.h>
template <typename DerivedV>
IGL_INLINE void igl::copyleft::cgal::half_space_box(
const CGAL::Plane_3<CGAL::Epeck> & P,
const Eigen::MatrixBase<DerivedV> & V,
Eigen::Matrix<CGAL::Epeck::FT,8,3> & BV,
Eig... | ALGO | 0.999549 | 6.553478 |
3d606186-5e5e-4006-bf66-b5b774982150 | hajoshi78/graph | GraphRepresentation/main.cpp | /*
* File: main.cpp
* Author: harsh
*
* Created on December 1, 2020, 4:36 PM
*/
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
class Graph{
private:
int nodeCount;
vector<int>* adjList;
public:
Graph(int numOfNodes){
this->nodeCount = numOfNodes;
adjL... | ALGO | 0.979292 | 5.54429 |
a1e82a8b-9d3c-4fa9-9162-467c44e7d372 | M0abl1/1103 | 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 |
1aa3135f-2a02-48c5-8052-a2c17fecb084 | Xammond/Bullet282-for-Marmalade | Bullet282-for-Marmalade/Bullet/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp | //#define DISABLE_BVH
#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"
#include "BulletCollision/CollisionShapes/btOptimizedBvh.h"
#include "LinearMath/btSerializer.h"
///Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.
///Uses an interface to a... | ALGO | 0.95233 | 7.193789 |
4b698259-4f54-4b44-bc6a-3ca52a1ffda3 | Uddoo/OpenGLRenderer | Math/LCP.cpp | //
// LCP.cpp
//
#include "LCP.h"
/*
====================================================
LCP_GaussSeidel
====================================================
*/
VecN LCP_GaussSeidel( const MatN & A, const VecN & b ) {
const int N = b.N;
VecN x( N );
x.Zero();
for ( int iter = 0; iter < N; iter++ ) {
... | ALGO | 0.999952 | 4.519422 |
9c100f9d-d847-42f9-998e-1e0f5e8c96ee | kunalrana9458/cpp_dsa_supreme | Recursion/class/class-Marathon/maximalSquare.cpp | #include<iostream>
#include<vector>
using namespace std;
int solve(vector<vector<char>>& matrix,int m,int n,int i,int j,int& maxi){
// base case if index i or j is out of bound
if(i>=m || j>=n) return 0;
// make three function calls
// one call is for the right direction
int ri... | ALGO | 0.99997 | 5.55174 |
ea1e0492-44d0-4a76-811e-7929d3ab4e25 | lega4e/olp | mai/ex/02/A.Сумма/main.cpp | #include <iostream>
using namespace std;
// main
int main( int argc, char *argv[] )
{
int n;
cin >> n;
long long sum = 0;
int input;
for(int i = 0; i < n; ++i)
scanf("%d", &input), sum += input;
cout << sum << endl;
return 0;
}
// end
| ALGO | 0.996615 | 3.719104 |
3ef44b85-1872-4ab3-9237-8e95fb08701d | metashell/metashell | 3rd/templight/llvm/lib/Analysis/MemorySSAUpdater.cpp | #define DEBUG_TYPE "memoryssa"
using namespace llvm;
// This is the marker algorithm from "Simple and Efficient Construction of
// Static Single Assignment Form"
// The simple, non-marker algorithm places phi nodes at any join
// Here, we place markers, and only place phi nodes if they end up necessary.
// They are on... | ALGO | 0.998949 | 7.402377 |
e025a17c-447f-4b26-92f1-5df29e71e127 | Kureii/Mobile_app_Stonks | 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 |
66f8477d-aaef-46e5-9e75-44962aab8a0d | feal-ca/Class-Code | ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Documents/Code/ExercisesCpp/~/Docum... | #include <iostream>
using namespace std;
string day_of_the_week (int d, int m, int y);
int main () {
}
| ALGO | 0.999683 | 3.691103 |
74e87413-80b0-4e44-9e4d-363921705fc6 | andrastantos/brew | benchmarks/botan-2.17.3/src/lib/pubkey/mce/mce_workfactor.cpp | #include <botan/mceliece.h>
#include <botan/internal/bit_ops.h>
#include <cmath>
namespace Botan {
namespace {
double binomial(size_t n, size_t k)
{
double x = 1;
for(size_t i = 0; i != k; ++i)
{
x *= n - i;
x /= k -i;
}
return x;
}
double log_binomial(size_t n, size_t k)
... | ALGO | 0.999693 | 6.929158 |
f27fe9a7-beb4-4b20-a92e-46105f74e667 | ShashiShekharDixit/Interview-150 | PartitionList.cpp | class Solution {
public:
ListNode* partition(ListNode* head, int x) {
if(!head || !head -> next)
return head;
ListNode* greater = new ListNode(-1);
ListNode* smaller = new ListNode(-1);
ListNode* g = greater;
ListNode* s = smaller;
while(head) {
if... | ALGO | 0.99999 | 5.349041 |
ab90295f-f040-4520-a390-e7b562b45b46 | openjdk/jfx13 | modules/javafx.web/src/main/native/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp | #include "config.h"
#include "RenderMathMLUnderOver.h"
#if ENABLE(MATHML)
#include "MathMLElement.h"
#include "MathMLOperatorDictionary.h"
#include "MathMLUnderOverElement.h"
#include "RenderIterator.h"
#include "RenderMathMLOperator.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IM... | TOOL | 0.886178 | 7.828362 |
c7946ce2-494a-4dd6-b145-12669e7f9120 | fonte-nele/Competitive-Programming | URI Online Judge/uri1532.cpp | /*input
14 3
13 3
12 3
5 3
30 4
0 0
*/
#include <bits/stdc++.h>
using namespace std;
#define f(inicio, fim) for(int i = inicio; i < fim; i++)
#define fr(inicio, fim) for(int j = inicio; j < fim; j++)
#define all(x) x.begin (), x.end ()
#define sz(x) (int) x.size ()
#define pb push_back
#define mk make_pair
#define fi ... | ALGO | 0.99976 | 4.11097 |
17bc41a4-e75a-4dd2-9107-4663e649e803 | face4/yukicoder | Level1/0687.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
if(n > 10) cout << 10 << " " << n-10 << endl;
else cout << 1 << " " << n-1 << endl;
return 0;
} | ALGO | 0.998931 | 3.148314 |
58e4f4cd-cfb1-421c-aa24-e89f79b04370 | quanglm1998/competitive-programming | dtl_battle/h.cpp | #include <bits/stdc++.h>
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int n;
cin >> n;
vector<int> a(n);
for (auto &u : a) {
cin >> u;
}
sort(a.begin(), a.end());
const int INF = 5001;
vector<vector<int>> dp(INF, vector<int>(INF, -1));
dp[0][0] = 0;
queue<p... | ALGO | 0.999945 | 3.78152 |
49132aa2-9413-4517-b75b-3ebf6ccb0e45 | benny5555/leetcode-problems | 2177.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<long long> sumOfThree(long long num) {
vector<long long> ans;
if (num % 3 == 0) {
long long temp = num / 3 - 1;
for (int i = 0; i < 3; ++i) {
ans.push_back(temp++);
}
}
return ans;
}
}; | ALGO | 0.999599 | 4.611068 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.