uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
29a76e19-541a-449a-ad79-b37c57eb817a | lisa-wolfgang/Vessel-Browser | source/modules/fdlibm/src/e_hypot.cpp | /* @(#)e_hypot.c 1.3 95/01/18 */
/* __ieee754_hypot(x,y)
*
* Method :
* If (assume round-to-nearest) z=x*x+y*y
* has error less than sqrt(2)/2 ulp, than
* sqrt(z) has error less than 1 ulp (exercise).
*
* So, compute sqrt(x*x+y*y) with some care as
* follows to get the error below 1 ulp:
... | ALGO | 0.999929 | 5.039317 |
0b686271-4084-41a5-84c0-c4e4d4f34101 | ksaveljev/UVa-online-judge | 1260.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(void)
{
int t, n, v;
cin >> t;
while (t--) {
cin >> n;
vector<int> values;
int result = 0;
bool first = true;
while (n--) {
cin >> v;
if (!first) {
for (int i = 0, sz = values.size(); i < sz; i++) {
... | ALGO | 0.999777 | 4.797822 |
a10b9cbb-8d1e-47c3-8abc-a364ff685a81 | pratiksaha/practice | algorithms/phiEulerTotient.cpp | //Euler's Totient Function
#include<iostream>
using namespace std;
int phiEulerTotient(int n) {
int result = n;
for (int p=2; p*p<=n; ++p) { //consider all prime factors of n and subtract their multiples from result
if (n % p == 0) { //if p is a prime factor of n
while (n%p == 0)
... | ALGO | 0.999001 | 4.619401 |
57c22640-52a9-4441-98db-7a2a821c1cd4 | rjhkim/LeetCode | 202-happy-number/happy-number.cpp | class Solution {
public:
bool isHappy(int n) {
//how do I know if it will loop endlessly
unordered_set<int> s;
while (s.find(n) == s.end()) {
s.insert(n);
n = new_num(n);
if (n == 1) {
return true;
}
}
return ... | ALGO | 0.999954 | 6.458647 |
57dd799f-b33c-435d-b221-472af70e0701 | starrykss/ProblemSolving | Baekjoon Online Judge (BOJ)/SOLVED.AC/Bronze/BOJ1008.cpp | #include <iostream>
using namespace std;
double A, B;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// Fix Precision
cout << fixed;
cout.precision(32);
cin >> A >> B;
cout << A / B;
return 0;
} | ALGO | 0.996791 | 3.691018 |
4d939b94-0f7b-4c71-9d02-b80ff73b8a45 | metux/vtk8 | ThirdParty/verdict/vtkverdict/V_WedgeMetric.cpp | /*
*
* WedgeMetric.cpp contains quality calculations for wedges
*
* This file is part of VERDICT
*
*/
#include "verdict.h"
#include "VerdictVector.hpp"
#include <memory.h>
#include "verdict_defines.hpp"
#include "V_GaussIntegration.hpp"
/*
the wedge element
5
^
/ \
/ | \
/ /2\ \
6/_______\... | TOOL | 0.991633 | 5.872433 |
2b533088-7c8b-49a5-83b1-e91f36cf2f4c | ishandutta2007/codeforces | interestinglsy/normal/1227/G.cpp | // InterestingLSY
// 2659723130
//
#ifdef intLSY
#include <intlsy/stdc++.h>
#else
#include <bits/stdc++.h>
#endif
#include <bits/c++0x_warning.h>
using namespace std;
#define il inline
#define elif else if
// Type
#define ld double
#define ll long long
#define ull unsigned ll
// Vector
#define vc vector
#define Pb p... | ALGO | 0.999998 | 3.794072 |
fca68695-d0c5-4490-99da-1a5a33f1e355 | Boogimoogi/Embedded-System-Lab | Lab4/mbed-os-empty 23-07-20-107/mbed-os/connectivity/cellular/source/framework/common/APN_db.cpp | /* ----------------------------------------------------------------
APN stands for Access Point Name, a setting on your modem or phone
that identifies an external network your phone can access for data
(e.g. 3G or 4G Internet service on your phone).
The APN settings can be forced when calling the join func... | TOOL | 0.880185 | 6.293933 |
91f9e74a-690a-43d8-b1bd-eb954e9985f6 | xixi-shredp/xixi-gem5 | src/systemc/tests/systemc/misc/sim/prime_do_while/prime_numgen.cpp | /*****************************************************************************
prime_numgen.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/***********************************************************************... | ALGO | 0.999727 | 5.094754 |
ee566ce4-75b2-4656-82a4-3e28918f5ecb | v3eti/test | C++ Lab2E1/main.cpp | #include <iostream>//Lab2E1
#include <cmath>
using namespace std;
int num1, num2;
double dub1, dub2;
bool roundTF = 0;
///int prdt=1;
//A
void multiply(int a, int b){ //mutiply function that multiplyes imputs 1 and 2 together
cout << "product = " << (a * b) << "\n";
}
void multiply(double a, double b){ // overloaded d... | TOOL | 0.946933 | 4.198587 |
23b0c8e0-b440-4aec-b0f9-0e383e5441b1 | Abu-Zakaria/problemsets | 1335/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define PRINT(stuff) std::cout << stuff << endl
#define PRINT_NO_LINE(stuff) std::cout << stuff
#define PRINT_VEC(stuff) \
for (size_t i = 0; i < stuff.size(); i++) \
{ \
PRINT(... | ALGO | 0.998976 | 4.665298 |
7c4cc3c6-ca23-4264-bc9d-e988e09ee720 | karmineg/CPP-algorithms-data-structures | Algoritmos II/Exemplos Ponteiro/Exemplo_20.cpp | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<ctime>
using namespace std;
void leitura(int *valores);
void mostra(int *valores);
main()
{
int vet[5];
leitura(vet);
mostra(vet);
getchar();
}
void leitura(int *valores)
{
int x;
srand(time(NULL));
cout << "Posicao inicial d... | ALGO | 0.990054 | 3.091668 |
d5aef482-44d1-4d6f-859f-2c414da91b44 | joshuaxiao13/USACO | 2015-2016 Season/February 2016/Bronze/circularBarn.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
typedef long long ll;
typedef vector<int> vi;
typedef unsigned long ul;
typedef vector<int> vi;
typed... | ALGO | 0.999991 | 3.696493 |
f701bfce-ad3d-492e-ac32-6ea8abb7eeb5 | AryamannNingombam/competitive-programming-practice | ary_amann/cf/149A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int get_results(int k, vector<int> &values)
{
if (k == 0)
return 0;
sort(values.begin(), values.end());
int sum = 0, i;
for (i = 11; i > -1; i--)
{
if (sum >= k)
break;
sum += values... | ALGO | 0.999933 | 3.729898 |
79e53402-ddbc-4a3c-bb74-69de1e5352c1 | Yao-Jin/dynamic-contact-lines-on-an-elastic-membrane | droplet_relaxation/tools/distmesh/dsegment.cpp | #include "mex.h"
#include <cmath>
#define p(i,j) p[(i)+np*(j)]
#define pv(i,j) pv[(i)+nvs*(j)]
#define ds(i,j) ds[(i)+np*(j)]
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T dot2(T *a,T *b) { return a[0]*b[0]+a[1]*b[1]; }
template<class T> inline T length(T x,T y) { return sqrt(sqr(x)+s... | ALGO | 0.999521 | 5.004622 |
46b92123-319d-4325-be57-fc6bb8abbe72 | ashishg2004/Leetcode-questions | 1631-number-of-sub-arrays-with-odd-sum/number-of-sub-arrays-with-odd-sum.cpp | class Solution {
public:
int numOfSubarrays(vector<int>& arr) {
int prefsum=0;
int even=0;
int odd=0;
int cnt=0;
int MOD=1e9+7;
for(int i=0;i<arr.size();i++)
{
prefsum+=arr[i];
if(prefsum%2==0)
{
even++;
... | ALGO | 0.999996 | 5.80676 |
f55ab6f7-2a83-44b9-b939-ff6912d0481f | bhavyawig/Competitive-Programming | Plus Minus hackerrank.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
float pos=0,neg=0,zero=0;
int n,i;
cin>>n;
int arr[n];
float pos1,zero1,neg1;
for(i=0;i<n;i++)
{
cin>>arr[i];
if(arr[i]>0)
{
pos++;
}
else if(arr[i]<0)
{
neg++;
... | ALGO | 0.999622 | 3.742651 |
84893e08-c8c6-43b6-8ccc-da148e44a5fa | Shubhamlmp/Programming-Practice | C++/37_Primes_from_1_to_n.cpp | //Given a number N. Print all prime numbers between 1 and N inclusive.
#include <iostream> //iostream is a header file which contains basic input/output functions.
#include <iomanip> //iomanip is a header file which contains functions for input/output manipulations.
#include <cma... | ALGO | 0.999176 | 4.726393 |
accc69f8-1385-4608-9be9-d2949d0ce3e4 | ever330/CodingTest | 프로그래머스/lv2/49994. 방문 길이/방문 길이.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
int solution(string dirs) {
int answer = 0;
vector<int> nowPos;
nowPos.emplace_back(0);
nowPos.emplace_back(0);
vector<vector<string>> xMoveDir(11);
vector<vector<string>> yMoveDir(11);
for (auto i = 0; i < dirs.size(); i++)... | ALGO | 0.999809 | 4.472087 |
f2d26ba3-7596-48b9-8d24-685d35514132 | Chinamming/bullet | Extras/CDTestFramework/Opcode/OPC_OBBCollider.cpp | /*
* OPCODE - Optimized Collision Detection
* http://www.codercorner.com/Opcode.htm
*
* Copyright (c) 2001-2008 Pierre Terdiman, <EMAIL>
This software is provided 'as-is', without any express or implied warranty.
In no event will the authors be held liable for any damages arising from the use of this software.
P... | ALGO | 0.992212 | 7.660118 |
bf055e71-2174-4ead-b25c-5d7446c1aa46 | maybehieu/CPP_CodePTIT | exerWeb/hoan_vi_lien_ke_truoc.cpp | #include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
using std::endl;
void solve(int *arr, int n)
{
int pos;
for (int i = n - 1; i >= 0; i--)
{
if (arr[i] < arr[i - 1])
{
pos = i - 1;
break;
}
}
int arrMax = 0, maxPos = 0;
for... | ALGO | 0.999955 | 4.634486 |
89d4c575-4fd2-40e0-94cb-4af791715101 | fredtux/NotiteExamene_An2_Sem1 | AlgoritmiFundamentali/NotiteColocviu/algo/apm/Kruskal.cpp | //
// Created by meadi on 11/9/2021.
//
//Kruskal cu k muchii date
#include <vector>
#include<fstream>
#include <utility>
#include <algorithm>
using std::vector;
struct ConnectedComponentVertex {
int parentIndex;
int componentDepth;
};
// First is the vertex, second is the depth
std::pair<int, int> getRoot... | ALGO | 0.999908 | 4.975878 |
f2930374-895b-4423-ab59-a559a2060a64 | Stefanlov1ez/System_Orin_NX | cuda-samples/Samples/5_Domain_Specific/bicubicTexture/bicubicTexture.cpp | /*
Bicubic texture filtering sample
sgreen 6/2008
This sample demonstrates how to efficiently implement bicubic texture
filtering in CUDA.
Bicubic filtering is a higher order interpolation method that produces
smoother results than bilinear interpolation:
http://en.wikipedia.org/wiki/Bicub... | ALGO | 0.989721 | 5.820656 |
cd163688-9b59-4ec3-83ab-2b32cece8ce0 | Kawser-nerd/CLCDSA | Source Codes/CodeJamData/15/01/13.cpp | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
#define FOR(prom, a, b) for(int prom = (a); prom < (b); prom++)
#define FORD(prom, a, b) for(int pr... | ALGO | 0.999037 | 3.989095 |
6e61a232-c506-4cb9-9ff6-85eb4dd9c3ae | chaowang15/MeshSimplification | mesh_simp/mesh_simp/include/Eigen/doc/examples/class_VectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived>
segmentFromRange(MatrixBase<Derived>& v, int start, int end)
{
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
}
template<typename Derived>
const Eigen::Vec... | TOOL | 0.975921 | 4.383477 |
de1ce23c-9dc3-463d-9a98-34df311d5c8a | legendsovermyths/DSA | C++/MinSwapsAndKTogether.cpp | // { Driver Code Starts
// C++ program to find minimum swaps required
// to club all elements less than or equals
// to k together
#include <iostream>
using namespace std;
int minSwap(int *arr, int n, int k);
// Driver code
int main()
{
int t, n, k;
cin >> t;
while (t--)
{
cin >> n;
i... | ALGO | 0.999972 | 5.923016 |
50f5cc9c-6559-46b7-b085-ba16d9a5df09 | gauri-singh/LeetCodeQuestions | 0084-largest-rectangle-in-histogram/0084-largest-rectangle-in-histogram.cpp | class Solution {
public:
int largestRectangleArea(vector<int>& heights) {
int maxArea=0, n=heights.size();
stack<pair<int,int>> stk; //starting index x height
for(int i=0;i<n;i++){
int start = i;
while(!stk.empty() && stk.top().second> heights[i]){
//... | ALGO | 0.999968 | 6.893405 |
ff709681-fdad-4ca6-bc04-665bf9a7bd34 | jjiny0716/Algorithm | Codewars/c++/6kyu_Create_Phone_number.cpp | #include <string>
using namespace std;
std::string createPhoneNumber(const int arr[10]) {
string result = "";
for (int i = 0; i < 10; i++)
result += to_string(arr[i]);
result.insert(0, "(");
result.insert(4, ")");
result.insert(5, " ");
result.insert(9, "-");
return result;
} | ALGO | 0.993043 | 4.930574 |
85db0587-24df-4a4a-9e95-d61bd833f53a | sahapranta/practice-c | ph-algo/graph/bfs/extra.cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> v[1000];
bool vis[1000];
int level[1000];
void bfs(int src)
{
queue<int> q;
q.push(src);
vis[src] = true;
level[src] = 0;
while (!q.empty())
{
int p = q.front();
q.pop();
cout << p << endl;
for (int chi... | ALGO | 0.999985 | 4.393988 |
35e29d87-b12e-47c6-baba-f727d73285b9 | BrowserWorks/waterfox | other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.cpp | // UniqBlocks.cpp
#include "StdAfx.h"
#include <string.h>
#include "UniqBlocks.h"
unsigned CUniqBlocks::AddUniq(const Byte *data, size_t size)
{
unsigned left = 0, right = Sorted.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
unsigned index = Sorted[mid];
const CByteBuffer &buf... | ALGO | 0.883026 | 5.733712 |
ef2bc6c0-84b6-4151-8253-1c6ae5bb536b | KOWSHIQKATTAMURI/GFG-Problem-of-the-day-solutions-by-Kowshiq-Kattamuri | Hard/Find the String/find-the-string.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:
bool dfs(int n, int k, int total_possibilities, string &path, set<string> &visited){
if(visited.size() == total_possibilities){
... | ALGO | 0.999467 | 5.460599 |
b94c8376-7c72-4979-990f-be8f363be1b1 | Moon-ChangHyun/BOJ | 2439/source.cpp | #include <iostream>
int main() {
int n;
std::cin >> n;
for (int i = 1; i <= n; ++i) {
int j = 0;
for (; j != n - i; ++j) printf(" ");
for (; j != n; ++j) printf("*");
printf("\n");
}
} | ALGO | 0.999956 | 4.029501 |
1d1b00c2-2938-4f74-985a-f6c04f3cdd7b | QZKasoma-Luo/CG_Computing | ext/eigen/doc/examples/tut_arithmetic_redux_basic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::Matrix2d mat;
mat << 1, 2,
3, 4;
cout << "Here is mat.sum(): " << mat.sum() << endl;
cout << "Here is mat.prod(): " << mat.prod() << endl;
cout << "Here is mat.mean(): " << mat.mean() ... | ALGO | 0.999063 | 3.870119 |
b7add279-8fb7-4cc7-b947-1aa468bb53e9 | University-of-Utah-CS3505/a9-edu-app-ryan-rockhopper | Box2D/Collision/Shapes/b2PolygonShape.cpp | #include <Box2D/Collision/Shapes/b2PolygonShape.h>
#include <new>
b2Shape* b2PolygonShape::Clone(b2BlockAllocator* allocator) const
{
void* mem = allocator->Allocate(sizeof(b2PolygonShape));
b2PolygonShape* clone = new (mem) b2PolygonShape;
*clone = *this;
return clone;
}
void b2PolygonShape::SetAsBox(float32 hx,... | ALGO | 0.985976 | 7.926646 |
159a0186-a523-4b77-8ffd-af7210ec9441 | digSelf/algorithms | 01.basic_algorithms/07.Miscellaneous/02.discretization/related_problems/1331.array_rank_transform_stl.cpp | // 这个版本使用的是stl的lower_bound函数进行实现
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> arrayRankTransform(vector<int>& arr) {
vector<int> map(arr);
sort(map.begin(), map.end());
map.erase(unique(map.begin(), map.end()), map.end());
vector... | ALGO | 0.999951 | 5.417109 |
4116d1be-5314-4d01-bc01-a105194e76ed | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4517_9.cpp | #include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double gammama = 0.57721566490153286060;
const long double eps = 1e-5;
const int INF = 1000 * 1000 * 1000 + 10;
const int N = 1000 * 1000 * 1000 + 10;
int main() {
int n,... | ALGO | 0.99994 | 3.369807 |
3d41d8cb-5e07-4120-b5e6-b3264fc89499 | yanaih16/procon_archive | atcoder.jp/abc199/abc199_b/Main.cpp | #include<bits/stdc++.h>
using namespace std;
using i64 = long long;
int main(){
i64 n,amax=0,bmin=1000;
cin>>n;
for(i64 i=0;i<n;i++){
i64 a;
cin>>a;
if(amax<a) amax = a;
}
for(i64 i=0;i<n;i++){
i64 b;
cin>>b;
if(bmin>b) bmin = b;
}
cout<<(bmi... | ALGO | 0.999928 | 3.695234 |
bd1a708b-86b1-4352-a99d-07729ad5faca | clang-engineer/cpp-coding-test | tests/baekjoon/_2458.cpp | //
// Created by zero on 2023/07/21.
//
#include "baekjoon/_2458.h"
#include <gtest/gtest.h>
#include <vector>
namespace baekjoon_2458 {
TEST(_2458, case1) {
std::vector vec{1, 3, 7, 13};
Solution solution(vec);
EXPECT_EQ(3, solution.GetAnswer());
}
TEST(_2458, case2) {
s... | TEST | 0.998797 | 5.8594 |
c1104abb-d664-4a41-a380-c29bcc12eeaa | Dima-salang/sjlshs_chronos | 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 |
c6b5dab7-4da8-4551-ac27-0aa6891c62f3 | azharsofi/Striver-s-A2Z-DSA-Course-Sheet | BinarySearch/kokoeatingbanana.cpp | class Solution {
bool ispossible(vector<int>& piles, int eatingSpeed, int hours) {
int hoursSpent = 0;
for(int i=0;i<piles.size();i++){
hoursSpent += piles[i]/eatingSpeed;
if(piles[i]%eatingSpeed!=0){
hoursSpent += 1;
}
if(hoursSp... | ALGO | 0.999985 | 5.373385 |
34fe1c59-e05d-439e-9a1d-acffac55ef55 | BryanDanielMartinezCabezas/PlantasVsZombisSIS457 | PlantasVsZombisSIS457/ZombiAntorcha.cpp | #include "ZombiAntorcha.h"
int quema;
void ZombiAntorcha::quema()
{
direccionY = 1;
for (int i = 0; i < 10; i++)
{
posicionY += direccionY * velocidadMovimiento;
//quema todo a su paso
}
} | TOOL | 0.895753 | 3.227694 |
3ca6fb5c-2e0d-4040-9f65-8a86f6f1808e | HarborDong/LeetCode | C++/62.Unique_Paths.cpp | class Solution {
public:
/**
* we use path(A->B) to indicate the number of unique path from A to B;
* The transformation equation :
* path(A->B) = path(A->C) + path(A->D);
*/
int uniquePaths(int m, int n) {
if(m < 1 || n < 1) return 0;
int step[m][n];
for(in... | ALGO | 0.999958 | 6.367794 |
912c87b1-25d4-4df7-9e5c-a0ab2ff479fd | boatinw99/CompetitiveProgramming | Codeforces/863C.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll A[2][3][3];
ll B[3][3][3];
//turn x y ;
main()
{
ll n,x,y,i,j,p,q,turn=1;
scanf("%I64d %I64d %I64d",&n,&x,&y);
for(p=0;p<2;p++)
{
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%I64d",&A[p][i][j]);
A[p][i][j]--;
}
}
}
for(i... | ALGO | 0.999969 | 3.180015 |
26f0b5f3-7b41-4306-97b0-653fe37a7e9e | kronos/Task-solutions | acmp.ru/0000-0100/0064.cpp | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <algorithm>
#include <sstream>
#include <queue>
using namespace std;
string s="";
int n,p=1;
bool prime(int p)
{
if (p==2)
return true;
if (p%2==0)
return false;
int pr = sqrtf(p);
bool f = t... | ALGO | 0.999733 | 3.839484 |
24759371-e1de-4995-86f1-15426e65c50e | neikion/cpp_algorithm | BreadthFirstSearch.cpp | #include"BreadthFirstSearch.h"
#include<iostream>
namespace BREADTH_FIRST_SEARCH {
void BreadthFirstSearch::showTest() {
node root;
node node1(1,1);
node node2(2,2);
node node3(3,3);
node node1_1(4,4);
node node1_2(5,5);
node node3_1(6,6);
node node3_2(7,7);
node node1_2_1(8,8);
node node1_2_2(9,9)... | ALGO | 0.998204 | 4.151991 |
d0fb0006-8e44-48d4-ab1c-532396689864 | fyl0531/-Introduction-to-algorithms | SA18225079+fyl+实验五最长公共子序列(LCS)算法/LCS.cpp | #include<iostream>
#include<string>
#include<stdlib.h>
using namespace std;
const int LEN=26;
char RAND[LEN]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
void PRINT_LCS(int **b,int i,int j,string X,string Y)
{//ιLCSԪ
if(i==0||j==0)
return;
if... | ALGO | 0.999655 | 3.38666 |
c7525eb2-5aa7-482d-9006-c3f7a12db70b | Abunyawa/contests | NEERC2017-2018North/header.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define vi vector<int>
#define vl vector<long long>
#define pii pair<int, int>
#define pll pair<long long, long long>
#de... | ALGO | 0.999233 | 4.403654 |
f3aef9c7-7cc0-473b-8d84-88ed120fe2fd | wildDoubt/code-problems | Programmers/programmers42883.cpp | #include <string>
#include <vector>
#include <algorithm>
using namespace std;
string solution(string number, int k) {
int left = k;
string answer = "";
for(int i = 0;i<(int)number.size();i++){
bool flag = true;
for(int j = left;j>0;j--){
if(i+j>=(int)number.size()){
... | ALGO | 0.999943 | 5.88918 |
c5a15acc-666b-4dca-bcfd-1edef3232838 | KausBoss/CP-SubGrouped | SPOJ/NHAY.cpp | /*
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define fi first
#define si second
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define F(a,n) for(int i=0;i<n;i++){cin>>a[i... | ALGO | 0.999859 | 4.206837 |
20cf3c44-7bb4-4f51-b8c4-3fc74eb697b9 | hztttt/Synergistic_Optimization | lammps_DeepSPIN/src/OPENMP/pair_adp_omp.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "pair_adp_omp.h"
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "memor... | ALGO | 0.999206 | 6.244122 |
d1dc4811-e558-47e2-a87e-018a3c2d12ab | ishandutta2007/codeforces | reyna/normal/494/B.cpp | //In the name of God
#include <iostream>
#include <vector>
using namespace std;
const int Mod = 1e9 + 7;
const long long hMod = (long long)1000*1000*1000*1000*1000 + 7;
const int Maxn = 1e5 + 20;
const int Zarib = 43;
long long dp[Maxn];
int ptr[Maxn];
long long pw[Maxn];
long long sum[Maxn];
vector<int> Occ;
long long... | ALGO | 0.999993 | 4.595755 |
58e0d5e9-8a4c-4b28-90e8-68fd1cd95e6f | zhh7ce/leetcode | 393.utf-8-编码验证.cpp | /*
* @lc app=leetcode.cn id=393 lang=cpp
*
* [393] UTF-8 编码验证
*/
#include<vector>
using namespace std;
// @lc code=start
class Solution {
public:
bool validUtf8(vector<int>& data) {
int extend = 0;
for (auto i: data) {
if (extend > 0) {
if (i < 128 || i >= 192) retur... | ALGO | 0.997442 | 6.335376 |
bb7d0c71-3e2e-4584-bfcd-eca27791c6ff | mortany/xray16-copwp_oxr | src/xrCore/Compression/lzo_compressor.cpp | #include "stdafx.h"
#include "lzo_compressor.h"
#include "lzo/lzo1x.h"
int lzo_compress_dict(
const void* input, u32 inputSize, void* output, u32& outputSize, void* workMem, const void* dict, u32 dictSize)
{
return lzo1x_999_compress_dict(
(lzo_bytep)input, inputSize, (lzo_bytep)output, (lzo_uintp)&out... | TOOL | 0.926025 | 6.054196 |
b9332242-2f7d-4e5f-9089-6fe6cf9863c0 | cyph3rk/Challenges | 1065.cpp | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int numero = 0;
int total = 0;
for (int i = 0; i < 5; i++) {
cin >> numero;
if (numero % 2 == 0) {
total++;
}
}
cout.precision(1);
cout << fixed;
cout << total << " valores pares" << endl;
return 0;
} | ALGO | 0.999705 | 4.162476 |
9a8db62a-9267-45f7-a08b-ed384521e1f2 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_9463_3.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, m;
while(scanf("%d%d",&n, &m, (n | m)){
int N = n+m, arr[N];
for(int i = 0 ; i < N ; i++){
scanf("%d" ,arr+i);
}
sort(arr, arr+N);
int max = arr[0];
for(int i = 0 ; i < N ; i++){
max = std::max(max, arr[i] -... | ALGO | 0.999739 | 3.567684 |
c6efbd3f-9982-49af-9a29-157925640671 | ihSomik/problem-solving | gfg/GfG 160 - 160 Days of Problem Solving/Day 40 - Search in a sorted Matrix_2.cpp |
class Solution {
public:
// Function to search a given number in row-column sorted matrix.
bool searchMatrix(vector<vector<int>> &mat, int x) {
// code here
int n = mat.size(), m = mat[0].size();
int l = 0, r = n - 1, row = -1;
while (l <= r) {
int mid = l + (r - l) / 2;
if (mat[mid][... | ALGO | 0.99993 | 6.091269 |
fa1a2121-8f8b-4f8a-9362-1f10f8b0a582 | ishandutta2007/codeforces | fqw/normal/101/A.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXN=100010;
char s[MAXN], t[MAXN];
int n, k;
int main() {
scanf("%s%d", s+1, &k); n=strlen(s+1);
int cnt[26]={0};
for(int i=1; i<=n; ++i) cnt[s[i]-'a']++;
vector<pair<int,char> > lst;
... | ALGO | 0.999993 | 3.513593 |
62f1776b-d301-44ed-9fb8-9a256c95c915 | nxphuc/LeetCode | algorithms/0009-palindrome-number.cpp | // Title: Palindrome Number
// Source: https://leetcode.com/problems/palindrome-number
// Difficulty: Easy
// Tags: Math
// Author: nxphuc
// Time Complexity: O(1)
// Space Complexity: O(1)
// Topic:
/**
* Given an integer x, return true if x is a palindrome, and false otherwise.
*
* Example 1:
* Input: x = 121
... | ALGO | 0.99996 | 6.327768 |
d84bad7f-06de-4438-ae9b-f0448a06181e | TuringKi/llvm-project-12-wasi | libcxx/test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp | // <numeric>
// UNSUPPORTED: c++03, c++11, c++14
// UNSUPPORTED: clang-8
// UNSUPPORTED: gcc-9
// Became constexpr in C++20
// template<class InputIterator, class OutputIterator, class T,
// class BinaryOperation, class UnaryOperation>
// OutputIterator transform_inclusive_scan(InputIterator first, InputIte... | TEST | 0.980175 | 7.001319 |
0fadf94c-8b6b-40a1-a69e-8fbecbfde300 | dmitrylevachev/particle-filter | src/particle_filter.cpp | /**
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include "particle_filter.h"
#include <math.h>
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <random>
#include <string>
#include <vector>
#include "helper_functions.h"
using std::string;... | ALGO | 0.993595 | 4.89851 |
a095a23e-5155-44e5-9341-2ff3b9e52ea3 | jeong-hyeonHwang/Algorithm | Steps/Step2/prob_2753.cpp | //2022.01.02
#include <iostream>
int main()
{
int year;
std::cin >> year;
if(year%4 == 0)
{
if(year%100 != 0 || year%400 == 0)
std::cout << 1;
else
std::cout << 0;
}
else
std::cout << 0;
} | ALGO | 0.999975 | 4.556672 |
31bd339d-7c8a-472d-9d3e-dc8e51e807a1 | afsanamim04/Codeforces_Solution | BAN BAN.cpp | #include<bits/stdc++.h>
#define PI acos(-1.0)
#define all(x) x.begin(),x.end()
#define nl '\n'
typedef long long int ll;
typedef unsigned long long int llu;
using namespace std;
void sol()
{
int n;
cin>>n;
if(n%2==0)
cout<<n/2<<nl;
else cout<<(n/2)+1<<nl;
int a=1,b=3*n;
for(int i=0; i... | ALGO | 0.999757 | 3.772102 |
d12aca73-8633-4c27-9c15-f8deb6d268bb | RowerOjMateusza/grafikaUAM | dependencies/physx-4.1/source/geomutils/src/GuSweepTests.cpp | #include "geometry/PxSphereGeometry.h"
#include "GuSweepTests.h"
#include "GuVecCapsule.h"
#include "GuVecBox.h"
#include "GuVecTriangle.h"
#include "GuSweepTriangleUtils.h"
#include "GuInternal.h"
#include "PsFoundation.h"
#include "GuGJKRaycast.h"
using namespace physx;
using namespace Gu;
using namespace Cm;
using ... | ALGO | 0.987191 | 7.839252 |
39991a80-bf21-4e95-be49-40902b2d2be1 | BlueMobiusUser/wallet | src/llmq/quorums.cpp | #include <llmq/quorums.h>
#include <llmq/commitment.h>
#include <llmq/blockprocessor.h>
#include <llmq/dkgsession.h>
#include <llmq/dkgsessionmgr.h>
#include <llmq/utils.h>
#include <evo/specialtx.h>
#include <evo/deterministicmns.h>
#include <chainparams.h>
#include <masternode/node.h>
#include <masternode/sync.h>
#... | TOOL | 0.932515 | 4.475546 |
0a16a4d4-89dd-4c3d-8893-1ea806444315 | icecat2012/leetcode | problems/31. Next Permutation/solve.cpp | class Solution {
public:
void nextPermutation(vector<int>& nums) {
if (nums.size()<2) {return;}
else if(nums.size()==2)
{
swap(nums[0], nums[1]);
return;
}
int i=nums.size()-2, j=nums.size()-1;
while (i>=0 && nums[i]>=nums[i+1]) --i;
if... | ALGO | 0.99999 | 5.660789 |
289b3d59-aa9e-4e53-af67-bca83c38761e | KeanuOrig/FlutterHRIS | 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 |
056484df-5513-43c4-8f6f-c6797b57e406 | Kiran-Chaitu/LeetCode | 451-sort-characters-by-frequency/sort-characters-by-frequency.cpp | #include<bits/stdc++.h>
bool compare(pair<char,int> a, pair<char,int> b){
return a.second > b.second;
}
class Solution {
public:
string customSort(string s){
unordered_map<char, int> m;
for (int i = 0; i < s.size(); i++) m[s[i]]++;
vector<pair<char,int>> ans(m.begin(), m.end());
... | ALGO | 0.999987 | 5.820332 |
2c7c517d-c623-4762-81a3-d4edd3316dae | charmedlabs/pixy2 | src/device/main_m4/src/progchase.cpp | #include "progchase.h"
#include "pixy_init.h"
#include "camera.h"
#include "qqueue.h"
#include "blobs.h"
#include "spi.h"
#include "rcservo.h"
#include "cameravals.h"
#include "conncomp.h"
#include "param.h"
extern Qqueue *g_qqueue;
extern Blobs *g_blobs;
Program g_progChase =
{
"chase",
"chase an object (demo)",
... | TOOL | 0.951986 | 5.188302 |
f525c929-7e91-46d9-ae5b-6e7eb277b4b8 | animikhaich/NeRF-Editing-GP | volumeARAP_batch/Eigen/bench/perf_monitoring/trmv_lot.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void trmv(const Mat &A, Vec &B, const Vec &C)
{
B.noalias() += A.transpose().triangularView<Lower>() * C;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, trmv);
}
| ALGO | 0.977427 | 4.976362 |
6fa522a4-4502-4456-ab2c-c241b21440a5 | basecode-lang/basecode | share/prototypes/bootstrap-redux/ext/boost-1.70.0/libs/iterator/example/shared_iterator_example1.cpp | #include "boost/shared_container_iterator.hpp"
#include "boost/shared_ptr.hpp"
#include <algorithm>
#include <iostream>
#include <vector>
typedef boost::shared_container_iterator< std::vector<int> > iterator;
void set_range(iterator& i, iterator& end) {
boost::shared_ptr< std::vector<int> > ints(new std::vector<i... | TOOL | 0.959535 | 3.421442 |
736ba172-c9cc-4707-be8c-18b45fc61e13 | QibangLiu/PDLSM-FEM_mpi | SourceFiles/Solver/pdfemEleQuad4N.cpp | #include "pdfemEleQuad4N.h"
extern calMatrixOperations matoperat;
extern pdGaussPt o_globGP;
extern pdGaussPt o_sigGP;
pdfemEleQuad4N::pdfemEleQuad4N(int id, int* nId, int algoType, dataLev2* p_datLev2) :
pdfemEles(id, 4, nId, algoType,p_datLev2)
{
ci_eleType = 9;
}
pdfemEleQuad4N::~pdfemEleQuad4N()
{
}
void pdfem... | ALGO | 0.998039 | 4.029977 |
2eadc53f-1df1-498c-9ae4-9f096a2092eb | Rafia-ak/OOP-Lab | q1.cpp | #include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
if (argc != 21) {
cout << "Error: Please provide exactly 20 float numbers as arguments.\n";
return 1;
}
float array[20];
for (int i = 1; i < argc; i++) {
array[i - 1] = atof(argv[i]);
}
float ... | ALGO | 0.999461 | 5.509593 |
bbda9f0d-d6e7-4fe6-8ce0-e737c8d41760 | Deepanshu-dahiya/Data-Structure-and-Algorithm | Matrix/Find a specific pair in a Matrix.cpp | /*Given an n x n matrix mat[n][n] of integers, find the maximum value of mat(c, d) mat(a, b)
over all choices of indexes such that both c > a and d > b.
Example:
Input:
mat[N][N] = {{ 1, 2, -1, -4, -20 },
{ -8, -3, 4, 2, 1 },
{ 3, 8, 6, 1, 3 },
{ -4, -1, 1, 7, -6 },
... | ALGO | 0.99999 | 4.966376 |
fa8a970a-556c-48f9-a5b0-26b5c387af3d | TheSkyEr4998/ALL_DSA_QUESTIONS | JS/07_Power of two/Ideal Solutions/powerOfTwo.cpp | #include<bits/stdc++.h>
using namespace std;
// Function to check if N is power of 2
bool isPowerOfTwo(int N){
// Repeated division by 2
while( N%2 == 0)
N/= 2;
if(N == 1)
return true;
else
return false;
}
int main(){
int N = 4;
if( isPowerOfTwo(N) )... | ALGO | 0.999237 | 4.338945 |
7c4e5c3b-8b4b-4ad8-96b7-1882878b9890 | efogdev/flying-bear-reborn-robin-v3-marlin | Marlin/src/lcd/menu/menu_motion.cpp | //
// Motion Menu
//
#include "../../inc/MarlinConfigPre.h"
#if HAS_LCD_MENU
#define LARGE_AREA_TEST ((X_BED_SIZE) >= 1000 || (Y_BED_SIZE) >= 1000 || (Z_MAX_POS) >= 1000)
#include "menu_item.h"
#include "menu_addon.h"
#include "../../module/motion.h"
#include "../../gcode/parser.h" // for inch support
#if ENABLED... | TOOL | 0.864718 | 6.657492 |
a1f97fbc-fa3c-4c3a-8377-fba9b658550d | nilsbore/gp_compressor | src/gp_registration.cpp | #include "gp_registration.h"
#define COMPUTE_LIKELIHOOD 0
using namespace Eigen;
gp_registration::gp_registration(pointcloud::ConstPtr cloud, double res, int sz,
asynch_visualizer* vis) :
gp_compressor(cloud, res, sz), delta(6, 1), delta_diff_small(false),
step(1e-1f), vis(vi... | ALGO | 0.980827 | 5.686747 |
3f53247e-0dd4-4869-9a90-5afd56bd88a1 | jiangyc2024/NumCSE | Assignments/Codes/MatVec/ComplexRoot/solutions_nolabels/complexroot.cpp | //! \brief Compute complex root
//! \param[in] w complex number with non negative imaginary parts
//! \return the square root of w with non negative real and imaginary parts
std::complex<double> myroot( std::complex<double> w ) {
double x,y;
double u = w.real();
double v = w.imag();
// w is actually a ... | ALGO | 0.999706 | 5.560665 |
ecc1e94e-582a-4f80-ad81-1266b20976d0 | burnoz/situacion-problema | Etapa 2/test/test.cpp | //g++ listaEnlazadaEj.cpp -o listaEnlazadaDoble; ./listaEnlazadaDoble
#include <iostream>
#include <sstream>
#include <cstring>
#include <string>
using namespace std;
// Funcion para obtener el nombre del restaurante de una orden
string get_restaurant(string order){
string restaurant;
int restaurant_start_in... | ALGO | 0.994315 | 4.288876 |
b1011cc3-4559-4b24-9635-f69b6278e092 | DungNguyenCoder/LeetCode | Array_String/318.MaximumProductofWordLengths.cpp | #include <bits/stdc++.h>
using namespace std;
// https://leetcode.com/problems/maximum-product-of-word-lengths/description/?envType=problem-list-v2&envId=string
class Solution {
public:
int maxProduct(vector<string>& words) {
int n = words.size();
unordered_set<char> se;
... | ALGO | 0.999495 | 5.250457 |
2781251f-561b-433c-b05a-d3f1379c0bde | chonyy/leetcode-solutions | 0621-task-scheduler/0621-task-scheduler.cpp | class Solution {
public:
int leastInterval(vector<char>& tasks, int n) {
unordered_map<char, int> m;
// counting frequency
for(char task : tasks) {
m[task] ++;
}
// pushing the frequency to the maxHeap
priority_queue<int> maxHeap;
for(auto it = m.... | ALGO | 0.999973 | 6.70628 |
0e070c7d-90bf-484d-b07e-c12cc8998f9b | FAST-FIRE/CoNi-MPC | no_catkin_compilation/acado-stable/acado/estimator/dynamic_estimator.cpp | /**
* \file src/estimator/dynamic_estimator.cpp
* \author Hans Joachim Ferreau, Boris Houska
* \date 13.06.2008
*/
#include <acado/estimator/dynamic_estimator.hpp>
BEGIN_NAMESPACE_ACADO
//
// PUBLIC MEMBER FUNCTIONS:
//
DynamicEstimator::DynamicEstimator( ) : Estimator( )
{
}
DynamicEstimator::Dynamic... | ALGO | 0.99205 | 5.618472 |
202d7206-1e79-4b2d-b092-1e659aaa6fe6 | IMRAN-5740/Programming-Contest | CodE_CheF/CHFDBT.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
n=n+1;
int res=n/2;
cout<<res<<endl;
}
return 0;
} | ALGO | 0.999775 | 3.867855 |
ce8a5c74-943f-42fd-9984-ba4adae76100 | lk-2009/vacanta-2021 | pg102-5/main.cpp | #include <iostream>
using namespace std;
int v[1000],n,c;
int main(){
//luka type yor code below ;)
cout<<"n= ";cin>> n;
for(int i = 0;i<n;i++){
cout<<"v["<<i+1<<"]= ";
cin>> v[i];
}
for(int i = 0;i<n;i++){
if(v[0]==v[i]) c++;
}
cout<< c;
}
| ALGO | 0.999709 | 3.354594 |
975ba66a-ee61-47b3-aeee-0a28e0c8c5a2 | Kozhevnikov-SPB/BRIKS_CPP | briks_cpp/briks_cpp.cpp | #include <iostream>
#include <math.h>
using namespace std;
void calcSquareEquat(int _a, int _b, int _c) {
double D, x1, x2, real, imagin;
D = pow(_b, 2) - 4 * _a * _c;
cout << "D= " << D << endl;
if (D > 0) {
x1 = (-_b + sqrt(D)) / (2 * _a);
x2 = (-_b - sqrt(D)) / (2 * _a);
cout << "X1= " << x1 << " X2= ... | ALGO | 0.994913 | 3.12997 |
89d19a6a-11fe-4900-a1e5-7dc02085308e | Ishwarendra/Contests | CODEFORCES_CONTEST/Previous Contests/794_Div2/B.cpp | #include <bits/stdc++.h>
#ifdef LOCAL
#include <F:\CPP\Debug\debug.h>
#else
#define trace(x...) 1;
#define print(x...) 1;
#endif
void solve()
{
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; ++i)
std::cin >> a[i];
int max = *std::max_element(a.begin(), a.end());
std::stack<int... | ALGO | 0.999869 | 5.719304 |
55a1fbd8-0f87-4de7-a813-19788f6bfa3f | Rocky4554/Strings | reversal-optimised.cpp | #include<iostream>
#include<string.h>
using namespace std;
// trick --if first element is at i=0 then last will be at [n-i-1]
// second at i=1 then second last at [n-i-1]
string reversal(string str, int n){
for(int i=0;i<n/2;i++){
int temp=str[i];
str[i]=str[n-i-1];
str[n-i-1]=temp;
... | ALGO | 0.999707 | 4.824481 |
f8c7de5a-8da1-43d5-b31a-220703bb4c5c | fmi-lab/up-group5 | exercises/exercise3/solutions/problem1.cpp | #include <iostream>
int main()
{
int n = 0;
do
{
std::cout << "n: ";
std::cin >> n;
} while (!(n > 0));
int sum = 0,
temp = n;
while(temp > 0)
{
sum += temp % 10;
temp /= 10;
}
std::cout << std::boolalpha << !(sum % 3) << std::endl;
r... | ALGO | 0.996318 | 4.878699 |
ef86762f-28f2-46af-8d97-51a36671b3ad | Unsigned-Long/slam-tricks | st11-panorama/src/src/feature.cpp | #include "feature.h"
namespace ns_st11 {
void detect(cv::Mat img, std::vector<cv::KeyPoint> &kps, cv::Mat &descriptors) {
cv::Ptr<cv::FeatureDetector> detector = cv::SIFT::create();
cv::Ptr<cv::DescriptorExtractor> descriptor = cv::SIFT::create();
// detector
detector->detect(img, kps);
// com... | ALGO | 0.853274 | 5.803495 |
5514d72f-d5b6-4a17-85c0-054a6699aed1 | networkoptix/nx_open | vms/client/nx_vms_client_core/src/nx/vms/client/core/network/remote_connection_factory.cpp | #include "remote_connection_factory.h"
#include <memory>
#include <QtCore/QPointer>
#include <network/system_helpers.h>
#include <nx/cloud/db/api/oauth_manager.h>
#include <nx/network/address_resolver.h>
#include <nx/network/http/auth_tools.h>
#include <nx/network/nx_network_ini.h>
#include <nx/network/socket_global... | TOOL | 0.919591 | 7.345167 |
cedc2f89-5c58-447a-b090-8e22f98db303 | cssl-unist/trust-sec23 | rust/src/llvm-project/libcxx/test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp | // <numeric>
// UNSUPPORTED: c++03, c++11, c++14
// template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
// OutputIterator
// inclusive_scan(InputIterator first, InputIterator last,
// OutputIterator result,
// BinaryOperation binary_op, T in... | TEST | 0.979504 | 7.079965 |
10e15886-67d4-4a78-a263-ef0e75dfa610 | zeniqcore/zeniq | src/coins.cpp | #include <coins.h>
#include <util/strencodings.h>
#include <consensus/consensus.h>
#include <memusage.h>
#include <random.h>
#include <version.h>
#include <logging.h>
#include <cassert>
bool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const {
return false;
}
BlockHash CCoinsView::GetBestBlock() co... | TOOL | 0.855962 | 7.629535 |
c5cec3b9-1457-4f10-bad4-f8998aadef0f | nikitasalnikov56/pushchino_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.998733 | 6.76775 |
f91a6c70-41d0-47db-9a2e-2287ab601b23 | alexandraback/datacollection | solutions_2463486_0/C++/mohitj/C.cpp | #include <cassert>
#include <string>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <vector>
using namespace std;
static bool p(int i) {
std::stringstream ss;
ss << i;
string s( ss.str() );
std::reverse( s.begin(), s.end() );
return s == ... | ALGO | 0.999437 | 4.400774 |
4b78be46-fd55-41d7-9a75-bf1482d76174 | tom96da/Bt-manet-sim | test/threads.cpp | /*!
* @file threads.cpp
* @author tom96da
* @brief 互いに干渉しない複数の処理を並列化
* @date 2023-04-26
*/
#include <iostream>
#include <thread>
#include <vector>
using namespace std;
void myfunc(int i, int *v)
{
v[i]++;
}
int main()
{
int v[] = {0, 1, 2, 3, 4, 5, 6, 7};
vector<thread> threads;
// コンストラクタを用い... | TOOL | 0.850251 | 4.480267 |
48051043-b43e-41b7-9917-229e5a36a71f | stoimenoff/up16-17 | homeworks_solutions/1/Task-9.cpp | /**
*
* Solution to homework task
* Introduction to programming course
* Faculty of Mathematics and Informatics of Sofia University
* Winter semester 2016/2017
*
* @author Svetomir Stoimenov
* @task 9
* @compiler GCC
*
*/
#include <iostream>
using namespace std;
int main()
{
const unsigned int BITS = 4;
u... | ALGO | 0.999566 | 4.241968 |
fb021e0f-d0b4-4b29-9dd2-85fffb38087a | joopixel1/CSES | GFG/Array Algo/searching/medium/find_pair_whose_sum_is_closest_to_K.cpp | #include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout << "Starting..." << "\n";
ll n, k;
cin >> n >> k;
vector<ll> v(n);
for(size_t i=0; i<v.size(); i++) cin >> v[i];
pair<ll, ll> closest = make_pair(v.... | ALGO | 0.999996 | 4.333393 |
86ef9208-7ebc-430f-9b92-a2c884951592 | ishandutta2007/codeforces | ivan100sic/normal/1730/C.cpp | // Retired?
#include <bits/stdc++.h>
using namespace std;
namespace R = ranges;
auto ra(auto x, auto y) { return R::iota_view(x, y); }
using ll = long long;
using ull = long unsigned long;
using ld = double long;
int main() {
ios::sync_with_stdio(!cin.tie(0));
int t;
cin >> t;
while (t--) {
... | ALGO | 0.999887 | 6.205528 |
49660c94-31f1-4cfe-9e38-44c0a03c8dbb | Kuro-orzz/Library | Graph/test/aizu_grl_1_a_dijkstra.test.cpp | #define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/1/GRL_1_A"
#include "../../template.h"
#include "../Shortest_path/Dijkstra.h"
void solve() {
int n, m, s; cin >> n >> m >> s;
vector<vector<pii>> adj(n+1);
for (int i = 0; i < m; i++) {
int u, v, w; cin >> u >> v >> w;
... | ALGO | 0.999734 | 4.702238 |
2dba638b-e41b-44da-8fad-4139f2b29ff2 | 0xm4yo/compro | atcoder/ABC/ABC329/E.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i, a, b) for(ll i=a; i<b; i++)
#define rrep(i, a, b) for(ll i=a; i>=b; i--)
#define all(a) (a).begin(), (a).end()
#define YesNo(bool) if(bool){cout<<"Yes"<<en... | ALGO | 0.999985 | 4.142982 |
97c90754-5fb9-45a6-bbef-f6e279ad7485 | MMwaveOctomap/OctomapROS | octomap-devel/octovis/src/extern/QGLViewer/VRender/ParserGL.cpp | #include <assert.h>
#include <math.h>
#include <stdio.h>
#include "VRender.h"
#include "ParserGL.h"
using namespace vrender ;
using namespace std;
class ParserUtils
{
public:
static void NormalizeBufferCoordinates(GLint size, GLfloat * buffer, GLfloat MaxSize, GLfloat& zmin, GLfloat& zmax) ;
static PtrPrimitiv... | TOOL | 0.963191 | 4.789921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.