uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b7643f9f-7ff0-4a35-9c6f-9fe93fefac71 | Chutian-Wu/Open-3D-HIT | src/Pgrm_FFT.cpp | #include "Pgrm_setup.hpp"
#include "algorithm"
#include "cstring"
using namespace set;
void Fourier2Physical_dealiased(const Complex (&var_)[NXHPX][NY][NZPZ],
double (&var_p)[NX2][NY2PZ][NZ2PX])
{
// transfrom the variable from Fourier space to physical space using 3/2 rule
// T... | ALGO | 0.991741 | 3.748259 |
fc39ee6c-d888-4815-ad7d-a55a2f73b4d1 | zmd9220/algorithm_bagic | algorithm_bagic_2020/algorithm_bagic_2020/10757 큰수 A+B.cpp | #include <iostream>
using namespace std;
int main()
{
unsigned long long a, b;
cin >> a >> b;
cout << a + b << '\n';
} | ALGO | 0.999162 | 3.725689 |
03da045f-31ce-4bb1-9277-f01217a4fc51 | popany/lc | cpp/src/lintcode/q463/t463.cpp | #include "gtest/gtest.h"
#include <vector>
#include <string>
#include "q463.h"
class Test463 : public ::testing::Test
{
protected:
Test463()
{}
virtual ~Test463()
{}
virtual void SetUp()
{}
virtual void TearDown()
{}
};
TEST_F(Test463, t1)
{
Solution solution;
std::vector<i... | TEST | 0.999325 | 5.801855 |
e47a7737-b5ce-46f0-9020-62f02f1e435e | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/04/0412/personal_submission/cf540e_yakultgo.cpp | #include <bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
class FenwickTree {
private:
vector<long long> tr;
public:
FenwickTree(int n) : tr(n + 10, 0) {}
static inline int lowbit(int x) {
return x & (-x);
}
void add(int x, int delta) {
while (x < tr.size... | ALGO | 0.999961 | 4.095973 |
63e8c36f-0276-4ac7-89b8-a3f9c616653e | ishandutta2007/codeforces | geothermal/normal/1454/E.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<l... | ALGO | 0.999899 | 4.907797 |
31010767-29ea-4375-9fd4-e777bce0466b | generalized-intelligence/GAAS | deprecated/software/SLAM/ygz_slam_ros/cv/src/TrackerLK.cpp | #include "ygz/TrackerLK.h"
#include "ygz/ORBExtractor.h"
#include "ygz/ORBMatcher.h"
#include "ygz/LKFlow.h"
#include "ygz/Feature.h"
#include "ygz/BackendInterface.h"
#include "ygz/MapPoint.h"
#include "ygz/Viewer.h"
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iomanip>
nam... | TOOL | 0.931555 | 5.535632 |
6fe5a236-5434-4d22-a452-2cd200dbe0d2 | pratikp2/Turing_Tasks | Task-512937/Turn4-ModelB.cpp | #include <iostream>
#include <vector>
#include <functional>
#include <chrono>
#include <array>
#include <random>
template<typename T>
class Matrix {
public:
// (Remains the same)
};
template<typename T, typename Func>
void transformMatrixTemplate(Matrix<T>& matrix, Func func) {
matrix.apply([&](size_t row, si... | TOOL | 0.99129 | 7.185762 |
2bfb18dd-b73c-4ac0-bd32-45a090fe5478 | leggedrobotics/perfectlyconstrained | libpointmatcher/pointmatcher/DataPointsFilters/DistanceLimit.cpp | // kate: replace-tabs off; indent-width 4; indent-mode normal
// vim: ts=4:sw=4:noexpandtab
#include "DistanceLimit.h"
#include "pointmatcher/Functions.h"
// DistanceLimitDataPointsFilter
// Constructor
template<typename T>
DistanceLimitDataPointsFilter<T>::DistanceLimitDataPointsFilter(const Parameters& params) :
... | ALGO | 0.936297 | 7.464965 |
5bb05cba-632c-4d0c-812e-cfb091df5bb4 | masonarchhsieh/Training_LeetC | 0134-gas-station/0134-gas-station.cpp | class Solution {
public:
int canCompleteCircuit(vector<int>& gas, vector<int>& cost) {
int n = size(gas);
int sum = 0;
for (auto i = 0; i < n; i++) {
gas[i] = gas[i] - cost[i];
sum += gas[i];
}
if (sum < 0)
return -1;
auto l = 0, r... | ALGO | 0.999996 | 6.010635 |
95b738b5-58ba-4957-8bf9-0c3ec6082af2 | strayge/eigen | bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.999047 | 6.234309 |
91c172d1-fda8-4321-b0b5-8980d15f8e38 | ttlast/ACM | 网络流/1565.cpp | #include <iostream>
using namespace std;
const int maxn = 500;
const int maxe = 20000;
struct Node
{
int v,d,next;
};
Node mat[maxn];
int dir[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
int n,eda[maxn],em,val[maxn][maxn],scur,sink;
int h[maxn],gap[maxn],al;
void add(int u,int v,int d)
{
mat[em].v = v; mat[em].d = d;
... | ALGO | 0.999973 | 3.262054 |
c494de7a-8e6d-4e9f-b94e-fac0cfadff0c | saurabhh-svg/Contests | CodeForces/D_1_Balance_Easy_version.cpp | #include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define fl(i, n) for (int i = 0; i < n; i++)
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;
void solve()
{
int q;
cin >> q;
map<int, int> m;
set<int> s;
w... | ALGO | 0.998452 | 4.353455 |
07abd364-2706-4619-8ff9-02593b16c144 | seelx3/string-algorithms | 01_suffix_array/doubling/my_sa_doubling_dev.cpp | #include <bits/stdc++.h>
using namespace std;
#define SZ(v) (int)v.size()
// suffix_array (doubling)
// O(N * log^2(N))
// デバッグ出力用
// ダブリングの過程を見るには -D LOCAL オプションを付けて実行
// 標準エラー出力に過程が出力される
vector<int> suffix_array(const string &s) {
int n = SZ(s);
vector<int> sa(n + 1);
vector<int> rank(n + 1);
vector<int> ... | ALGO | 0.999936 | 4.905136 |
af3049df-0af9-4050-8d3e-d36f00097672 | song89/Unreal-4.25 | Engine/Source/ThirdParty/IntelEmbree/Embree270/src/kernels/xeon/bvh8/bvh8_intersector8_chunk.cpp | #include "bvh8_intersector8_chunk.h"
#include "../geometry/triangle4.h"
#include "../geometry/triangle8.h"
#include "../geometry/intersector_iterators.h"
#include "../geometry/triangle_intersector_moeller.h"
#define DBG(x)
namespace embree
{
namespace isa
{
template<typename PrimitiveIntersector8> ... | ALGO | 0.99726 | 5.753051 |
d5e8669e-3bcd-45a2-9601-9a9b74c289e1 | SexyParabola/C-Projects | Tic-Tac-Toe-OOP/FractalBomb/FractalBomb/main.cpp | #include <iostream>
#include <SFML/Graphics.hpp>
#include <vector>
#include <pthread.h>
#include "Buffer.hpp"
const int WIDTH = 500*2;
const int HIGHT = 300*2;
void doFract(Buffer &buffer) {
const double init_cRe = -0.7, init_cIm = 0.27; //initial julia constants
double cRe, cIm; //real and imaginary part of... | TOOL | 0.943998 | 4.59508 |
eb15597b-2b54-476b-b30d-82127d70dc66 | LuckyMan26/labs | lab3/laba3.cpp | #include <iostream>
#include <time.h>
#include <algorithm>
#include <cstdlib>
#define length 10 //length of array
int show_regime;
using namespace std;
struct point{
double x,y,z;
void print(){
cout<<"("<<x<<","<<y<<","<<z<<") ";
}
void create_rand(){
x=(double)(rand())/RAND_MAX * length;
y=(double)(rand())/RAND_MAX *... | ALGO | 0.999536 | 4.629094 |
f89a5856-49d1-415d-946c-de78bbbaf41f | devdrx/cp-submissions | G_Hits_Different.cpp | #include "bits/stdc++.h"
#define int long long
#define uint unsigned long long
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define fr(i,n) for(int i=0; i<(n); i++)
#define rep(i,a,n) for(int i=(a); i<=(n); i++)
#define nl cout<<"\n"
#define dbg(var) cout<<#var<<"="<<va... | ALGO | 0.999883 | 4.6933 |
04f18447-5db8-4d78-beda-cdb83496d41e | kua-as-exe/coding-notebook | cpp/problems/omegaup/EDOMEX-C-Taxis/main.cpp | #include <functional>
#include <queue>
#include <vector>
#include <stack>
#include <iostream>
#include <stdio.h>
bool _debug = false;
#define DEBUG if( _debug )
using namespace std;
long long int taxisCount, a, b;
long long int passengers = 1, passList[100015];
struct taxi{
long long int n, a, b;
};
auto cmp = [... | ALGO | 0.999645 | 3.825287 |
cf1807a0-abd0-44a4-9d52-1766078c3e6d | Luni-4/GPU-Computing | sequential/educnn/eigen/failtest/jacobisvd_int.cpp | #include "../Eigen/SVD"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
JacobiSVD<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| ALGO | 0.955198 | 3.327923 |
8e940e13-49b7-46d1-84c4-0ce29bc898e6 | Invidam/Problem-Solving | src/contest-practice/test-2019/F.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int isCriticalNum(int left, int right, int critical, const vector<int> &arr, int repeatIdx) {
int repeatCnt = 0;
for (int i = left; i < right+1; ++i) {
if (arr[i] == arr[repeatIdx]) ++repeatCnt;
if (repeatCnt >= cr... | ALGO | 0.999991 | 4.511609 |
ce6cfcfe-3f85-47a0-99a0-6989aed46d2a | kjpearce/WTM-Contagion | compute_WTM_map_v3.cpp | //Dane R Taylor May 13, 2015
//
// This code computes the full WTM map for a given network and threshold T
//
// input: -i linklist.tsv = contains the edge list with node indices 0,1,2,3,...
// -t T = this is the threshold value
//
// output -o activation_times.tsv = the matrix of activation times, where row j c... | ALGO | 0.998109 | 5.326705 |
57b62445-8edc-4ee5-95fd-cac6f25b1067 | JiHyeok-Kim/SAF-AL | 220817 - Greedy, Prefix Sum/Prefix Sum - p3 - 연습[한라봉 수확].cpp | #include <iostream>
using namespace std;
int n;
int line[110000];
int acc[110000];
int getSum(int a, int b) {
if (a > b) return 0;
if (a == 0) return acc[b];
return acc[b] - acc[a - 1];
}
int main() {
//freopen_s(new FILE*, "input.txt", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n;
... | ALGO | 0.99998 | 3.48688 |
0e67d689-65ba-4f0f-af10-8e6cf69f089d | romanlitvinenko/Lab1_4var | Lab1/Lab1.cpp | // Lab1.cpp : Этот файл содержит функцию "main". Здесь начинается и заканчивается выполнение программы.
//
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <iostream>
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
double V, H, t, T, x, y, value_sin;
int alpha;
double g = ... | ALGO | 0.999337 | 3.371191 |
58c057f0-fca9-47cc-a6b7-232d24d65d71 | s106030605/NERDSS_on_DNA_colloid | Nerdss_initial_configuration/src/boundary_conditions/reflect_complex_rad_rot.cpp | /*! \file reflect_complex_targCom.radius_rot.cpp
* ### Created on 02/25/2020 by Yiben Fu
* ### Purpose
* ***
*
* ### Notes
* ***
*
* ### TODO List
* ***
*/
#include "boundary_conditions/reflect_functions.hpp"
void reflect_complex_rad_rot(const Membrane& membraneObject, Complex& targCom, std::vector<Molecule>... | ALGO | 0.982807 | 6.29756 |
7759b07c-8b94-4e9e-bb09-6f9698059a23 | urawa72/procon | atcorder/abc141/d/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
#define ld long double
#define ll long long
#define mod 1000000007
#define IINF INT_MAX
#define INF 1LL << 30
int main() {
int n, m; cin >> n >> m;
// 常に最大値を割引するのが良い
// priority_queueで現段階でのmaxを... | ALGO | 0.999773 | 3.947998 |
2ed7819a-54fa-4ca9-82bb-71b245b185d2 | dengyu9080/my_leetcode | cpp/Roman to Integer.cpp | class Solution {
public:
int romanToInt(string s) {
unordered_map<char, int>roman2int = {{'I',1},{'X',10},{'C',100},{'M',1000},{'V',5},{'L',50},{'I',1},{'D',500}};
int result = 0;
s+='I';
for (int i = 0; i<s.size()-1; i++)
result += roman2int[s[i]]>=roman2int[s[i+1]]?roman2... | ALGO | 0.999027 | 6.145452 |
e8980a7b-49f1-415f-8d7a-aa9344273421 | borgebj/Kattis | kattis/easy/ccpp/detaileddifferences.cpp | //
// Created by BBJ on 08.01.2024.
//
#include <iostream>
#include <string>
int main() {
int n; std::cin >> n;
std::cin.ignore(); // ignore newline
for (size_t i=0; i < n; ++i) {
std::string case_one, case_two;
std::getline(std::cin, case_one);
std::getline(std::cin, case_two);
... | ALGO | 0.99935 | 4.138567 |
89df81f8-d12a-4e8e-a2c0-34393b1378a1 | saulcanche/codeforces | contests/867/B.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
void solve() {
ll n;
cin >> n;
vector<ll> nums(n);
for (ll &x : nums) {
cin >> x;
}
sort(nums.begin(), nums.end());
ll prod1 = nums[0] * nums[1];
ll prod2 = nums[n-1] * nums... | ALGO | 0.999977 | 5.123512 |
f9510c38-6dd3-4222-81d0-55640318e340 | vietunitydev/SourceCodePTIT | SAMSUNG/SỐ BƯỚC ÍT NHẤT.cpp | #include <bits/stdc++.h>
using namespace std;
void TestCase() {
int n, a[1001];
cin >> n;
for (int i = 1; i <= n; ++i) {
cin >> a[i];
}
int f[1001] = {0};
for (int i = 1; i <= n; ++i) {
f[i] = 1;
for (int j = 1; j < i; ++j) {
if (a[j] <= a[i] && f[j] + 1 > f... | ALGO | 0.999008 | 4.752065 |
519ca50d-44c4-4b2a-a362-89ad3f73f3c3 | 1806PiYuSh1806/CSES-Problems | Graphs/GameRoutes.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <climits>
using namespace std;
int MOD = 1e9 + 7;
int main(){
int n, m;
cin>>n>>m;
vector<vector<int>>adj(n);
vector<int>indegree(n, 0);
for(int i = 0; i < m; i++){
int u, v;
cin>>u>>v;
... | ALGO | 0.999972 | 5.091388 |
544b7da8-ff61-411e-9c66-4146fe3ff312 | miaobuao/CoTally | 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 |
6cf801cf-7fe6-4756-b2fb-1b7c2f9ad594 | Payal-mak/Arrays | deltaDemodulation.cpp | #include <iostream>
#include <vector>
using namespace std;
// Function for Delta Demodulation
void deltaDemodulation(vector<int>& bitStream, double stepSize, double initVoltage) {
double currentVoltage = initVoltage;
cout << "Initial Voltage: " << currentVoltage << "V" << endl;
// Iterate through each bi... | ALGO | 0.999072 | 6.929767 |
87226412-5a81-452c-9064-53459b5eb6cf | DavidSchurer/Binary-Search-Tree | lab2.cpp | // ----------------------------- lab2.cpp ------------------------------
// David Schurer
// CSS 343
// Creation Date: 4/12/2023
// Date of Last Modification: 4/20/2023
// ---------------------------------------------------------------------
// Purpose - The lab2.cpp file is the driver file that is used to test
// the ... | TEST | 0.986906 | 5.390117 |
42ae386e-6db0-43b1-8bb0-0777e1be4779 | dimasrwz/votingapp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998784 | 6.761023 |
49fee1a8-ac91-4413-b85e-a9d2f3456f82 | diohabara/competitive_programming | ac/prev/abc113_b.cpp | #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
const int MAX = 1000000;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N; cin >> N;
int T, A; cin >> T >> A;
int H[2000];
for(int i = 0; i < N; i++){
... | ALGO | 0.999854 | 4.009369 |
f33c61ea-e275-4008-8095-ab9bb228a911 | Eugenescat/algorithms | acwing-level-2/graph/【模版】树和图的dfs.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1e5 + 10, M = N * 2;
int n, m;
int h[N], e[M], ne[M], idx;
bool st[N];
void add(int a, int b) // 在h(a)插入节点b = 将a和b相连
{
e[idx] = b, ne[idx] = h[a], h[a] = idx;
idx ++;
}
void dfs(int u)
{
st[u] = true;
fo... | ALGO | 0.999861 | 3.356015 |
3ddaa381-d085-4068-9cdc-0cc12388cc65 | leeuihyun/baekjoon-solve | 15652.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include <string>
#include<math.h>
#include<vector>
#include<malloc.h>
#include<deque>
#include<stack>
#include<queue>
#include <sstream>
#include <functional>
#include <map>
#include <list>
#include <cmath>
#define _CRT_SECURE_NO_WARNINGS
#define MAX 1000001
usi... | ALGO | 0.999841 | 3.697771 |
246a4eea-3792-4e91-ba9e-2445f662602f | RafalOsieka/SPOJ | ABCLOG/ABCLOG.cpp | #include <iostream>
using namespace std;
// converting dec to bin and reverse
string condb(int number) {
string rev = "";
do
{
if ( (number & 1) == 0 )
rev += "0";
else
rev += "1";
number >>= 1;
} while ( number );
return rev;
}
... | ALGO | 0.999632 | 4.69108 |
8a6e8f6f-82bf-45a0-ba6a-a0643274f834 | Anuj1216/OOP-Codes | areatri&rec.cpp | #include <iostream>
using namespace std;
float area(float ba, float h)
{
float area = (ba * h)/2;
return area;
}
int area(int l, int b)
{
int area = l * b;
return area;
}
main()
{
int l,b;
float ba,h;
cout<<"Enter the base of triangle: ";
cin>>ba;
cout<<"Enter the height of triangle: ";
cin>>h;
cout<<"Enter ... | TOOL | 0.968074 | 3.498862 |
d5021d2e-7485-42d4-b361-d35e85201090 | akhilred36/coScheduling | apps/lammps/src/OPENMP/angle_cosine_periodic_omp.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "omp_compat.h"
#include "angle_cosine_periodic_omp.h"
#include <cmath>
#include "atom.h"... | ALGO | 0.99863 | 6.964008 |
ef557263-1cab-4734-9a22-c2317ec29b9c | chinauas/ardupilot | libraries/SITL/SIM_Submarine.cpp | /*
Submarine simulator class
*/
#include "SIM_Submarine.h"
#include <AP_Motors/AP_Motors.h>
#include <stdio.h>
using namespace SITL;
static Thruster vectored_thrusters[] =
{ // Motor # Roll Factor Pitch Factor Yaw Factor Throttle Factor Forward Factor Lateral Factor
Thru... | TOOL | 0.902521 | 6.484263 |
50ee8700-4fbf-4af1-a3db-5fd3b78fba09 | ohseongtaek/Programmers_Algorithm | 128_숫자문자열과영단어/소스.cpp | #include <string>
#include <iostream>
#include <vector>
using namespace std;
vector<string> Number_list = {"zero","one","two","three","four","five","six","seven","eight","nine" };
string Changed(string s)
{
string strRet = "";
if (s == "one")
{
strRet = "1";
}
else if (s == "two")
{
... | ALGO | 0.996551 | 5.317734 |
134e57f5-28e7-4aff-8b36-860992ed9c80 | ish-123-m/test1 | C++/design-a-file-sharing-system.cpp | // Time: ctor: O(1)
// join: O(logu + c), u is the number of total joined users
// leave: O(logu + c), c is the number of chunks
// request: O(u)
// Space: O(u * c)
// "u ~= n" solution, n is the average number of users who own the chunk
class FileSharing {
public:
FileSharing(int m) ... | ALGO | 0.997973 | 5.626587 |
40e07e91-5215-43c3-bd79-3451c73bf5d0 | martell/ellcc | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | #include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/Target/TargetLowering.h"
using namespace llvm;
namespace {
class VectorLegalizer {
SelectionDAG& DAG;
const TargetLowering &TLI;
bool Changed; // Keep track of whether anything changed
/// For nodes that are of legal width, and that have more than one use,... | ALGO | 0.975405 | 6.412121 |
686c7099-92d6-403f-8056-5d40d41468f8 | Xanonymous-GitHub/cs922-lab | karman/src/boundary.cpp | #include <string>
#include "datadef.hpp"
#include "matrix.hpp"
/* Given the boundary conditions defined by the flag matrix, update
* the u and v velocities. Also enforce the boundary conditions at the
* edges of the matrix.
*/
void apply_boundary_conditions(
const matrix<float>& u,
const matrix<float>& v,
... | ALGO | 0.999879 | 6.474884 |
6b1745ae-9047-4b87-bcc2-1984d289b6e4 | ErickPetru/android_frameworks_base | media/libstagefright/codecs/aacdec/inv_short_complex_rot.cpp | /*
Pathname: inv_short_complex_rot.c
Funtions: inv_short_complex_rot
------------------------------------------------------------------------------
REVISION HISTORY
Date: 10/18/2002
Description:
(1) Change the input argument, only a single max is passed.
(2) Eliminate search for max, a ... | ALGO | 0.999945 | 4.457577 |
a6b2a6ba-4d15-4bc5-b8e6-118497283c9b | jiangyc2024/NumCSE | Assignments/Codes/IterativeMethods/JuliaSet/julia.cpp | # include <Eigen/Dense>
# include <cmath>
# include <iostream>
# include <mgl2/mgl.h>
# include "meshgrid.hpp"
typedef Eigen::VectorXd Vec;
typedef Eigen::MatrixXd Mat;
class F {
public:
Vec operator()(Vec& x)
{
Vec fx(2);
#if SOLUTION
fx << x(0)*x(0)*x(0) - 3*x(0)*x(1)*x(1) - 1,
... | ALGO | 0.999942 | 5.44322 |
3eb12268-b3a1-4527-aed3-16724131462f | Pranshh19/DSA | Assignment7/01.cpp | #include<iostream>
using namespace std;
#include<bits/stdc++.h>
int main(){
string s = "egg";
string e = "add";
int flag = 0;
if (s.length() > e.length() || s.length() < e.length()){
flag = 1;
}
map<char, char> mp;
map<char, char> mt;
for (int i = 0; i < s.length();i++){
... | ALGO | 0.999562 | 3.018594 |
69d6c762-6f4a-4cc1-b3ff-a6fadd485cb1 | doorcs/Algorithm | BOJ/11279.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
cin.tie(nullptr);
cout.tie(nullptr);
ios_base::sync_with_stdio(false);
priority_queue<int> pq;
int N; cin >> N;
while (N--) {
int x; cin >> x;
if (!x) { // x == 0
if (pq.empty()) {
cout << 0 << '\n';
... | ALGO | 0.999903 | 4.646112 |
4df12922-27c0-40ee-9a59-eca0ee5b0e2a | TatyanaV/Introduction-to-C-part-1 | week 6/week 6/problem4.cpp | /*******************************************************************
* Author: Tatyana Vlaskin
* Week 6, Problem 4
* Description:
* Program asks for the names of two player and asks each player to indicate
move on the tic tac toe board
* Input: Names of the players and moves
Output:
************************************... | ALGO | 0.999555 | 5.624528 |
eed445d4-98d9-4ff3-b663-d101cb2aa637 | vguenoff/cpp | 01fundamentals/06VectorsListsIteratorsLab/01RemoveNegativesAndReverse.cpp | #include <cctype>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
// Write a program that:
// Read a sequence of numbers, separated with single space
// Remove all negative numbers from given sequence
// Print the remaining elements in reversed order
// Note: In case of no elements left ... | ALGO | 0.999373 | 5.501708 |
8bd67421-f46c-4b5b-a8d6-298b2c33a314 | amiller/pyzxing | zxing_cpp/core/src/zxing/oned/Code39Reader.cpp | // -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*-
#include "Code39Reader.h"
#include <zxing/oned/OneDResultPoint.h>
#include <zxing/common/Array.h>
#include <zxing/ReaderException.h>
#include <math.h>
#include <limits.h>
namespace zxing {
namespace oned {
static const char* ALPHABET = "01234... | ALGO | 0.915033 | 7.087094 |
d9e8f6d6-c58f-4872-b2b2-cb5b0d47cec6 | Fatin007/Phitron_XPSC | Week_1/F.cpp | #include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
void solve(){
int x,y,z; cin>>x>>y>>z;
cout<<z/x*y<<endl;
}
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
solve();
} | ALGO | 0.99601 | 3.898211 |
399b69e9-903f-4dee-be02-8f0de05d02e1 | mulmuri/Algorithm | problems/boj/15585.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
using namespace std;
const int SIZE = 100001;
const int MOD = 1e9+7;
int n;
int arr[SIZE];
long long getRect(long long x, long long y) {
return x*(x+1)/2 * y*(y+1)/2 % MOD;
}
int main() {
cin >> n;
for (int i=0; i<n; i++) {
... | ALGO | 0.999576 | 4.797885 |
7ef0441a-60a7-4e0a-8598-3ca017471dcc | Dinngger/cpp_class | compstr.cpp | #include<iostream>
#include<string>
using namespace std;
int max(int a, int b){
int result;
if(a > b)
result = a;
else
result = b;
return result;
}
int main(){
string dst, src;
int num=0;
getline(cin, dst);
getline(cin, src);
for(int i=0; i<max(dst.length(), src.len... | ALGO | 0.999306 | 3.078906 |
b01aaeab-ba4b-414b-a7c6-bae9f5567dcf | MartijnFr/SSE-21-1 | src/cpp/RadixSort.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <algorithm>
using namespace std;
int getMax(const vector<int>& arr) {
return *max_element(arr.begin(), arr.end());
}
void countingsort(vector<int>& arr, int exp) {
int n = arr.size();
vector<int> output(n);
vector<in... | ALGO | 0.99247 | 5.858829 |
4c1faed5-fd98-4291-a905-8e34a8e7dd23 | RikuPutkinen/cses-solutions | sorting-and-searching/movie-festival/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n{}, a{}, b{}, c{}, m{};
vector<pair<int,int>> v;
cin >> n;
while (n--){
cin >> a >> b;
// Put ending time first for easier sorting
v.push_back({b, a});
}
sort(v.begin(), v.... | ALGO | 0.99979 | 4.898877 |
399b0dd7-dd6a-45c5-83ae-2db2582a9acc | santorasu/flutter_practices | 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 |
69133400-4a6c-4247-9c7e-d907b3314252 | LugaRamos/Servico_Gas | servico_gas/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.998568 | 6.776823 |
8dff6afd-763c-4b71-8d0b-105175c0c310 | Swapnanil70/Data_Structures_and_Algorithms_Practice | Linked_List/merge_2_sorted_LL.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int value){
data = value;
next = NULL;
}
};
void insertatHead(node* &head, int value){
node* n = new node(value);
n->next = head;
head = n;
}
void insertatTail(node* &head, int value)... | ALGO | 0.99995 | 4.756946 |
f275bb22-921f-47e9-a8db-7327fefec63c | orihehe/BOJ | _etc/2830번_행성 X3.cpp | /*
BOJ 2830 - 행성 X3
https://www.acmicpc.net/problem/2830
i자리의 비트의 개수를 저장해둔다.
i자리의 반대 비트 수 * 1<<i 의 합이 답이 된다.
*/
#include <cstdio>
#define ll long long
using namespace std;
/* 🐣🐥 */
int arr[2][21];
int main() {
int n, x, tt;
ll ans = 0;
scanf("%d", &n);
while (n--) {
scanf("%d", &x);
for (int i = 0; i < 20; ... | ALGO | 0.999913 | 4.467227 |
298fef00-f7d4-4e1e-902e-67a26b3b2434 | jseobyun/WarpHE4D_ReFLAME | ext/botsch-kobbelt-remesher-libigl/ext/libigl/include/igl/copyleft/comiso/frame_field.cpp | #include <igl/triangle_triangle_adjacency.h>
#include <igl/edge_topology.h>
#include <igl/per_face_normals.h>
#include <igl/copyleft/comiso/nrosy.h>
#include <iostream>
namespace igl
{
namespace copyleft
{
namespace comiso
{
class FrameInterpolator
{
public:
// Init
IGL_INLINE FrameInterpolator(const Eigen::Matri... | ALGO | 0.998712 | 4.356214 |
2d9894e3-23fa-449f-bde9-e0ce28b97669 | NicholasAdmin/EDEN | src/crypto/sha1.cpp | #include "crypto/sha1.h"
#include "crypto/common.h"
#include <string.h>
// Internal implementation code.
namespace
{
/// Internal SHA-1 implementation.
namespace sha1
{
/** One round of SHA-1. */
void inline Round(uint32_t a, uint32_t& b, uint32_t c, uint32_t d, uint32_t& e, uint32_t f, uint32_t k, uint32_t w)
{
... | ALGO | 0.998309 | 7.495188 |
4bcd972b-6f62-4e24-b47f-bb5db28a8b69 | 4245877/Julia | libraries/opencv/opencv-4.11.0/sources/modules/imgproc/src/linefit.cpp | #include "precomp.hpp"
namespace cv
{
static const double eps = 1e-6;
static void fitLine2D_wods( const Point2f* points, int count, float *weights, float *line )
{
CV_Assert(count > 0);
double x = 0, y = 0, x2 = 0, y2 = 0, xy = 0, w = 0;
double dx2, dy2, dxy;
int i;
float t;
// Calculating t... | ALGO | 0.999437 | 6.489557 |
ac585dfc-6a83-4ae4-8736-80790cbcc3b0 | Chi-naza/flutter_power_method_channels | 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 |
3cbf3af0-e899-48b1-ba2e-795236b1f057 | hudsongeovane/problems | codeforces/random/catfoxarray.cpp | #pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#inc... | ALGO | 0.999536 | 5.274009 |
824ab9a1-fd72-4209-b5cc-09b8adaf6116 | ishandutta2007/codeforces | dmga44/normal/1283/F.cpp | #pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2") //Enable AVX
#include <bits/stdc++.h>
#define db(x) cout << (x) << '\n';
#define all(v) (v).begin(),(v).end()
#define a... | ALGO | 0.999936 | 3.866482 |
d006ad01-828f-4be4-8a5a-3dc4533e835b | vishaljbhandari/LearnC | Pending/example/templates/variadic/variadic_functions.cpp | #include <iostream>
#include <cstdarg>
using namespace std;
/*
Defined in header <cstdarg>
Variadic functions are functions (e.g. printf) which take a variable number of arguments.
To declare a variadic function, an ellipsis is used as the last parameter,
e.g. int printf(const char* format, ...);
See Variadic ... | TOOL | 0.956678 | 6.51454 |
11f2c58c-ef84-46e0-9864-c503edecec05 | nrdyava/Competitive-Coding | LeetCode/merge intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
vector<vector<int>> ans;
vector<int> temp;
sort(intervals.begin(), intervals.end());
temp = intervals[0];
for(int i=1; i<intervals.size(); i++){
if(inte... | ALGO | 0.999999 | 6.116255 |
a428af17-61fc-4430-b2bd-322ef9b49df5 | shareefmwafy/Leet-Code-Problems | 1-two-sum/two-sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector<int> result;
for(auto it1 = nums.begin(); it1<nums.end(); it1++){
auto it2 = find(it1+1, nums.end(), target - *it1);
if(it2 != nums.end()){
result.push_back(it1 - nums.begin())... | ALGO | 0.999659 | 6.300272 |
453b717b-a137-4ff8-83f7-bac0da050f22 | praptipatel7/Basic_Logic | Patterns And Basics/Armstrong.cpp | //======================================================================
//Check if a number is Armstrong.
#include<iostream>
#include<cmath>
using namespace std;
bool isArmstrong(int num){
int temp=num;
int digits=0;
while(temp!=0){
digits++;
temp=temp/10;
}
int sum=0;
temp=num... | ALGO | 0.999724 | 4.510494 |
45e82007-1c9e-4291-b873-9e9834a06cb7 | ishandutta2007/codeforces | square1001/normal/714/A.cpp | #include <iostream>
#include <algorithm>
using namespace std;
long long l1, r1, l2, r2, s;
int main() {
cin >> l1 >> r1 >> l2 >> r2 >> s; r1++; r2++;
long long l3 = max(l1, l2), r3 = min(r1, r2);
if (l3 >= r3) cout << 0 << endl;
else cout << (r3 - l3 - (l3 <= s && s < r3 ? 1 : 0)) << endl;
return 0;
} | ALGO | 0.999747 | 3.275321 |
827f8bfa-fb28-46fb-84a2-cc06980c8c91 | iAbhayRajput/DSA | C++/260-270/263.cpp | class Solution {
public:
bool isBalanced(string& s) {
stack<char>st;
for (int i=0; i<s.size();i++){
if(s[i]=='('|| s[i]=='[' || s[i]=='{') st.push(s[i]);
else{
if(!st.empty()&& ((st.top()=='(' && s[i] == ')') || st.top()=='[' && s[i]==']' || (st.top()=='{' && s[i]==... | ALGO | 0.998675 | 6.254695 |
30387fea-bae2-4eeb-a2d9-e66cece56ab4 | neverset123/Self-Driving-Car | CarND-Path-Planning-Project/src/Eigen-3.3/doc/examples/class_CwiseUnaryOp_ptrfun.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
// define function to be applied coefficient-wise
double ramp(double x)
{
if (x > 0)
return x;
else
return 0;
}
int main(int, char**)
{
Matrix4d m1 = Matrix4d::Random();
cout << m1 << endl << "becomes: " << endl << ... | ALGO | 0.981495 | 4.120226 |
e6889256-2415-43c9-b1f2-b1d28c77c948 | ishandutta2007/codeforces | dxqwq/normal/1392/H.cpp | // Problem: CF1392H ZS Shuffles Cards
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/CF1392H
// Memory Limit: 500 MB
// Time Limit: 2000 ms
//
// Powered by CP Editor (https://cpeditor.org)
//
#include<bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC t... | ALGO | 0.999989 | 4.30477 |
faea0ea2-e279-42df-b938-0b308e7a9385 | Chandrabhushan-mishra01/Operating_System | Operating_system/Process Synchronization/Dining_philosopher.cpp | #include <iostream>
#include <vector>
using namespace std;
#define thinking 1
#define hungry 2
#define eating 3
vector<int> chopsticks = {1, 1, 1, 1, 1};
vector<int> philosophers = {thinking, thinking, thinking, thinking, thinking};
int eat(int pos) {
if (chopsticks[pos] == 1 && chopsticks[(pos + 1) % 5]) {
... | ALGO | 0.982857 | 3.923654 |
07bf276e-4630-4e31-b5f6-e3aea9052673 | SeongmanPark/Algorithm | Baekjoon/Baekjoon 1347 미로 만들기.cpp | #include <iostream>
//#include <fstream>
using namespace std;
int N;
int map[101][101];
char mv[51];
int dx[] = { -1,0,1,0 };
int dy[] = { 0,1,0,-1 };
// 북 동 남 서 !!!!
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//ifstream cin("input.txt");
cin >> N;
for (int i = 1; i <= N; i++)
{
cin >> mv[i... | ALGO | 0.999982 | 3.495686 |
dcc70c17-dd8c-4748-b47f-767c651a3875 | Dinesh-22/leetcode | 2450-minimum-replacements-to-sort-the-array/minimum-replacements-to-sort-the-array.cpp | class Solution {
public:
long long minimumReplacement(vector<int>& nums) {
long long ans = 0;
int n = nums.size();
int prev = nums[n-1];
for(int i=n-2;i>=0;i--){
int numOfDel = nums[i]/prev;
if(nums[i]%prev!=0){
numOfDel++;
p... | ALGO | 0.999773 | 5.772607 |
f7c05d57-3b81-42f2-adfd-ea3cca1cea7e | elsampsa/valkka-core | ext/live/liveMedia/MPEG2TransportStreamFramer.cpp | #include "MPEG2TransportStreamFramer.hh"
#include <GroupsockHelper.hh> // for "gettimeofday()"
#define TRANSPORT_PACKET_SIZE 188
////////// Definitions of constants that control the behavior of this code /////////
#if !defined(NEW_DURATION_WEIGHT)
#define NEW_DURATION_WEIGHT 0.5
// How much weight to give to the l... | TOOL | 0.863358 | 6.774043 |
86b064b7-cbd8-4406-8dce-227c9f52df9c | Muhammad-Abdul-Basit/C--Leetcode-Exercises | Find the highest altitude.cpp | // ConsoleApplication1.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include<vector>
class Solution
{
public:
int largestAltitude(std::vector<int>& gain)
{
int highest_altitude = 0;
int previous_sum = 0;
for (int i = 0; i... | ALGO | 0.999701 | 6.679331 |
8cc243b3-fd3f-4c0a-86c6-baa3c9a30f08 | EswarAleti/CPP | Pattern1/pattern.cpp | #include<iostream>
using namespace std;
int main(int argc, char **argv)
{
int no_of_symbol,no_of_moves;
no_of_symbol = atoi(argv[1]);
no_of_moves = atoi(argv[2]);
int line=0,first=0;
while(first+no_of_moves<10)
{
int no_of_symbol_per_line=0;
for(int i=0;i<line*no_of_moves;i++)
{
no_of_symbol_per_line++;... | ALGO | 0.999092 | 3.030376 |
cf117cea-49f2-4f07-be61-f75650b3ed08 | MakuwaDev/UW-Projects | Year2/Algorithms and Data Structures/BigTask02/ogr/ogr.cpp | #include <concepts>
#include <array>
#include <tuple>
#include <algorithm>
#include <iostream>
namespace {
template <typename T>
concept Addable = requires(T a, T b) {
{ a + b } -> std::same_as<T>;
{ a += b };
{ a + b == b + a};
};
template <typename T>
concept Comparable = requires(T a, T b) {
{ a <... | ALGO | 0.999921 | 6.695752 |
61a68ee2-9798-47f5-af06-e1790da161c9 | kmaninis/COB | src/proposals/mex_max_margin.cpp | void mexFunction( int nlhs, mxArray *plhs[],
int nrhs, const mxArray*prhs[] )
{
if(nrhs<3)
mexErrMsgTxt("There should be at least 3 input parameters");
/* Input parameters */
ConstMatlabMultiArray<double> pairs(prhs[0]);
ConstMatlabMultiArray<double> scores(prhs[1]);
ConstM... | ALGO | 0.999691 | 5.576008 |
8bd7d42e-18a9-4ad2-a19a-c81facd1412c | Dean-op/AlgorithmQuestinos | highPrecision/Adivb/main.cpp | #include <bits/stdc++.h>
using namespace std;
auto div( vector<int>&A, int& b, int& r ){
vector<int>C;
for( int i = A.size()-1; i>=0; i-- ){
r = r*10 + A[i];
C.push_back( r/b );
r %= b;
}
reverse(C.begin(),C.end());
while( C.size() > 1 && C.back() == 0 ) C.pop_back();
re... | ALGO | 0.999625 | 4.63644 |
c72e24a8-9a78-4590-9add-7395be35de98 | tuanpa-tpa/Algorithm-DataStructures-Class | Dynamic/XÂU ĐỐI XỨNG 2/main.cpp | #include <iostream>
#include <string>
using namespace std;
int lps(string s) {
int n = s.size();
int A[n][n];
for (int i = 0; i < n; i++)
A[i][i] = 1;
for (int k = 2; k <= n; k++) {
for (int i = 0; i < n - k + 1; i++) {
int j = i + k - 1;
if (s[i] == s[j] && k ... | ALGO | 0.99995 | 4.764618 |
7083b112-21c0-47e5-8e94-2e50697553b1 | EnriqueLoredo/Funciones | POO/Programa5.cpp | #include<iostream>
using namespace std;
int Factorial (int a);
int main()
{
int N1;
cout<<"Introduzca el valor del numero: \n";
cin>>N1;
int fact = Factorial (N1);
cout<<"El factorial es: "<<fact<<endl;
return 0;
}
int Factorial(int a){
int i;
int resultado = 1;
for (i=1; i <=a; ... | ALGO | 0.995307 | 3.626539 |
7650e7c7-0755-47ec-89d6-841bab2b2331 | YanSuanjjy/OJ | euler.cpp | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
//
ll euler[maxn];
void getEuler(int n){
memset(euler,0,sizeof(euler));
euler[1] = 1;
for(int i = 2;i <= n;i++)
if(!euler[i])
for(int j = i;j <= n; j += i){
if(!euler[j])euler[j] = j;
euler[j] = euler[j]/i*(i-1);
... | ALGO | 0.999882 | 3.948154 |
2a841f3f-eba5-4348-895f-498285fcb7ce | tushar20008/Competitive-Coding | Problems and Solutions/266 - Cow Contest.cpp | #include <iostream>
#include <cstring>
using namespace std;
int main()
{
int n,m;
while(cin>>n>>m)
{
int cow=0;
int R[n][n];
memset(R,0,sizeof(R));
for(int i=0; i<n; i++)
R[i][i]=1;
int i,j;
while(m--)
{
cin>>i>>j;
R[--i][--j]=1;
}
for (int k = 0; k < n; k++)
for (i = 0... | ALGO | 0.999807 | 3.861158 |
89657c20-2d36-46ac-a20c-559237511edb | R-YimY/PointCloudProcesses | 3D-pointcloud-RANSAC-LineFit/main.cpp | #include "/usr/include/pcl-1.8/pcl/visualization/cloud_viewer.h"
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include "structs.h"
#include "fittingLine.h"
#include <Eigen/Dense>
#include <algorithm>
#include <random>
#include <thread>
using namespace std;
using na... | ALGO | 0.9616 | 3.451555 |
4c57b5ca-c028-44e1-9a37-b9b2211e0ad9 | adarsh1github1/leetcode-problems | DFS.cpp | #include <bits/stdc++.h>
using namespace std;
class Graph{
private:
int v;
list<int> *adj;
public:
Graph(int v);
void addEdge(int v,int w);
void dfs();
void dfs_helper(int x, vector<bool>& visited);
};
Graph::Graph(int v){
this->v = v;
adj = new list<int>[v];
}
void Graph::addEdge(int v,int w){
adj[v].push_bac... | ALGO | 0.999932 | 3.918458 |
8a2a7f51-c24c-4a4b-8274-c92386754e1a | truongpham090325/DSA-Practice | QuayLui/QuayLuiToHop.cpp | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
typedef long long ll;
/*
* Bài toán: Sinh các tổ hợp chập k của n phần tử
* ----------------------------------------------
* Cho hai số nguyên dương n và k (1 ≤ k ≤ n ≤ 20).
* Hãy liệt kê tất cả các tổ hợp chập k của tập S = {1, 2, ..., n},
* mỗi... | ALGO | 0.999946 | 4.501398 |
784d2f26-771f-47e7-aba4-27c33d204814 | Denisqu/problem-solving | algorithms/easy/3_path_crossing.cpp | /*
Given a string path, where path[i] = 'N', 'S', 'E' or 'W', each representing moving one unit north, south, east, or west, respectively. You start at the origin (0, 0) on a 2D plane and walk on the path specified by path.
Return true if the path crosses itself at any point, that is, if at any time you are on a locati... | ALGO | 0.999935 | 6.765548 |
7e223486-f762-440d-b814-bf964b583cc3 | Iftekhar-Ahamed/Code | Playlist.cpp | /***
** Bismillahir Rahmanir Rahim
** ALLAHU AKBAR
**
** Author: Iftekhar Ahamed Siddiquee
** Bangladesh University of Business and Technology,
** Dept. of CSE.
***/
#include <bits/stdc++.h>
using namespace std;
#define FIO cin.tie(NULL), ios_base::sync_with_stdio(false)
#define read freo... | ALGO | 0.99992 | 4.218908 |
02560989-5bdb-49a4-9250-7de01c1457e6 | aseemrb/competitive | c++/555a.cpp | /*
Author: aseemraj
Problem: 555a
*/
#include <bits/stdc++.h>
#define loop(i, a, b) for(int i=a; i<b; i++)
#define rloop(i, a, b) for(int i=b-1; i>=a; i--)
#define V(x) vector< x >
#define P(x, y) pair< x, y >
#define PI P(int, int)
#define PLL P(ll, ll)
#define VI V(int)
#define VLL V(ll)
#define VP V(PI)
#define ALL... | ALGO | 0.999861 | 3.476333 |
b2050a4c-aee7-4774-815d-a87987bb7501 | kajalc7/Data-Structure-and-algorithm-Practice | Nearly sorted - GFG/nearly-sorted.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return the sorted array.
vector <int> nearlySorted(int arr[], int num, int K){
// Your code here
vector<int>v;
priority_queue<int, vector<int>, greater<in... | ALGO | 0.999957 | 5.896655 |
f007a092-7472-4173-adde-ed4e0b188b5b | sriram99895/Owlcoder | wateringplants.cpp | //2079
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int wateringPlants(vector<int>& plants, int capacity) {
int nc = capacity;
int s = 0;
for(int i =0;i<plants.size();i++){
if(plants[i]<= capacity){
s+=1;
capacity = capacit... | ALGO | 0.999969 | 4.596114 |
eb8cbd1a-d44c-4193-9858-4150391c116d | chyhhwen/image-recognition-java | opencv/sources/modules/cudaimgproc/src/hough_lines.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
Ptr<cuda::HoughLinesDetector> cv::cuda::createHoughLinesDetector(float, float, int, bool, int) { throw_no_cuda(); return Ptr<HoughLinesDetector>(); }
#else /* !defined (HAVE_CUDA) */
namespace c... | TOOL | 0.912715 | 6.868963 |
00fd09e3-99dc-4779-8780-fd0b920fd998 | nibtehaz/Codeforces | 86D.cpp | /* بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ */
/* رَّبِّ زِدْنِى عِلْمًا */
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <iostream>
#include <string>
#include <map>
#include <list>
#include <stack>
#include ... | ALGO | 0.99938 | 3.434814 |
293297df-46c3-43dc-afb0-c4fcef4ccd08 | raincross7/code-similarity | codes/train_code/problem345/problem345_498.cpp | #include <iostream>
int main()
{
unsigned int n; // The number of meals ordered by customer.
std::cin >> n;
unsigned int PricePerMeal { 800 };
unsigned int CustomerPaid { n * PricePerMeal };
unsigned int PaidBackPer15 { 200 };
unsigned int PaidBack { n / 15 * PaidBackPer15 };
unsig... | ALGO | 0.997281 | 4.220026 |
a54f41e6-9328-49db-920d-1231ee758390 | emrul-chy/Competitive-Programming | UVa/11028 - Sum of Product.cpp | #include <bits/stdc++.h>
#define LL long long int
using namespace std;
map <LL, LL> mp;
void gen()
{
LL ar[25], i, j, n, sum;
for(i=1; i<=20; i++)
{
for(j=0; j<i; j++)
{
ar[j] = j;
}
set <LL> s;
while(next_permutation(ar, ar+i))
{
sum... | ALGO | 0.999574 | 4.110615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.