uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
0f3c117b-ac6c-4d74-87c2-e5299f32d8d6 | Mahmood-Darwish/CodeForces-Problem-Solutions | Problems/Start Up/Start Up.cpp | #include <iostream>
using namespace std;
bool a[] = {1,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,1,1,1,1,1,1,0};
string s;
int main()
{
cin >> s;
int n = s.size();
for(int i = 0 ; i < n ; i++)
if(s[i] != s[(n-1) - i] || !a[s[i]-'A'])
{
cout << "NO";
return 0;
}
... | ALGO | 0.999913 | 4.121886 |
9f5817a3-40a6-4b82-b2e0-f247995950d1 | chilumanxi/Study | C++/string类/strfile.cpp | /*************************************************************************
> File Name: strfile.cpp
> Author: Zhanghaoran0
> Mail: <EMAIL>
> Created Time: 2015年08月15日 星期六 15时08分17秒
************************************************************************/
#include <iostream>
#include <algorithm>
#include <cstdio>
... | TOOL | 0.861259 | 3.202549 |
72b70583-ed7d-4a09-b252-74c68ce34ed7 | SohelPathan2003/C-and-C-Programs | Abstraction/loose_coupling2.cpp | #include<iostream>
#include<string.h>
/*
write a program create a class name as studentmarks and within that class create two function
name as setmarks() and getpercentage().and inherit it class into the 5 students class.
and find the all students percentage using 6th class name as perform_percentage ();
*/
using na... | ALGO | 0.96377 | 3.379784 |
08bf298b-7463-48cf-b5f7-e765d0dd386a | Itsrajeev123/algorithm | towerhanoi.cpp | #include <iostream>
using namespace std;
void towers(int, char, char, char);
int main()
{
int num;
cout<<"Enter the number of disks : ";
cin>>num;
cout<<"The sequence of moves involved in the Tower of Hanoi are :n"<<endl;
towers(num, 'A', 'C', 'B');
return 0;
}
void towers(int num, char from,... | ALGO | 0.999424 | 5.144548 |
de3d7602-24b3-4c5b-a52a-e116b258271b | andreagenso/Mora-Ormj | test/Mora/Ormj/java/openjdk-6-src-b27/hotspot/src/share/vm/opto/gcm.cpp | #include "precompiled.hpp"
#include "libadt/vectset.hpp"
#include "memory/allocation.inline.hpp"
#include "opto/block.hpp"
#include "opto/c2compiler.hpp"
#include "opto/callnode.hpp"
#include "opto/cfgnode.hpp"
#include "opto/machnode.hpp"
#include "opto/opcodes.hpp"
#include "opto/phaseX.hpp"
#include "opto/rootnode.h... | ALGO | 0.987646 | 6.383243 |
7efc0cd6-efa4-4325-aab1-5f4a4ad8cbb7 | lactobacil/8-7-6-Kyu-Codewars | 7Kyu/Strings Ends With - 7kyu.cpp | #include <string>
bool solution(std::string const &str, std::string const &ending) {
int size = ending.length();
int strSize = str.length();
for(int i = size; i >= 0; --i){
if (ending[i] != str[strSize]){
return false;
}
strSize --;
}
return true;
} | ALGO | 0.992781 | 5.355661 |
ea58baa5-cba9-48f0-b919-0622ab473fcf | hiyouga/CPP-Learning | buaaoj/178.cpp | #include <iostream>
#define NOTLE ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
short flag, mat[12][12];
//bool vis[12][12];
void bfs(int x, int y)
{
//cout << x << ends << y << endl;
if(mat[x][y] == 3)
flag = 1;
mat[x][y] = 1;
if(mat[x-1][y] != 1)
bfs(x-1, y);
if(mat[x+1][y] != ... | ALGO | 0.999967 | 3.334411 |
5bdda9e9-166d-45a2-9731-f391d69c5448 | asdf77616385/ceph-12.2.1 | src/boost/libs/geometry/test/algorithms/distance/distance_linear_linear.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
#include <iostream>
#ifndef BOOST_TEST_MODULE
#define BOOST_TEST_MODULE test_distance_linear_linear
#endif
#include <boost/test/included/unit_test.hpp>
#include "test_distanc... | TEST | 0.930592 | 7.71018 |
a54abca7-22b9-4b91-97f2-e6b5613505da | Kinoruu/Simulation_Of_Life | Simulation_Of_Life/Simulation_Of_Life.cpp | #include <iostream>
#include <cstdlib>
#include <windows.h>
#include <conio.h>
using namespace std;
class Object {
public:
int position_x;
int position_y;
int age; // current age
int hair; // 1 blonde, 2 black, 3 brown, 4 red, 5 white
int height; // (max) 150-190 cm
int eyes; // blu... | ALGO | 0.949256 | 3.265547 |
6bd49b56-9a30-451b-aa91-737750035909 | ptquanh/leetcode-cpp-practices | 997. Find the Town Judge.cpp | /**
In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge.
If the town judge exists, then:
The town judge trusts nobody.
Everybody (except for the town judge) trusts the town judge.
There is exactly one person that satisfies properties 1 and 2.
You a... | ALGO | 0.999954 | 5.789272 |
eb83742e-c064-4964-af6c-254b9cbee3f7 | FaZeRs/learn-cpp | src/patterns/structural/bridge/main.cpp | #include <cstdlib>
#include <iostream>
#include <memory>
#include <utility>
// Implementor
class Renderer {
public:
Renderer() = default;
virtual ~Renderer() = default;
Renderer(const Renderer&) = default;
Renderer& operator=(const Renderer&) = default;
Renderer(Renderer&&) = default;
Renderer& operator=(... | TOOL | 0.878703 | 7.743092 |
e8ba0fd0-11dc-495b-9e44-6b2a005f1e21 | Yuvraj02/Competetive_Programs | a_very_big_sum.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
long long sum = 0;
vector<long> arr = {1000000001,1000000002,1000000003,1000000004,1000000005};
for (auto i : arr)
{
sum += i;
}
cout<<sum;
return 0;
} | ALGO | 0.999654 | 3.28643 |
850fb385-3ca0-4f9e-a415-44c486b0ad20 | ShivaBansfore-JGEC/Codeforces_Contest_Question | A,B and C problem/C_Make_It_Equal.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
void solve(){
ll n,k;
cin>>n>>k;
ll mn=INT_MAX;
ll arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
mn=min(arr[i],mn);
}
ll sum=0;
for(int i=0;i<n;i++){
sum+=(arr[i]-mn);
}
cout<<ceil((double... | ALGO | 0.999678 | 3.766149 |
03d1f5eb-f267-47a6-b7bf-1b50bfe78098 | orihehe/BOJ | Tree/17306번_전쟁 중의 삶.cpp | /*
BOJ 17306 - 전쟁 중의 삶
https://www.acmicpc.net/problem/17306
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#define ll long long
using namespace std;
/* 🐣🐥 */
ll arr[250001];
ll wprhq[51];
vector<ll> vec[51];
ll lca(ll a, ll b) {
if (a > b) swap(a, b);
int lm = upper_bound(wprhq, wp... | ALGO | 0.999878 | 4.086369 |
c86fc936-aca5-4fdf-9375-7bab4d2464f9 | AkashKumar-A/DSA | lecture 9/even_oddLL.cpp | /****************************************************************
Following is the class structure of the Node class:
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
this->next = NULL;
}
... | ALGO | 0.999974 | 4.999557 |
685e90f9-908f-4f24-9468-fb402bb75fd6 | 0point1Zishan/CP | DSA Practice/Binary Search/Kth Missing Positive Number.cpp | int missingK(vector < int > vec, int n, int k) {
// Write your code here.
int s = 0, e = n-1;
while(s <= e){
int mid = s + (e - s) / 2;
int missing = vec[mid] - mid - 1;
if(missing < k) s = mid + 1;
else e = mid - 1;
}
return s + k;
} | ALGO | 0.999956 | 3.960706 |
e8bde498-6350-4a5f-8b8c-63c5a1537b21 | ApoorvShri/CSES-Solutions | Sorting and Searching/Sum_of_Two_Values.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, x;
cin >> n >> x;
vector<pair<int, int>> a(n);
for (int i = 0;i < n;i++) cin >> a[i].first, a[i].second = i + 1;
sort(a.begin(), a.end());
int i = 0, j = n - 1;
bool flag = 1;
while (i < j) {
int sum = a[i].first + a[j].first;
... | ALGO | 0.99996 | 4.36713 |
714d7463-e3e9-4f8c-b09e-293b9395174a | sinhasaurabh079/DSA | Recursion/Nested-recursion.cpp | #include<iostream>
using namespace std;
int fun(int n)
{
if(n>100)
return n-10;
else
return fun(fun(n+11));
}
int main()
{
int r;
r=fun(95);
cout<<r<<endl;
return 0;
} | ALGO | 0.999721 | 3.342613 |
1ff50556-316c-431d-964e-8c421ae81e93 | Seraj-Omar/Codeforces-Solution | 999A - Mishka and Contest.cpp | #include <bits/stdc++.h>
#define SerajOmar ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0);
#define ll long long int
#define ld long double
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<typename ... | ALGO | 0.999954 | 4.228544 |
37fa216e-7133-4f23-81ed-dc7b6db543b2 | Mohammad-Sami8552/Algorithms | counting_sort.cpp | #include<bits/stdc++.h>
using namespace std;
//Finding maximum elements
int findMax(int arr[], int n)
{
int max = arr[0];
for (int i = 1; i < n; i++)
{
if (max < arr[i])
{
max = arr[i];
}
}
return max;
}
//counting sort
void countingSort(int arr[], int n, int max... | ALGO | 0.999892 | 4.518258 |
c468401a-2d9a-4f0f-8074-ee2e486b3a39 | ishandutta2007/codeforces | saost/normal/451/D.cpp | #include <iostream>
#include <cstring>
using namespace std;
char s[100005];
int n;
pair<long long, long long> solve() {
long long ansOdd = 0, ansEven = 0;
long long cntOdd[2] = {0,0}, cntEven[2] = {0,0};
for(int i=0; i<n; i++) {
ansOdd++;
int id = s[i] - 'a';
if (i%2 == 0) {
... | ALGO | 0.999727 | 3.729685 |
36034a3d-f177-4b70-b489-9d23c3f1bf35 | ajinkyajain23/GFG-POTD | InorderTraversal.cpp | vector<int> inOrder(Node* root) {
// Your code here
vector<int> res;
inorderUtils(root, res);
return res;
}
void inorderUtils(Node* root, vector<int>& res){
if(root == nullptr){
return;
}
inorderUtils(root->left, res);
res... | ALGO | 0.999982 | 6.398631 |
141ceaf8-c4a2-4d80-a1d6-12a8a731bc36 | zinct/alert-us | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.9988 | 6.76073 |
7d0aca44-084b-48e8-9299-be9f6e8ad57d | AnasImloul/Leetcode-Solutions | scripts/algorithms/S/Symmetric Tree/Symmetric Tree.cpp | // Runtime: 3 ms (Top 94.24%) | Memory: 16.5 MB (Top 47.31%)
class Solution {
public:
bool mirror(TreeNode* root1, TreeNode* root2){
if(root1==NULL and root2==NULL) return true;
if(root1==NULL or root2==NULL) return false;
if(root1->val!=root2->val) return false;
return mirror(roo... | ALGO | 0.999995 | 6.923521 |
eb2626a9-b86a-4bdd-9357-b6ef3208dffc | hoshinon57/Algorithm | AtCoder/ABC301-400/ABC351-360/ABC356-D.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
typedef long long ll;
// const ll INF64 = 1LL << 60;
const ll INF64 = ((1LL<<62)-(1LL<<31)); // 10^18より大きく、かつ2倍しても負にならない数
const int INF32 = 0x3FFFFFFF; // =(2^30)-1 10^9より大きく、かつ2倍しても負にならない数
const ll MOD... | ALGO | 0.99996 | 4.554634 |
ed07ba54-a749-4cb1-b9db-7fa84952055f | IncoCura/qt5 | qtbase/src/3rdparty/sha1/sha1.cpp | #include <QtCore/qendian.h>
#ifdef Q_CC_MSVC
# include <stdlib.h>
#endif
QT_BEGIN_NAMESPACE
// Test Vectors (from FIPS PUB 180-1)
//
// SHA1("abc") =
// A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D
//
// SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") =
// 84983E44 1C3BD26E BAAE4AA1 F95... | ALGO | 0.940684 | 6.95892 |
3868eef2-0b2e-4fd0-bdb1-213f42b16ff9 | nicalvarez/algoritmos-icpc | old/4 - estructuras/fenwick.cpp | struct fenwick {
vt op;
tint siz;
// arbol para el intervalo (0,n)
fenwick(tint n) {
op = vt(n,0);
siz = 0;
}
tint leq(tint key) {
tint res = 0;
for (tint i = key; i > 0; i -= i & (-i)) res += op[i];
return res;
}
tint eq(tint key) {
return leq(key) - leq(key-1);
}
void insert(tint key, tint n... | ALGO | 0.999707 | 4.59344 |
df07d333-5d77-48c8-a503-773429d14ae4 | cicibebekola/line-follower | src/main.cpp | #include <Arduino.h>
#include <QTRSensors.h>
// PID constants
float kp = 0.09;
float ki = 0.00001;
float kd = 0.2;
int P, I = 0, D, lastError = 0; // I initialized to 0
// Motor speed limits
#define rightMaxSpeed 120
#define leftMaxSpeed 120
#define rightBaseSpeed 70
#define leftBaseSpeed 70
// DRV8871 motor driver... | ALGO | 0.943355 | 5.786707 |
7c5356fb-4aae-4ee1-a5d3-cb1bb528e9f6 | behitek/acm-epu | codeforces/339B.cpp | #include <bits/stdc++.h>
#define _for(i,a,b) for (int i=(a),_b_=(b);i<_b_;i++)
#define _fod(i,a,b) for (int i=(a),_b_=(b);i>_b_;i--)
#define _it(i,v) for (typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
#define _all(v) v.begin(), v.end()
#define __(v) memset(v,0,sizeof(v))
using namespace std;
typedef long ... | ALGO | 0.999782 | 3.385247 |
da8ce393-9e79-446a-9b0c-8dee28146752 | sKAR04/CP-Practice | Codeforces/63/63A.cpp | /*
######################################################
# I don't know what I'm doing with my life O.O #
######################################################
*/
#include <bits/stdc++.h>
using namespace std;
//Optimizations
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC... | ALGO | 0.999734 | 3.54788 |
6ed134c5-402a-445a-83ad-91437b4fd3af | Alexisflipi/Club-de-Algoritmia | Reference 2017/Grafos/Kruskal-MST.cpp | #include <bits/stdc++.h>
#define fst first
#define snd second
using namespace std;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<pair<int, ii>> viii;
//Árbol de expansión mínima
//Algortimo kruskal
//Time complexity: O(E*logV)
//Retorna las aristas que pertenecen al MST
struct K{
int n;
viii e... | ALGO | 0.999467 | 3.639203 |
f958ffe5-1455-4141-b752-b96a356a2981 | giselly-alves14/exercicos | lista 2/ex 12.cpp | #include<stdio.h>
#include<math.h>
int main () {
float E, Po, Pr,t;
printf("insira a energia consumida antes da automao");
scanf("%f", &Po);
printf("insira a energia consumida ps automao");
scanf("%f", &Pr);
printf("insira o tempo de instalao da automao");
scanf("%f", &t);
E=(Po-Pr)*t;
printf("a ene... | ALGO | 0.997579 | 3.104886 |
49d73060-2691-4f79-8106-fb1971f83cbd | carzy-zala/leet-by-me | Tree/145. Binary Tree Postorder Traversal.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.999879 | 6.047995 |
88512c12-5e96-40bf-9ecb-d2a6dd19cdaf | Ishan-Kumar9/c-basics | fibenacci.cpp | #include<iostream>
using namespace std;
int fact(int n)
{
int factorial=1;
for(int i=1;i<=n;i++)
{
factorial = factorial*i;
}
return factorial;
}
int main(){
int n;
cout<<"Enter a number: ";
cin>>n;
cout<<"Factorial of "<<n<<" is: "<<fact(n);
return 0;
} | ALGO | 0.999124 | 4.065369 |
b8df7a12-4df7-49a8-b123-b3d9f8ca58ac | mandellis/SimSpace | ext/libigl/include/igl/tet_tet_adjacency.cpp | #include "tet_tet_adjacency.h"
#include "parallel_for.h"
#include <array>
#include <vector>
template <typename DerivedT, typename DerivedTT, typename DerivedTTi>
IGL_INLINE void
igl::tet_tet_adjacency(
const Eigen::MatrixBase<DerivedT>& T,
Eigen::PlainObjectBase<DerivedT... | ALGO | 0.999042 | 6.547697 |
2d33cb65-2285-43ac-84e7-e9355fded1b5 | Tushar-mn/dsa_practice | GreatestCommonDivisorTLE.cpp | #include <iostream>
using namespace std;
int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a % b);
}
int main(){
int n, q;
cin >> n >> q;
int a[n+10];
int forward[n+10];
int backward[n+10];
forward[0] = backward[n+1] = 0;
for(int i=1; i<=n; i++){
cin >> a[i];
}
for... | ALGO | 0.999973 | 3.997464 |
b58f9fab-c987-45fe-b875-90a5a2546fd7 | WilliamDini/Project-1-Puzzle | source/problem.cpp | #include <iostream>
#include <cmath>
#include <queue>
#include <vector>
#include <unordered_set>
#include "../headers/problem.hpp"
// initialize puzzle —
Problem::Problem() { // default constructor
// start state
int counter = 0;
int tiles[9] = {1,0,3,4,2,6,7,5,8}; // to be populated in the dynamic ve... | ALGO | 0.999852 | 4.219969 |
c7c9ab5e-3b0f-4560-bdae-a164c30d5967 | suman6517/LeetCode_Solutions | 0852-peak-index-in-a-mountain-array/0852-peak-index-in-a-mountain-array.cpp | class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr)
{
int size = arr.size();
int start =0;
int end = size -1 ;
int mid = start + (end -start) /2 ;
while(start < end)
{
if(arr[mid] < arr[mid+1])
{
star... | ALGO | 0.999975 | 5.610166 |
a63d9fd8-4b15-44e6-9c91-405bcb76e192 | ArushNo1/Competitive-Programming | Contests/AdventOfCode/2024/Day8Part1.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
typedef vector... | ALGO | 0.99971 | 5.411924 |
a0248055-026f-4cb7-99a8-f25f1fcf41cc | wken5577/CPP_module | CPP08/ex01/main.cpp | #include "Span.hpp"
#include <iostream>
#include <vector>
#include <random>
int main()
{
Span sp = Span(5);
sp.addNumber(6);
sp.addNumber(3);
sp.addNumber(17);
sp.addNumber(9);
sp.addNumber(11);
std::cout << sp.shortestSpan() << std::endl;
std::cout << sp.longestSpan() << std::endl;
std::vector<int> vec;
fo... | ALGO | 0.944007 | 3.976953 |
b7c6d838-35ee-464e-8eb5-3bd088d73463 | haitaibrowser/haitaibrowser | third_party/skia/src/pathops/SkPathOpsWinding.cpp | // given a prospective edge, compute its initial winding by projecting a ray
// if the ray hits another edge
// if the edge doesn't have a winding yet, hop up to that edge and start over
// concern : check for hops forming a loop
// if the edge is unsortable, or
// the intersection is nearly at the ... | ALGO | 0.999926 | 6.826071 |
904b7688-99c8-44ae-b2d5-07d8f3532504 | Shahraaz/CP_P_S5 | ICPC_Mirrors/Nitc_8.0/NWERC-2013-Problems-Solutions-Testcases/problems/Jingle_Balls/solutions/tobi.cpp | // @EXPECTED_RESULTS@: CORRECT
#include <iostream>
#include <string>
#include <map>
using namespace std;
#define MAX 2000
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define ABS(x) ((x) > 0 ? (x) : -(x))
typedef pair<int, int> pii;
const int oo = 0x3f3f3f3f;
string s;
int numNodes, root, best, sum[MAX];
bool t... | ALGO | 0.999806 | 4.035579 |
57fff89a-bd8b-4e57-bfcb-a3c9e7214531 | Vojlok/tsmp_project | components/MagicFm/Source/ImageAnalysis/FastBlur.cpp | #include <math.h>
//---------------------------------------------------------------------------
void Blur1D (int xdim, float* im, float scale)
{
// Precondition for stability: 0 < scale < exp(0.5)
// Good choice for iterative blurring is scale = exp(0.25)
float logscale = float(log(scale));
int x;
... | ALGO | 0.998272 | 5.946962 |
819f33d6-2380-4bf9-a28e-dd758798a726 | alittlekitten/AlgorithmStack | Baekjoon/Cpp/Implementation/S5_14646_욱제는_결정장애야.cpp | #include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
// 14646 욱제는 결정장애야!!
// 구현
int n, input;
cin >> n;
n *= 2;
bool chk[100001] = { 0 };
int tmp = 0;
int ans = 0;
while (n--) {
cin >> input;
if (chk[input]) --tmp;
else {
chk[inpu... | ALGO | 0.999815 | 4.048326 |
2feff869-fe23-4dd6-940f-37facd1d2373 | liamplatt/ITCVROPP | Middleware_Layer/wallie_one/src/detection.cpp |
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <visualization_msgs/Marker.h>
#include <pcl_conversions/pcl_conversions.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/filters/passthrough.h>
#include <pcl/filters/radius_outlier_removal.h>
#include <pcl/filters/statistical_... | DATA | 0.988528 | 6.171442 |
26711037-a2da-4a4d-b07a-27780e57a6db | ishandutta2007/codeforces | riadwaw/normal/464/B.cpp | /**
* BE CAREFUL!! I have define int li
*/
//#define _GLIBCXX_DEBUG
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <cmath>
#include <ctime>
#include <stack>
#include <set>
#include <bitset>
#include <map>
#include <cassert>
... | ALGO | 0.999876 | 3.531595 |
218a4bef-9c19-45e1-b18d-a546a8ea0936 | DonteWilson/ADGP110 | Math Library/Math Library/Math.cpp | #include <iostream>
#include "Math.h"
using namespace std;
int main()
{
cout << "Vector 2:\n";
float Mag;
Operation<int>TwoDVec1(3, 3);
Operation<int>TwoDVec2(1, 1);
Operation<int>TwoDVec3;
Operation<int>TwoDVec4;
TwoDVec4 = TwoDVec3.Add(TwoDVec1, TwoDVec2);
cout << "(" << TwoDVec4.x << "," << TwoDVec4.y <<... | ALGO | 0.877044 | 4.920617 |
27857055-a719-48c1-8788-7fb54e282b90 | iamslash/learntocode | leetcode/FillingBookcaseShelves/a.cpp | #include <cstdio>
#include <vector>
// // 40ms 5.47% 123.8MB 100.00%
// // dynamic programming
// // O(N^2) O(N)
// class Solution {
// private:
// int dfs(std::vector<std::vector<int>>& B,
// int W, std::vector<std::vector<int>>& C,
// int i, int w, int h) {
// int n = B.size();
// // b... | ALGO | 0.99983 | 5.917436 |
6532b8ba-7363-4fd0-aabd-1a3369752f1c | YehudaMosheBinyamin/IntroCompScience | ex6ques5/main.cpp | #include <iostream>
using namespace std;
//328972427 Calculates set difference of two arrays of positive numbers. If the difference set is empty, an appropriate message will be printed
int main(void)
{
int firstArray[6];
int countOnlyInFirst = 6;
cout << "enter first 6 numbers:" << endl;
for (int i = 0;... | ALGO | 0.936055 | 3.706403 |
3a68284d-d9a1-4f88-864e-cf4f3029a0f7 | zwonlala/algorithm_cpp | boj1629v2.cpp | //
// Created by 송지원 on 2020/07/17.
//
//바킹독님 강의 코드
#include <iostream>
using namespace std;
using ll = long long;
ll POW(ll a, ll b, ll m) {
if (b==1) return a % m;
ll val = POW(a, b/2, m);
val = val * val % m;
if (b%2 == 0) return val;
return val * a % m;
}
int main() {
ios::sync_with_stdi... | ALGO | 0.999978 | 5.52607 |
8c77bb84-0a55-496c-a75c-2a92d18bb039 | Ivan-71-ua/Competitive-Programming | C++ Uzhu/GRAF/S.cpp | #include <bits/stdc++.h>
#define fast std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
#define int long long
int32_t main() {
int n, m;
std::cin >> n;
std::vector<std::vector<int>> matrx(n +1);
for (int i = 0; i <= n; i++)
{
std::string s;
std::getline(std::cin, s);
std::stringstream tp... | ALGO | 0.999568 | 3.754464 |
1f92675d-5fc4-493c-b101-5b51ea1c8e7f | mertpasacukur/riscv_llvm | llvm/lib/Analysis/LazyCallGraph.cpp | #include "llvm/Analysis/LazyCallGraph.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/Constants.h"
#in... | TOOL | 0.922076 | 7.921475 |
9209a84c-5e7c-469a-ba27-336de1a9c23d | MostafaOsmanFathi/Problem-Solving-Training | codeforces/Phase 2.2/String/798B.cpp | #include <bits/stdc++.h>
#define MOSTAFAOSMAN() ios_base::sync_with_stdio(false);cout.tie(NULL),cin.tie(NULL);
#define ll long long
#define ld long double
#define outCondtion(a) cout<<((a)?"YES":"NO")<<"\n";
#define tloop int t;cin>>t;cin.ignore();while(t--)
#define endl "\n"
#define lcm(x,y) ((x/__gcd(x,y))*y)
#define... | ALGO | 0.999893 | 4.284314 |
55a64bf6-caee-4de9-8eb3-b16c988a1110 | STRUKTUR-DATA-SE-07-02/Modul-3 | 2311104076_Alya Rabani/UNGUIDED/1.CPP | #include<iostream>
using namespace std;
struct Mahasiswa {
string nama;
string nim;
float uts, uas, tugas, nilaiAkhir;
};
float hitungNilaiAkhir(float uts, float uas, float tugas) {
return 0.3 * uts + 0.4 * uas + 0.3 * tugas;
}
void inputMahasiswa(Mahasiswa mhs[], int n) {
for (int i = 0; i < n; ... | TOOL | 0.927032 | 5.312809 |
14583af8-993b-4bf7-9b70-af4bdfd8d81e | TTYN2411/Leetcode | 2155-find-missing-observations/2155-find-missing-observations.cpp | class Solution {
public:
vector<int> missingRolls(vector<int>& rolls, int mean, int n) {
int sum = 0;
for (int i = 0; i < rolls.size(); i++){
sum = sum + rolls[i];
}
int remainingSum = mean * (n + rolls.size())- sum;
if (remainingSum > 6 * n or remainingSum < n)... | ALGO | 0.999435 | 5.80148 |
ec9a20cc-baf5-4f79-9e5d-f07e795ac506 | ffallrain/lammps_waterbox | src/pair_lj96_cut.cpp | /* ----------------------------------------------------------------------
Contributing author: Chuanfu Luo (<EMAIL>)
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pair_lj96_cut.h"
#include "atom.h"
... | ALGO | 0.9998 | 5.907 |
a2f4917e-7efb-4af3-992f-081e01497957 | pablo-Acha/Progra-Competitiva | cses/RemovingDigits.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll> dp(1000006,9000100);
int main(){
ll n;cin>>n;
dp[0] = 0;
for (int i = 1; i <= n; i++)
{
string s = to_string(i);
for (auto &a:s)
{
dp[i] = min(dp[i],dp[i-(a-'0')]+1);
}
... | ALGO | 0.999828 | 3.987533 |
7974c424-46c5-47f6-aaee-b99a86ef9425 | starac9/CPP_STL | stl-algos.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
vector<int>v;
v.push_back(1);
v.push_back(3);
v.push_back(6);
v.push_back(7);
cout <<"Finding 6->"<< binary_search(v.begin(),v.end(),6)<< endl;
cout <<"lower bound->"<< lower_bound(v.begin(),v.end(),6)-v.begin()<< endl;
... | TOOL | 0.989572 | 3.215074 |
4f424712-547c-42f6-b8ac-fe7bbb5df619 | tianww10086/Data-Structures---C-language | 循环队列的实现/main.cpp | #include<stdio.h>
#include"head.h"
/*ѭеʾ*/
int main() {
SqQueue QE1; /*һѭнṹ*/
int e = 0; //
while (1) {
int x;
showmenu();//˵
scanf_s("%d", &x);
if (x == 0) {
break;
}
switch (x)
{
case 1: //ʼ
if (InitQueue(&QE1)) {
printf("ʼ\n");
}
break;
case 2: //ִжеĽӲ
printf("һֵֵ\n");
... | ALGO | 0.986071 | 3.37304 |
b15e631c-1f79-429e-b742-75c520aa5adf | nagaakira/221112011_DFTT | 221112011_闫皓_作业2/02_bonus_2.cpp | /*
程序设计_2023_第二次作业
title:02_bonus_2.cpp
石头剪刀布游戏
用 while, do while, switch, if 等结构编写石头剪刀布游戏
将玩家和电脑的“石头”“剪刀”“布”用数字 0、1、2 取代,计算玩 家输入值与电脑随机值的差,作为判定依据。电脑随机值可用 rand() % 3 生成
*/
#include <iostream>
#include <cstdlib>
#include <ctime>
int main() {
srand(time(0));
int player, computer;
int playerScore = 0, com... | ALGO | 0.98011 | 4.431469 |
a4f406a9-3c1f-4252-be8b-b9ac0460c902 | Justpenz233/ConformableMechanism | ConformableMechanism/3rd/hpp-fcl/src/hfield.cpp | /** \author Justin Carpentier */
#include <hpp/fcl/hfield.h>
#include <iostream>
#include <string.h>
#include <hpp/fcl/BV/BV.h>
#include <hpp/fcl/shape/convex.h>
#include <hpp/fcl/internal/BV_splitter.h>
#include <hpp/fcl/internal/BV_fitter.h>
namespace hpp {
namespace fcl {
template <>
NODE_TYPE HeightField<AABB... | TOOL | 0.87009 | 6.38219 |
336669a7-1a67-4df3-9483-752a6e02c1b2 | chaubey-aditya/DSA-CPP | CPP/Functions/functionUsingLoop.cpp | #include<iostream>
using namespace std;
int main(){
int a,n;
cin>>n;
for(int k=0; k<n; k++){
cin>>a;
for(int i=0; i<a; i++){
for(int j=0; j<i+1; j++){
cout<<'*';
}
cout<<endl;
}
}
} | ALGO | 0.999932 | 3.247939 |
86dca447-eec0-4125-8da9-2e4f516083cd | IHRSI/LeetCode | 2294_Partition_Array_Such_That_Maximum_Difference_Is_K.cpp | class Solution {//TC=O(nlogn) , SC=O(logn) - worst case - goes into sorting
public:
int partitionArray(vector<int>& nums, int k) {
sort(nums.begin(),nums.end());//greedy as sorting reduces the no. of comp
//and Since changing the order of elements does not affect the grouping(forming subsequence), w... | ALGO | 0.999945 | 6.09735 |
43369422-cef1-4f43-9d35-404c4e93be40 | ZhongYingjia/Cpp-Primer | ch15/TextQuery/AndQuery.cpp | #include "AndQuery.h"
#include <algorithm>
QueryResult
AndQuery::eval(const TextQuery &text) const
{
auto left = lhs.eval(text), right = rhs.eval(text);
auto ret_line = std::make_shared<std::set<line_no>>();
std::set_intersection(left.begin(), left.end(),
right.begin(), right.end()... | ALGO | 0.934672 | 5.756691 |
6a542c99-df7b-4486-b755-c316c4ccd5a3 | rath3t/iga23-examples | cpp/src/iks004_kirchhoffPlate.cpp | #include <config.h>
#include <matplot/matplot.h>
#include <numbers>
#include <dune/functions/functionspacebases/boundarydofs.hh>
#include <dune/functions/functionspacebases/subspacebasis.hh>
#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
#include <dune/geometry/quadraturerules.hh>
#include <dune/... | ALGO | 0.996256 | 5.660172 |
b1f55919-f377-414f-8a70-2ef8e774727d | yangmanhanoi/DSA | DSA01007 XAU AB CO DO DAI N.cpp | #include<bits/stdc++.h>
using namespace std;
#define test() int t; cin >> t; while(t--)
#define faster() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int n, ok = 1;
string s = "";
vector<string> vs;
void ktao()
{
for(int i = 0; i < n; i++) s += 'A';
}
void sinh()
{
... | ALGO | 0.999915 | 4.102518 |
100e2e50-29ce-4d25-a65f-ad255e5a58aa | dracohan/code | code_book/labuladong/dp/518.零钱兑换-ii.squeeze.cpp | /*
* @lc app=leetcode.cn id=518 lang=cpp
*
* [518] 零钱兑换 II
*
* https://leetcode.cn/problems/coin-change-ii/description/
*
* algorithms
* Medium (70.33%)
* Likes: 1118
* Dislikes: 0
* Total Accepted: 251.2K
* Total Submissions: 355.7K
* Testcase Example: '5\n[1,2,5]'
*
* 给你一个整数数组 coins 表示不同面额的硬币,另给... | ALGO | 0.99999 | 6.121626 |
d816eae8-2a63-4fb4-9742-de478c90d5b2 | mayank74pathak/memory-management | Memory-Management-main/Best Fit Memory Allocator/Implementation with C++/main.cpp | /** This program demonstrates a Memory Allocator using the Best Fit allocation strategy.
* It allows the user to input the sizes of processes and memory blocks and performs allocation
* based on the Best Fit algorithm. The allocation results, including the assigned block numbers and
* the fragmentation details, are ... | ALGO | 0.983192 | 4.358054 |
0dd80115-7ce7-42c3-a4d3-14b44cab6a2c | dhagwu/hello_algo_learn | hello_algo/codes/cpp/chapter_computational_complexity/space_complexity.cpp | /**
* File: space_complexity.cpp
* Created Time: 2022-11-25
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 函数 */
int func() {
// 执行某些操作
return 0;
}
/* 常数阶 */
void constant(int n) {
// 常量、变量、对象占用 O(1) 空间
const int a = 0;
int b = 0;
vector<int> nums(10000);
ListNode no... | ALGO | 0.953263 | 5.496661 |
d1f89570-8322-47ab-9945-8dda9fab1582 | Shridhar299/DSA-code | Array/MoveZero_End.cpp | #include <bits/stdc++.h>
using namespace std;
void solve(vector<int> &V, int n) {
vector<int> temp;
for (int i = 0; i < n; i++) {
if (V[i] != 0) {
temp.push_back(V[i]);
}
}
// Add the zeros at the end
while (temp.size() < n) {
temp.push_back(0);
}
... | ALGO | 0.999783 | 6.290504 |
9c1f1c22-e6a2-4ab2-a921-1381169b8dc7 | yahyasemih/Competitive-Programming | codeforces/166A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
auto mycmp = [](const pii &a, const pii &b) -> bool {if (a.first > b.first) return true; if (a.first == b.first) return (a.second < b.second); return (a.first >= b.first);};
struct Compare {
bool operator()(const pii &a, const pii &b)
... | ALGO | 0.999937 | 4.328045 |
2191adf0-209f-4b25-b50c-ece1bd6db1a5 | marques96/Lista-de-Exercicios-USP | questao_03.cpp | #include <iostream>
using namespace std;
int main(int argc, const char** argv) {
int n;
int i = 0;
int impar = 1;
cout << "Digite o valor de N: ";
cin >> n;
while (i < n)
{
cout << impar << endl;
impar = impar + 2;
i++;
}
return 0;
} | ALGO | 0.996555 | 4.033316 |
b775bb07-e79a-464c-a979-53021c452428 | revolucas/CoC-Xray | src/xrEngine/xr_collide_form.cpp | #include "stdafx.h"
#include "igame_level.h"
#include "xr_collide_form.h"
#include "xr_object.h"
#include "../xrcdb/xr_area.h"
#include "x_ray.h"
#include "xrLevel.h"
#include "fmesh.h"
#include "../xrCDB/frustum.h"
//#include "skeletoncustom.h"
#include "../Include/xrRender/Kinematics.h"
#include "bone.h"
#ifdef DEBU... | TOOL | 0.878457 | 3.086686 |
a2eb6e0e-cfcc-481b-a23e-062ac712c138 | rasel3780/URI-SOLUTION | 1005.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b,media;
cin>>a>>b;
media = ((a*3.5)+(b*7.5))/11;
cout<<"MEDIA = "<<fixed<<setprecision(5)<<media<<"\n";
return 0;
}
| ALGO | 0.999714 | 4.166809 |
3d80ad2d-d48a-4b0f-b765-52103d4f9021 | zjwy99/School | ECE 2500 Computer Org. & Architecture/Project3/cache.cpp | //ECE 2500, Project 3, Zachary Yee
//ID #: 905796206
//File Name: cache.cpp
//Description: Implementation file for cache class.
// IMPORTANT: For a reason I cannot determine the total number of times
// transferred from cache to memory is incorrect
#include "cache.h"
//Default Constructor, initializes data
... | ALGO | 0.960676 | 5.147945 |
82baaada-3c6f-4645-861c-56a2d3c162f2 | michaelreeves08/elmo-core | opencv/sources/modules/stitching/src/blenders.cpp | #include "precomp.hpp"
using namespace std;
namespace cv {
namespace detail {
static const float WEIGHT_EPS = 1e-5f;
Ptr<Blender> Blender::createDefault(int type, bool try_gpu)
{
if (type == NO)
return new Blender();
if (type == FEATHER)
return new FeatherBlender();
if (type == MULTI_BAN... | TOOL | 0.914349 | 6.157082 |
47040609-53b1-4560-9206-988ffd1f8514 | Anshuu-Sharma/LeetCode-my-solutions | 0721-accounts-merge/0721-accounts-merge.cpp | // definining disjoing set and its functions
class DisjointSet {
public:
vector<int> parent, size;
DisjointSet(int n) {
parent.resize(n);
size.resize(n,1);
for(int i = 0; i<n; ++i) {
parent[i] = i;
}
}
int findUPar(int x) {
if(parent[x] == x) return... | ALGO | 0.999976 | 6.349166 |
eac0177b-d78f-4dbf-9dcb-450f745711b8 | tharungade/leetcode | Level order traversal in spiral form - GFG/level-order-traversal-in-spiral-form.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
r... | ALGO | 0.999947 | 6.677958 |
4b190096-74ad-41c4-ac4c-24a38512cbb5 | Suraj-Dhankad2025/DSA-Problems-Leetcode | 638-shopping-offers/shopping-offers.cpp | class Solution {
public:
map<int,map<vector<int>,int>> dp;
int solve(vector<int>& price, vector<vector<int>>& special, vector<int> &needs, int i, vector<int>ds){
if(i==special.size()){
int res = 0;
for(int k=0;k<needs.size();k++){
res += (needs[k] - ds[k]) * price... | ALGO | 0.9998 | 5.498424 |
9d06ba41-49a7-4b0e-b58a-7ae35c61ff10 | Umarkeerio/DS-lab-2- | ex4.cpp | // Write a C++ program to insert new ITEM at given location LOC. Print all elements of
// the array
#include <iostream>
using namespace std;
void add(int nums[], int &size, int loc, int item) {
for (int i = size; i > loc; i--) {
nums[i] = nums[i - 1];
}
nums[loc] = item;
size++;
}
int main() {... | ALGO | 0.99961 | 5.045374 |
47c4da57-1c19-40ab-af20-a9ff55afcda3 | yangxu1003/leetcode | 25. A group of K flipped linked lists/test.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* reverseKGro... | ALGO | 0.999994 | 5.718659 |
d20dae3a-82f0-4f73-ab43-7e4fd66a3bb6 | ydb-platform/nbs | contrib/libs/clang14/lib/Basic/FileManager.cpp | #include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemStatCache.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path... | TOOL | 0.880796 | 7.069615 |
27b89693-76d0-4edd-bad8-6ff03c2c7757 | hieupm123/swap | code/C++/CSES2/1147 - Maximum Building I.cpp | /*
Problem Name: Maximum Building I
Problem Link: https://cses.fi/problemset/task/1147
Author: Sachin Srivastava (mrsac7)
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
int a[1005];
signed main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#ifdef LOCAL
... | ALGO | 0.999364 | 3.96961 |
82f90540-013e-4e49-b287-9e0ed3135ab9 | thegamer1907/Code_Analysis | Implementation/493.cpp | #include <iostream>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
int a[n];
for(int i=0 ; i<n ; i++)
cin>>a[i];
int m=k-1 , cnt = 0;
for(int i=0 ; i<=m ; i++){
if(a[i] > 0){
cnt++;
}
}
for(int i=k ; a[i] == a[i-1]; i++)
if... | ALGO | 0.999986 | 3.638066 |
edc4ef6f-ef9e-4bc8-b547-9cdc7b56c644 | ViniciusGoncalvesLima/Tarefas_LPR | Aula 8/Atividade 2.cpp | #include <iostream>
using namespace std
int main()
{
int numeros[10]
int valor
int total = 0
cout<<"Digite 10 números inteiros"<<endl
for (int i=0; i<10; i++) {
cin>>numeros[i]
}
cout<<"Qual valor você gostaria de pesquisar?"<<endl
cin>>valor
for(int i=0;... | ALGO | 0.996558 | 4.528626 |
f76b69ee-859d-4585-b29b-87e267042dd0 | cgaxtr/Acepta-el-reto | 533.cpp | #include <iostream>
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin >> n;
for(auto i = 0; i < n; i++){
int k;
std::cin >> k;
auto found = false;
int j = 0;
double total = 0.0;
int aux;
std::cin >> aux;
... | ALGO | 0.999698 | 3.86766 |
80d30728-d0be-4965-be73-4cff476104e1 | ngocquys/DSA-PTIT | DSA10003.cpp | #include<bits/stdc++.h>
using namespace std;
#define foru(i,a,b) for(int i=a;i<=b;++i)
#define ford(i,b,a) for(int i=b;i>=a;--i)
#define ii pair<int,int>
#define ll long long
#define fi first
#define se second
#define fill(a,b) memset(a,b,sizeof(a))
const int N=1005;
const int M=1e6+5;
int t,n,m,par[N],sz[N],ans;
ii ... | ALGO | 0.999912 | 4.313772 |
78e8f0c5-d8d3-4172-9622-086331430070 | mangosR2f/scriptdev2 | scripts/eastern_kingdoms/zulaman/boss_janalai.cpp | /* ScriptData
SDName: Boss_Janalai
SD%Complete: 90
SDComment: The hatchers may need some additional behavior adjustments.
SDCategory: Zul'Aman
EndScriptData */
#include "precompiled.h"
#include "zulaman.h"
enum
{
SAY_AGGRO = -1568000,
SAY_FIRE_BOMBS = -1568001,
SAY_S... | ALGO | 0.980612 | 4.885298 |
6e81cecc-d439-4d94-87b7-6d29a15ce19e | sujalpahwa30/ProgrammingWithDSAUsingCPP | IfElse/Divisibleby5or3butnot15.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cout << "Enter an integer : ";
cin >> n;
// if((n%5 == 0 || n%3 == 0) && n%15 != 0){
// cout << "The number is divisible by 5 or 3 but not 15 .";
// }
// else {
// cout << "Not matching the condition .";
// }
... | ALGO | 0.996413 | 3.769836 |
3d2edc74-f95c-4d57-936f-9c043637bcbd | sudhanshuraj4259/DSA | PrimrNO.cpp | #include<iostream>
using namespace std;
// 0 -> not a prime
// 1 -> prime no
bool isprime ( int n ) {
for (int i =2; i< n; i++) {
if (n%i == 0) {
// divide hogya h , not a prime
return 0;
}
}
return 1;
}
int main () {
int n ;
cin >> n;
if (isprime(n)){
... | ALGO | 0.999672 | 3.674893 |
16cc7577-96b0-4cf6-ad88-a7562df2fd30 | ps-dhruba/XPSC-Problems | Week 8/Day 1/Boxes.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
int tc; cin>>tc;
while(tc--)
{
ll n; cin>>n;
vector<ll> a(n);
for(ll i=0; i<n; i++) cin>>a[i];
sort(a.begin(),a.end());
vector<ll> v;
map<ll,ll> mp;
for(ll i=0; i<n; i++)
... | ALGO | 0.999887 | 4.472972 |
9928e6ef-17f4-464e-9038-413a94644a92 | piyushkumarg/DSA-Practice | 07 2D Array/04spiralPrint.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Given an m x n matrix, return all elements of the matrix in spiral order.
Example 1:
Input: matrix = [[1,2,3],
[4,5,6],
[7,8,9]]
Output: [1,2,3,6,9,8,7,4,5]
*/
// function to print like spiral:
vector<int> spiralOrder(vector<vector<int>>... | ALGO | 0.999951 | 4.796726 |
f2c8354c-9af5-46cf-8536-7b26e69371bd | Aquib-Nawaz/CP4-Book | UVa/12893.cpp | #include <iostream>
using namespace std;
int main(){
int T;
scanf("%d", &T);
long long n;
while(T--){
scanf("%lld", &n);
printf("%d\n", __builtin_popcountll(n));
}
} | ALGO | 0.999036 | 4.774561 |
cee44c25-7c25-4f3d-af52-f41583047959 | MahtabTanim/Codeforces | 989 B. A Tide of Riverscape.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define PI 3.14159265359
#define pb push_back
#define mp make_pair
#define MP ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
#define IG cin.ignore(numeric_limits < streamsize > ::max(), '\n');
#define ll long long int
#define N 1378
#defin... | ALGO | 0.99998 | 3.094649 |
519e2f0b-ca78-4d9b-a3e1-07428b0cc436 | sheeluofficial/practice | OthersCode/LeetCode-Solutions-master/LeetCode-Solutions-master/C++/number-of-students-doing-homework-at-a-given-time.cpp | // Time: O(n)
// Space: O(1)
class Solution {
public:
int busyStudent(vector<int>& startTime, vector<int>& endTime, int queryTime) {
int result = 0;
for (int i = 0; i < startTime.size(); ++i) {
if (startTime[i] <= queryTime && queryTime <= endTime[i]) {
++result;
... | ALGO | 0.999985 | 6.139872 |
52a01ac9-9269-4be1-8879-2af2e82a8a97 | RakeshSuvvari/DAA_Lab-Codes | day7/bfs1.cpp | // Program to perform BFS of a graph from a randon vertex
#include "graph.h"
void Graph::BFS1(Graph G)
{
queue <int> myQueue;
bool * visited = new bool[V];
for(int i=0;i<V;i++)
visited[i] = false;
if (visited[0] == false)
{
myQueue.push(0);
visited[0] = true;
while (!myQueue.empty())
{
lis... | ALGO | 0.999917 | 4.29585 |
c0459e12-dc3e-4c42-8c59-62794f78eba7 | rwightman/boost | libs/math/example/inverse_chi_squared_find_df_example.cpp | // inverse_chi_squared_distribution_find_df_example.cpp
//#define BOOST_MATH_INSTRUMENT
// Example 1 of using inverse chi squared distribution
#include <boost/math/distributions/inverse_chi_squared.hpp>
using boost::math::inverse_chi_squared_distribution; // inverse_chi_squared_distribution.
using boost::math::inver... | ALGO | 0.991427 | 3.771122 |
1b4305fa-e221-4c61-859c-c2bf4d9573ae | PatriceJiang/spidermonkey-69-ios-compile | gfx/angle/checkout/src/libANGLE/renderer/d3d/DynamicImage2DHLSL.cpp | #include "libANGLE/renderer/d3d/DynamicImage2DHLSL.h"
#include "common/string_utils.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/ShaderD3D.h"
using namespace gl;
namespace rx
{
namespace
{
enum Image2DHLSLGroup
{
IMAGE2D_R_FLOAT4,
IMAGE2D_MIN = IMAGE2D_R_FLOAT4,
IMAG... | TOOL | 0.947032 | 5.330254 |
940f59d9-f97a-446a-82ba-e908977135a8 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_53_5.cpp | #include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int IT_MAX = 1 << 17;
const long long MOD = 1000000007;
const int INF = 1034567890;
const long long LL_INF = 1234567890123456789ll;
const double PI = acos(-1);
const long double ERR = 1E-10;
int r[1050][2];
int root(int x) {
if (r[x][0] == ... | ALGO | 0.999989 | 3.852705 |
713c548c-42ef-41f9-bf53-760d86bf2d29 | lulvz/DA | src/graph.cpp | //
// Created by lulaz on 3/13/23.
//
#include "graph.h"
/** Construtor da classe Graph.
* Este método tem complexidade de tempo O(1).
* @param dir true se o grafo for direcionado, false caso contrário.
*/
Graph::Graph(bool dir) : num_vertices(0), num_edges(0), directed(dir) {
vertices = std::vector<vertexNode>... | ALGO | 0.998499 | 5.727989 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.