uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
305b74ba-407c-4a71-bf51-2bc286c400dc | juuso-oskari/VisualSLAM | libs/opencv/modules/photo/src/hdr_common.cpp | #include "precomp.hpp"
#include "opencv2/photo.hpp"
#include "hdr_common.hpp"
namespace cv
{
void checkImageDimensions(const std::vector<Mat>& images)
{
CV_Assert(!images.empty());
int width = images[0].cols;
int height = images[0].rows;
int type = images[0].type();
for(size_t i = 0; i < images.s... | TOOL | 0.974469 | 5.91502 |
7902333e-d639-4df7-ae3b-d1d425972b74 | sarvex/leetcode-idris | solution/1300-1399/1338.Reduce Array Size to The Half/Solution.cpp | class Solution {
public:
int minSetSize(vector<int>& arr) {
int mx = *max_element(arr.begin(), arr.end());
int cnt[mx + 1];
memset(cnt, 0, sizeof(cnt));
for (int& x : arr) {
++cnt[x];
}
sort(cnt, cnt + mx + 1, greater<int>());
int ans = 0;
... | ALGO | 0.999943 | 5.594148 |
3793bab1-e1ef-422f-9306-85e898f8552c | yp/reHCstar | solver/cryptominisat/PackedRow.cpp | #include "PackedRow.h"
using namespace CMSat;
bool PackedRow::operator ==(const PackedRow& b) const
{
#ifdef DEBUG_ROW
assert(size > 0);
assert(b.size > 0);
assert(size == b.size);
#endif
return (std::equal(b.mp-1, b.mp+size, mp-1));
}
bool PackedRow::operator !=(const PackedRow& b) const
{
... | ALGO | 0.991122 | 6.20753 |
db7cd3e9-6dd1-4f53-bc1a-70f084155e78 | akiiishiii/oi_exercises | 10.6/race.cpp | // race.cpp
#include <iostream>
#include <fstream>
#include <algorithm>
#include <deque>
//#define debug
#ifndef debug
std::ifstream in("race.in");
std::ofstream out("race.out");
#else
#define in std::cin
#define out std::cout
#endif // debug
int const N = 200005;
int head[N], Next[N << 1], ver[N << 1], edge[N <... | ALGO | 0.999938 | 4.110352 |
64633942-57e7-4062-b199-a1a53574e169 | matumoto1234/atcoder | abc/061/C/main.cpp | #include <bits/stdc++.h>
#include <atcoder/fenwicktree.hpp>
using namespace atcoder;
using namespace std;
// clang-format off
#define range(i, l, r) for ( int i = (int)(l); i < (int)(r); (i) += 1 )
#define rrange(i, l, r) for ( int i = (int)(r)-1; i >= (int)(l); (i) -= 1 )
#define debug(x) cerr << "(" << __LINE__ << "... | ALGO | 0.999982 | 5.389427 |
6d8f34dd-bdbc-4534-b86a-9bf127a4eee8 | sarvex/leetcode-idris | lcof2/剑指 Offer II 066. 单词之和/Solution.cpp | class MapSum {
public:
unordered_map<string, int> data;
unordered_map<string, int> t;
/** Initialize your data structure here. */
MapSum() {
}
void insert(string key, int val) {
int old = t[key];
t[key] = val;
for (int i = 1; i < key.size() + 1; ++i) {
strin... | ALGO | 0.999658 | 6.840009 |
58d61c94-c9a0-4074-aa27-0f505f9a3ff4 | kt117/ProCom | atcoder/abc/101-200/191-200/200/e.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << end... | ALGO | 0.999814 | 3.437503 |
35eb0ba2-996d-4a7d-a308-141b84d90106 | Hafiz-Sakib/CPP-for-CP | CSES Problem Solving/All/solutions/1634 - Minimizing Coins.cpp | /*
Problem Name: Minimizing Coins
Problem Link: https://cses.fi/problemset/task/1634
Author: Sachin Srivastava (mrsac7)
*/
#include<bits/stdc++.h>
using namespace std;
template<typename... T>
void see(T&... args) { ((cin >> args), ...);}
template<typename... T>
void put(T&&... args) { ((cout << args << " "), ...);}
tem... | ALGO | 0.99992 | 4.444988 |
f3b48150-5046-43a5-b259-10b37b776b4c | jackiehluo/practice | codeforces/200s/230a-dragons.cpp | #include <iostream>
#include <map>
using namespace std;
int main()
{
int s, n, x, y;
map<int, int> d;
bool alive = true;
cin >> s >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y;
if(d.find(x) == d.end())
d[x] = y;
else
d[x] += y;
}
for(... | ALGO | 0.999956 | 3.688612 |
8922ccc5-3af1-4026-83d4-fccec06f8add | muzee99/BOJ | BOJ11279.cpp | // BOJ11279_최대 힙
#include <iostream>
#include <queue>
using namespace std;
int N;
priority_queue<int, vector<int>, less<int>> q;
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
cin >> N;
for(int i=0; i<N; i++) {
int x;
cin >> x;
if(x) q.push(x);
else if(q.empty()... | ALGO | 0.999993 | 4.390865 |
d1b36ead-d0d2-4b9c-ba23-e1f75b829430 | Skyaducc/DTQG-2021-2022 | CODE/A.volleyball/A.cpp | // d(i) : quãng đường ngắn nhất giao từ cửa hàng i tới khu dân cư
#include <iostream>
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<long long , int>
#define endl '\n'
#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 MASK(i) (1LL... | ALGO | 0.999917 | 3.96796 |
31eda18e-e8ea-4b1d-86ed-da888107a856 | GitHatake/get_torque_realtime | tatsushi/eigen-3.4.0/eigen-3.4.0/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.998369 | 5.816968 |
e5ede902-140d-4e44-869b-9d9fb35752bd | jixuanlu/CS438 | mp4/src/csma.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <random>
#include <fstream>
#include <iomanip>
using namespace std;
// #define _DEBUG
default_random_engine gen;
typedef struct {
int c... | ALGO | 0.997489 | 3.515316 |
860d9cf3-988f-467d-b18c-19bed0b4c720 | zhuanggengzhen/cpp-primer | chapter10/ex10_11.cpp | #include <vector>
#include <algorithm>
#include <string>
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::string;
void elimDups(vector<string> &);
bool isShorter(const string &, const string &);
int main()
{
vector<string> vs;
string str;
while(cin >> str)
vs.pu... | ALGO | 0.99996 | 5.069473 |
fe56d61c-ccec-45e1-9e5f-100d463f6389 | SpartanCoder0117/Algorithms | Problemas de cadenas/Problema2.cpp | #include <bits/stdc++.h>
using namespace std;
int TBL[1000002];
void KMTBL(string &stri)
{
int i = 0, j = -1, m = stri.size();
TBL[0] = -1;
while(i < m)
{
while(j >= 0 && stri[i] != stri[j])
j = TBL[j];
TBL[++i] = ++j;
}
}
int main()
{
string s;
cin >> s;
... | ALGO | 0.999969 | 3.509767 |
32adb14e-0b31-4ab3-9468-b35877e89fcc | ishandutta2007/codeforces | _twilight/normal/1266/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef bool boolean;
template <typename T>
boolean vmin(T& a, T b) {
return (a > b) ? (a = b, true) : (false);
}
template <typename T>
boolean vmax(T& a, T b) {
return (a < b) ? (a = b, true) : (false);
}
template <typename T>
T smax(T x) {
return x;
}
template <typen... | ALGO | 0.995829 | 3.254922 |
2f8a4f63-e5d3-4c18-b110-2abe98d92512 | joker-eph/llvm-project-with-mlir | llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp | #include "VPlanPredicator.h"
#include "VPlan.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "VPlanPredicator"
using namespace llvm;
// Generate VPInstruction... | ALGO | 0.999806 | 7.193898 |
9d83f2c2-74f5-46c3-95db-afacacedd683 | SagarPrajapati1/gfg_potd2024 | June2024/print_bracket_number.cpp | class Solution {
public:
vector<int> bracketNumbers(string str) {
// Your code goes here
stack<pair<char, int>> st;
vector<int> ans;
int cnt = 0;
for(int i = 0; i < str.length(); i++) {
if(str[i] == '(') {
cnt++;
... | ALGO | 0.998668 | 5.341156 |
b1a5fac8-d51d-444a-89f8-c97df9539450 | cmu-roboarch/rtrbench | perception/03.srec/reconstruct.cpp | #include "reconstruct.h"
#include <algorithm>
#include <vector>
#include "rtrbench_utils.h"
#include "transforms.h"
namespace reconstruct {
void buildLinearSystem(double **srcPoints, double **tarPoints, \
double **tarNormals, int num, double **T, double **A, double *b) {
double **sPointsPrime ... | ALGO | 0.998978 | 5.516146 |
6a80afe6-39f2-41ea-b325-6d7affbdc4f4 | hazzemSaid/Shop | New folder/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.99768 | 6.76775 |
40921cff-e765-422c-8db3-b5b4dc3cbb1e | ZhouWeikuan/zoj | zju.finished/1697.cpp | #include<iostream>
using namespace std;
enum {
SIZ = 6,
};
struct Triangle{
int v[3];
bool use;
};
int sum, e;
Triangle tri[SIZ];
void dfs(int d, int m, int s){
if(d >= 6){
if(m == e && s > sum)
sum = s;
return;
}
int i,j;
for(i=0; i<SIZ; i++){
if(tri[i].u... | ALGO | 0.99896 | 4.002028 |
4641fc6d-f853-4f49-8d2c-339354e9f65d | qt/qtquick3dphysics | src/3rdparty/PhysX/source/common/src/CmRadixSort.cpp | ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "foundation/PxMemory.h"
#include "foundation/PxAssert.h"
#include "CmRadixSort.h"
using namespace physx;
using... | ALGO | 0.999919 | 5.845264 |
5c496656-3c34-49fc-b9b8-681a3d409a14 | AccentureMobilityServices/frameworks_base | media/libstagefright/codecs/amrnb/common/src/pow2.cpp | /*
Filename: /audio/gsm_amr/c/src/pow2.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Updated template. Changed function interface to pass in a
pointer to overflow flag into the function instead of using a
global flag. Rem... | ALGO | 0.998185 | 6.253882 |
a6f0b8d9-7591-43e4-b29e-211c6a9352f9 | sahilmadaan048/crispy-chainsaw-ladders | 1400 to 1499 rating/problem 96(B. Color the Fence)/main.cpp | // https://codeforces.com/problemset/problem/349/B
#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++)
#defin... | ALGO | 0.999865 | 4.312525 |
9009a487-f2c7-4aef-a16a-92ece3ce2d2a | baibolatovads/work | QUIZ 3 Upsolving/f_2.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
freopen ("input.txt", "r", stdin);
string s, line;
cin >> s;
int n = 0;
while(cin >> line){
if(s == line) n++;
}cout << n;
return 0;
} | ALGO | 0.998656 | 3.528268 |
a68a3aa6-7842-44ef-8d88-036832d15a86 | alexandraback/datacollection | solutions_1674486_0/C++/floydfan/solution.cpp | // diamond inheritance.cpp : main project file.
//#include "stdafx.h"
#include<iostream>
#include<queue>
using namespace std;
int arr[1010];
int parents[1010][11];
int main()
{
freopen("test.txt","r",stdin);
freopen("op.txt","w",stdout);
int tests;
scanf("%d",&tests);
for(int l=1;l<=tests;l++)
{
int num;
s... | ALGO | 0.999892 | 3.856216 |
7f9a99c2-b662-4ac7-90f4-ce42f16bab88 | gaohongy/Algorithm-Competition-Code | leetcode/lccup22/a.cpp | class Solution {
public:
int getMinimumTime(vector<int>& t, vector<vector<int>>& f, int l) {
long long sum = 0;
for (int i = 0; i < (int)f.size(); ++i) {
sum += t[f[i][0]] * ((f[i][1] + l - 1) / l);
}
return sum;
}
}; | ALGO | 0.999858 | 6.54524 |
55a99cba-579f-42dd-ae95-faae0a84e9ab | nishant-sachdeva/ml-llvm-tools-iith | llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp | #include "DIEHash.h"
#include "ByteStreamer.h"
#include "DwarfDebug.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DIE.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include "llvm/Su... | TOOL | 0.879583 | 7.881779 |
59f4e8cc-14a0-4700-8b12-983cb88a97be | beinnova/cpp-exercise | Capitolo 5/exe-5.3.cpp | //---------> Esercizio 5-3 : Calcolo del perimetro di un rettangolo data la sua altezza e la larghezze <---------//
#include <iostream>
int altezza; //Altezza del rettangolo
int larghezza; //Larghezza del rettangolo
int perimetro; //Perimetro del rettangolo
int main(){
std::cout << "Inserisci l'altezza del ret... | TOOL | 0.883145 | 3.457678 |
537885f1-e090-4754-8a39-2d531264b4c8 | yplusplus/aabbyy | 20181019/ARRGRAPH.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
using namespace std;
const int N = 55;
int a[N], b[N];
int g[N][N];
bool visit[N];
int n;
void dfs(int u) {
visit[u] = 1;
for (int v = 1; v <= n; v++) {
if (g[a[u]][a[v]] && !visit[v]) {
dfs(v)... | ALGO | 0.999601 | 3.969394 |
9cb4055d-0ab7-4504-a64a-f366ef0e4af9 | Jagrit2703/Questions-Solved | 784-insert-into-a-binary-search-tree/insert-into-a-binary-search-tree.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.999922 | 6.057763 |
906a9f52-ad4f-45a3-b311-c8329f4dd557 | yuehuarulian/Tongji-23-ALP | 第九十周/人名币转大写/人名币转大写C/5-b11-2.cpp | //04 2252941
#include <iostream>
#include <cstdio>
#include <string>
//ɰҪͷļ
using namespace std;
const char chnstr[] = "Ҽ½ƾ"; /* д "" ~ "" ĵطֻȡֵ */
string result; /* result⣬κʽȫֱ */
int main()
{
double a;
long long int z, x;
long long int sy, y, qw, bw, sw, w, q, b, s, yuan, jiao, fen;
cout << "[0-100)֮:" << end... | ALGO | 0.967654 | 3.846845 |
a85c027c-7467-4d6b-9c55-85dd672920a0 | KissTK322/POSN_COM_CAMP_1_65 | Mazu.cpp | #include<bits/stdc++.h>
using namespace std;
stack<char> st;
int main(){
int n; char a;
scanf("%d",&n);
while(n--){
scanf(" %c",&a);
if(!st.empty() && st.top()==a) st.pop();
else st.push(a);
}
printf("%d\n",st.size());
if(st.empty()) printf("empty\n");
else{
w... | ALGO | 0.999731 | 3.714768 |
e0f0ccdb-e592-48e2-b9a0-1415d0edc39f | Pranta-Saha/codeforces-solved | 1108D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;
#define FRO freopen("in.txt","r",stdin);
int main()
{
int n,i,j,t,tcs=0,k,m,u,v;
map<char,int>mp;
mp.insert({'R',0});
mp.insert({'B... | ALGO | 0.999981 | 3.673547 |
45cfd699-625c-423c-a314-a41907303de8 | kristofvl/AdvancedCPP | 11_templates/example11_solution.cpp | /* An example illustration how to calibrate temperature data with transform
and a functor */
#include <iostream>
// Create a functor called 'Calibrate' for calibration of data, using two
// attributes 'scale' and 'offset', which are used to do the calibration
// through the () operator.
class Calibrate {
float... | TOOL | 0.98911 | 6.935118 |
d1daea89-257d-4ebb-abbc-85475c626ae8 | singh-gurkawalbir/LeetCode_Solns | 1171. Remove Zero Sum Consecutive Nodes from Linked List/Sol.cpp | // Intuition
// To approach this problem, we can utilize a hashmap to keep track of the cumulative sum encountered while traversing the linked list. If we encounter
// the same cumulative sum again, it means the subsequence between the current node and the node with the same cumulative sum sums to zero, so we can
// ... | ALGO | 0.999747 | 6.662733 |
13ef8823-3902-4112-a0e7-c1560ef4dff6 | alps-jbnu/ALPS_2020_Summer_Study | SeungWoo/week6/유기농 배추.cpp | #include<iostream>
#include<cstring>
using namespace std;
bool check[50][50]; //
bool chk[50][50]; // 湮
int n, w[50], h[50], cnt[50], coun[50];
void tmp(int x, int y) {
if (chk[x][y] == true) return;
else {
chk[x][y] = true;
if (y != 0 && chk[x][y - 1] == false && check[x][y - 1] == true) tmp(x, y - 1);
... | ALGO | 0.999073 | 3.382881 |
c2c8a620-34e8-4a38-91aa-53731b114a64 | DeepRoboticsLab/Lite3_VMC | src/lite3_basic_sim_pkg/lite3_motion_sdk/lib/eigen3/lapack/cholesky.cpp | #include "lapack_common.h"
#include <Eigen/Cholesky>
// POTRF computes the Cholesky factorization of a real symmetric positive definite matrix A.
EIGEN_LAPACK_FUNC(potrf,(char* uplo, int *n, RealScalar *pa, int *lda, int *info))
{
*info = 0;
if(UPLO(*uplo)==INVALID) *info = -1;
else if(*n<0) ... | ALGO | 0.999458 | 6.004565 |
e4ead9e5-0b1f-4948-99f2-91c19695d8bc | eshohag/leetcode | lcci/17.26.Sparse Similarity/Solution.cpp | using pii = pair<int, int>;
class Solution {
public:
vector<string> computeSimilarities(vector<vector<int>>& docs) {
double eps = 1e-9;
unordered_map<int, vector<int>> d;
for (int i = 0; i < docs.size(); ++i) {
for (int v : docs[i]) {
d[v].push_back(i);
... | ALGO | 0.999368 | 5.70983 |
b699151d-3fc7-4700-91fd-eab0eaf98b99 | reisxd/TizenTubeCobalt | third_party/skia/fuzz/FuzzParsePath.cpp | #include "fuzz/Fuzz.h"
#include "include/core/SkString.h"
#include "include/utils/SkParsePath.h"
#include <stdlib.h>
// Most of this is taken from random_parse_path.cpp and adapted to use the Fuzz
// instead of SKRandom
static const struct Legal {
char fSymbol;
int fScalars;
} gLegal[] = {
{ 'M', 2 },
... | TOOL | 0.862195 | 5.946503 |
7b3fd6ae-585f-414a-beda-f9a5ca3ce0eb | mohitsingh0709/ACC45DAYSOFCODE-2024 | day48-PASSORFAIL.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int n,x,p;
cin>>n>>x>>p;
int temp=n-x;
if(x*3-temp>=p){
cout<<"PASS"<<endl;
} else{
cout<<"FAIL"<<endl;
}
}
return 0;
} | ALGO | 0.991847 | 3.730332 |
cc39c4a1-825c-48f3-beac-41e8beb815ef | Devn913/DSACpp | 12.LinkedList/Q80: MergeTwoSortedLL.cpp | /*
* Merging two sorted Linked List
*/
#include "iostream"
using namespace std;
class Node{
public:
int val;
Node* next;
Node(int value){
val = value;
next = NULL;
}
};
class LinkedList{
public:
Node *head;
Node *tail;
int size;
LinkedList(){
head = tail =NULL;
... | ALGO | 0.999976 | 5.002728 |
5e2bb8c2-c621-4eb6-a57d-e457ee022eee | CaptainToTo/prog5 | prog5.cpp | #include <iostream>
#include <fstream>
#include <getopt.h>
#include <string>
#include <vector>
#include "graph.h"
#include "person.h"
using namespace std;
void help() {
cout << "usage: ./prog5 -d <database> -i <input>" << endl;
}
// https://www.geeksforgeeks.org/split-string-substrings-using-delimiter/
vector<st... | TOOL | 0.895469 | 3.184453 |
2b876dea-2f4c-4dcc-b640-3357e26a0e21 | ishandutta2007/codeforces | hyperbolic/normal/665/A.cpp | #include <stdio.h>
#include <vector>
std::vector< std::pair<int,int> > V;
int main()
{
int a,b,c,d;
int e,f;
scanf("%d%d%d%d",&a,&b,&c,&d);
scanf("%d:%d",&e,&f);
for(int i=300;i<1440;i+=c) V.push_back({i,i+d});
int start = 60*e+f;
if((start-300)%a!=0) start = ((start-300)/a+1)*a + 300;
int end = start + b;
... | ALGO | 0.999306 | 3.405487 |
fe3b667f-a5a9-44f3-809b-d3b0a226990e | lutilipe/competitive-programming | sort/quicksort-pivot-last.cpp | #include <iostream>
#include <vector>
using namespace std;
int partition(vector<int>& nums, int low, int highest) {
int pivot = nums[highest];
int i = low-1;
for (int j = low; j < highest; j++) {
if (pivot >= nums[j]) {
i++;
if (i != j) {
swap(nums[i], nums[... | ALGO | 0.999989 | 5.67749 |
0b0d217c-bf38-4724-a4ed-688d5aeebfa2 | AnamulHoqueSony/Uva-problem-solving- | 11850 Alaska.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int>v1;
int i,n,t;
while(scanf("%d",&n)&&n)
{
for(i=0;i<n;i++)
{
cin>>t;
v1.push_back(t);
}
sort(v1.begin(),v1.end());
t=0;
for(i=0;i<n-1;i++)
{
if(v1[i+1]-v1[i... | ALGO | 0.999198 | 3.44133 |
67a39131-7157-409e-9656-52ce2f4fbe95 | ljy9912/ORB_slam3_ros2 | src/ORB_SLAM3/Thirdparty/eigen-3.4.0/doc/examples/QuickStart_example2_dynamic.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXd m = MatrixXd::Random(3,3);
m = (m + MatrixXd::Constant(3,3,1.2)) * 50;
cout << "m =" << endl << m << endl;
VectorXd v(3);
v << 1, 2, 3;
cout << "m * v =" << endl << m * v << endl;
}
| ALGO | 0.998081 | 3.497552 |
4323a12f-8dbb-4e16-bc07-94bffa227ec3 | Reriiii/marisaoj-practice | level-2/two-pointers/introduction/92.cpp | #include <bits/stdc++.h>
#define NAME ""
#define i32 int
#define i64 int64_t
#define u32 unsigned int
#define u64 unsigned long long
#define ll long long
#define ld long double
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<vector<int>>
#define vec vector
#define fi first
#define se second
#define... | ALGO | 0.999998 | 3.579142 |
54362b4a-a5f0-4bcc-90e5-fcfd63aeb0db | Quest84/PLyF_IC_0802_Jos-_Manuel_RG | 9_Segundas/C++/E9_Functional.cpp | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<range/v3/all.hpp>
using std::cout;
using std::endl;
void printAllNumbersInListFunctional( std::vector<int> numbers );
void printEvenNumbersInListFunctional( std::vector<int> numbers );
void printSquaresOfEvenNumbersInListFunctional( std... | TOOL | 0.854019 | 5.689432 |
28c42d5d-1072-4334-9d8b-6f7fa29a9ecd | aryankumar109/DSA-and-CP | programming/luv calender/october/6 oct cf/C1. Adjust The Presentation (Easy Version).cpp | #include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
#define ll long long
void solve(){
ll n;
cin>>n;
ll m;
cin>>m;
ll q;
cin>>q;
vector<ll>a(n);
for(auto &it:a)cin>>it;
vector<ll>b(m);
for(auto &it:b)cin>>it;
vector<ll> uniqueElements;
... | ALGO | 0.999675 | 4.53927 |
21eddc1b-a3dc-4085-b28a-3dd5c6386bbb | ishandutta2007/codeforces | bench0310/normal/1546/A.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
vector<int> a(n+1,0);
for(int i=1;i<=n;i++) cin >> a[i];
vector<int> b(n+1,0);
fo... | ALGO | 0.999917 | 3.739762 |
5db85cb0-f1fa-4fd1-ba03-d432cc9b4b8c | DKLokeswaran/IPMP | Week 4/LInked List/pairwise_swap.cpp | class Solution
{
public:
Node* pairWiseSwap(struct Node* head)
{
if(!(head&&head->next))
return head;
struct Node* prev=head;
struct Node* cur=head->next;
prev->next=cur->next;
cur->next=prev;
struct Node* new_head=cur;
while(prev->next&&p... | ALGO | 0.999982 | 5.358817 |
3fe0b6a1-e300-453a-bd9d-02ef7a009533 | Plackett/aoc12_2024 | src-cpp/day4.cpp | #include <iostream>
#include <vector>
#include "inputData.h"
int main() {
std::stringstream file = readInputData(4);
std::string line;
std::vector<std::string> map;
int count = 0;
int masCount = 0;
while(std::getline(file,line)) {
map.push_back(line);
}
for (int i = 0; i < map.size(); i++) {
for (in... | ALGO | 0.996878 | 4.44944 |
be1cbf1c-9a50-4c8c-81b4-03f5e4c3f6fe | harigaurav/array_45 | 02.Check Equal Arrays.cpp | //level- EASY
//concept- array based hashing or sorting searching
// using map (0.02 seconds)
class Solution {
public:
bool check(vector<int>& arr1, vector<int>& arr2) {
// code here
if(arr1.size()!=arr2.size()){
return false;
}
map<int,int>mp;
for(int i=0;i<ar... | ALGO | 0.999972 | 5.617017 |
4e2f51dc-5e97-4614-b2ca-39a940e86cb8 | ttvpro007/Porfolio-CPP | Sudoku/FSudokuGenerator.cpp | #include "FSudokuGenerator.h"
std::default_random_engine FSudoku::RandomNumberGenerator;
FSudoku::FSudoku()
{
Initialize();
}
FSudoku::~FSudoku()
{
}
void FSudoku::Initialize()
{
MakeBox();
}
void FSudoku::MakeBox()
{
for (size_t i = 0; i < TABLE_GRID_SIZE; i++)
{
if (i < 9)
Box[i] = '0' + (i + 1);
else... | ALGO | 0.951808 | 4.989376 |
43ece04e-20c2-4a41-a0fa-1ba261ea8634 | sinian666/codes_82_1 | cpp_副本28/chapter_computational_complexity/worst_best_time_complexity.cpp | /**
* File: worst_best_time_complexity.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 生成一个数组,元素为 { 1, 2, ..., n },顺序被打乱 */
vector<int> randomNumbers(int n) {
vector<int> nums(n);
// 生成数组 nums = { 1, 2, 3, ..., n }
for (int i = 0; i < n; i++) {
n... | ALGO | 0.998354 | 5.246295 |
4daae163-268d-475f-b945-9c90da57828c | arafat-hasan/problem-solving | leetcode/Medium/39.combination_sum.cpp | /*
* FILE: 39.combination_sum.cpp
* @author: Arafat Hasan Jenin <opendoor.arafat[at]gmail[dot]com>
* LINK: https://leetcode.com/problems/combination-sum/
* DATE CREATED: 17-02-22 13:46:19 (+06)
* LAST MODIFIED: 17-02-22 16:07:30 (+06)
* VERDICT: Accepetd
*/
class Solution {
public:
vector<vector<int>> combin... | ALGO | 0.999838 | 6.65485 |
57fa6a5a-779c-4052-8855-f64085d1d886 | george-popoiu/infoarena_campion | infoarena_campion/numere_iustin.cpp | #include<fstream>
#include<iostream>
using namespace std;
fstream f("numere.in", ios::in);
int n;
int v[20000];
int main()
{
f>>n;
for(int i=0; i<n; i++) f>>v[i];
int minim = 1001, pozitie;
for(int i=0; i<n; i++)
{
if( v[i]<minim ) minim = v[i], pozitie = i;
}
cout<<"Valoarea mi... | ALGO | 0.999884 | 3.532149 |
b53f16fe-16f0-47f8-9e90-4b476b2bff49 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_9123_6.cpp | #include <bits/stdc++.h>
using namespace std;
vector<pair<int, long double> > v[100];
long double sz[100];
int num[100];
int main() {
int n, m, w;
cin >> n >> w >> m;
long double now = 0, mx = (n * w * 1.0) / m;
int st = 1;
for (int i = 1; i <= m; ++i) sz[i] = 0;
for (int i = 0; i <= n;) {
if (now < 1e-... | ALGO | 0.999829 | 3.745704 |
c940908d-191b-4f4f-9399-adf73e8fe734 | duanwesh/Coding-Questions | sum_sequence.cpp | /*
prepbytes_sumofsequence problem
*/
#include<iostream>
#include<bits/stdc++.h>
#define ll long long
#define mod 1000007
using namespace std;
ll recurforans(ll a);
int32_t main()
{
ll a;
cout<<"Enter the value of N";
cin>>a;
ll b=recurforans(a);
cout<<b;
}
ll recurforans(ll a)
{
if(a==1)
retu... | ALGO | 0.999986 | 4.06834 |
6d77c8be-d54e-4613-89f2-90b251294219 | Rahmadaji18/Strukdat-PBO | Hashing/hashing_map.cpp | #include <iostream>
#include <map>
#include <string>
using namespace std;
map<string, map<string, string> > dataAkun;
// Vigenere Hash Function
string vigenereHash(string password, string key)
{
string hash = "";
for (size_t i = 0; i < password.length(); i++) {
char c = password[i];
char k = ... | TOOL | 0.959489 | 3.652498 |
79fd8340-e304-443f-abbe-8c9d89dd7358 | joelchaconcastillo/CIANNA_Pruebas | CIANNA_Windows_ReleaseV2.1/recomb.cpp | #include "global.h"
#include "MPP.h"
extern int g_crossoverType;
void MPP::dependentCrossover(MPP &i2){
if (g_crossoverType == PAIR_BASED_CROSSOVER){
pairBasedCrossover(i2);
} else if (g_crossoverType == UNIFORM_CROSSOVER){
uniformCrossover(i2);
} else if (g_crossoverType == UNIFORM2_CROSSOVER){
uniform2C... | ALGO | 0.999905 | 3.779086 |
1230b82e-a9ba-4fe5-a292-0491105b588a | ZubinGou/leetcode | HDU/HDU-3342-Legal_or_Not-2.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <map>
// #include <unordered_map> // can't compile on poj
#include <algorithm>
#include <cstring>
#include <climits>
using namespace std;
/*
1. 拓扑排序检测环路
2. 注意重复的边输入
*/
const int MAX_N = 1e3 + 50;
vector<int> adj[MAX_N];
int ind[MAX_N]... | ALGO | 0.999867 | 4.728085 |
e959e7fa-5091-4e5e-8ec3-8262728f8106 | FYSETC/FYSETC-Cheetah-v2 | firmware/Marlin/Marlin/Marlin/src/lcd/menu/menu_bed_corners.cpp | //
// Level Bed Corners menu
//
#include "../../inc/MarlinConfigPre.h"
#if BOTH(HAS_LCD_MENU, LEVEL_BED_CORNERS)
#include "menu_item.h"
#include "../../module/motion.h"
#include "../../module/planner.h"
#if HAS_LEVELING
#include "../../feature/bedlevel/bedlevel.h"
#endif
#ifndef LEVEL_CORNERS_Z_HOP
#define LEV... | TOOL | 0.886124 | 6.267871 |
c7d6154f-9a40-4514-95a0-e55695b29dd2 | Time1ess/MyCodes | CtCI/18.4-Counter Number of 2s/solution.cpp | class Count2 {
public:
int count2sAtDigit(int n, int d) {
int power10 = pow(10, d);
int next_power10 = pow(10, d+1);
int cnt_more_than_power10 = n % power10;
int round_down = n - n % next_power10;
int round_up = round_down + next_power10;
int digit =... | ALGO | 0.999482 | 5.437254 |
c81c69c1-dbed-4d7a-bcaa-198390aad19f | hzhuarry/Competitive-Programming | USACO/Contest/2018-2019/Feb/Silver/paintbarn.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define sz(x) (int)x.size()
#define pf push_front
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define f first
#define s second
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERS... | ALGO | 0.999706 | 4.696079 |
abdf4e86-ec43-4bb6-bfcc-1d45044a96ad | uchihadark/CloneForces-My-Submissions | 1741/B.cpp | #include <bits/stdc++.h>
const long long mod = 1e9 + 7;
#define int long long
#define pi pair<int,int>
#define vi vector<int>
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define TIME cerr <... | ALGO | 0.999875 | 5.040926 |
8a71e903-43c6-4495-aacc-865c8fafd726 | zion4h/ziyuan | opencv-4.7.0/samples/cpp/dis_opticalflow.cpp |
#include "opencv2/core/utility.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/video.hpp"
using namespace std;
using namespace cv;
int main(int argc, char **argv)
{
CommandLineParser parser(argc, argv, "{ @video | vtest.avi | use video as inpu... | ALGO | 0.933007 | 4.780188 |
0fe88b58-33e2-45ed-aed8-3acddae293d9 | johngarrett/llvm-research | libcxx/test/std/algorithms/alg.sorting/alg.min.max/max_init_list_comp.pass.cpp | // UNSUPPORTED: c++98, c++03
// <algorithm>
// template<class T, class Compare>
// T
// max(initializer_list<T> t, Compare comp);
#include <algorithm>
#include <functional>
#include <cassert>
#include "test_macros.h"
int main(int, char**)
{
int i = std::max({2, 3, 1}, std::greater<int>());
assert(i == ... | TEST | 0.989139 | 5.907484 |
f6bd5f78-8c3b-4fc0-9439-c37e7200bccc | JK54/Code | CLRS/ch02/2.1-4.cpp | #include <iostream>
#include <cstring>
int main()
{
char a1[] = "101110010";
char a2[] = "111100001";
int size = strlen(a1) + 2;
char res[size];
char carry = '0';
std::memset(res,'\0',size);
for(int i = size - 3;i >= 0;i--)
{
if(a1[i] == '0')
{
if(a2[i] == '0')
{
if(carry == '0')
res[i + 1]... | ALGO | 0.999956 | 3.465667 |
031e58e6-0744-4651-a1b3-9863e9357199 | sastava007/Tech-Interview-Preparation | GFG/Stack-Queue/Next Smaller Element.cpp | /*
https://www.geeksforgeeks.org/next-smaller-element/
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
int main()
{
IOS;
int t;
cin>>t;
while (t--)
{
int n,i;
... | ALGO | 0.999896 | 4.936767 |
78fbccd9-2707-4f87-aef8-027b9cd2a46b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_12726_15.cpp | #include <bits/stdc++.h>
long long int power(long long int a, long long int n) {
long long int p = 1;
while (n > 0) {
if (n % 2) {
p = p * a;
}
n >>= 1;
a *= a;
}
return p;
}
long long int power(long long int a, long long int n, long long int mod) {
long long int p = 1;
while (n > 0) {... | ALGO | 0.999979 | 4.724914 |
c45916ba-4a46-41f2-95d2-96f897decd47 | RohieOS/platform_frameworks_av | media/libeffects/lvm/lib/Common/src/FO_2I_D16F32Css_LShx_TRC_WRA_01_Init.cpp | /*-------------------------------------------------------------------------*/
#include "BIQUAD.h"
#include "FO_2I_D16F32Css_LShx_TRC_WRA_01_Private.h"
/*-------------------------------------------------------------------------*/
/* FUNCTION: */
/* FO_2I_D... | ALGO | 0.99659 | 5.721498 |
f80b175c-1a37-49a0-9fa7-3f068a6cf468 | abtahi2024/Algorithms_2023 | module1/Adjacency_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n,e;
cin>>n>>e;
int mat[n][n];
memset(mat,0,sizeof(mat));
while(e--)
{
int a,b;
cin>>a>>b;
mat[a][b]=1;
mat[b][a]=1;
}
// for(int i=0;i<n;i++)
// {
// for(int j=0;j<n;j++)
// ... | ALGO | 0.99998 | 4.04551 |
77086d3a-f71f-4e1a-bdab-e4204462f34c | Pranjal-Jamuar/coderArmy | patterns/pattern3.cpp | //
// Created by Pranjal Jamuar on 01/07/25.
//
#include<iostream>
using namespace std;
void pattern3()
{
int rows;
cout << "Enter the number of rows:";
cin >> rows;
cout << "Descending Number Pattern";
cout << endl;
for (int i = 1; i <= rows; i++)
{
for (int j = rows; j >= 1;... | ALGO | 0.999699 | 4.359175 |
876d6d11-3c18-492d-8721-e3a8d0b3cc2a | Mohamed-A-Badr/Algorithms-and-Data-Structures-training---IEEE-CS-ZSB | CS21-Science-Week-7/Chat Online/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define fast_ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_in freopen("input.txt", "r", stdin);
#define file_out freopen("output.txt", "w", stdout);
#define el "\n"
#define mod 1000000007
#define pb push_... | ALGO | 0.999437 | 3.726702 |
e448f56c-c910-4eab-aa8e-730578d99f49 | rabelhmd/LeetCode | 0879-profitable-schemes/0879-profitable-schemes.cpp | class Solution {
public:
int profitableSchemes(int G, int P, vector<int> group, vector<int> profit) {
vector<vector<int>> dp(P + 1, vector<int>(G + 1, 0));
int res = 0, mod = 1e9 + 7;
dp[0][0] = 1;
for (int k = 0; k < group.size(); k++) {
int g = gr... | ALGO | 0.999872 | 5.337931 |
d44631c5-e7e8-4421-9fdd-552b92fd1f4a | Sameer-Pattnaik/leetcode | 0056-merge-intervals/0056-merge-intervals.cpp | class Solution {
public:
vector<vector<int>> merge(vector<vector<int>>& intervals) {
int n=intervals.size();
vector<vector<int>>ans;
sort(intervals.begin(),intervals.end());
for(int i=0;i<n;i++)
{
if(ans.empty() || intervals[i][0]>ans.back()[1])
{
ans... | ALGO | 0.999999 | 6.05864 |
55735623-01e6-4531-9df4-e31f6e63ff6a | Mr-Patty/algorithms-and-data-structures | Seminar/purchase.cpp | #include <iostream>
using namespace std;
int main() {
int n, x, sum = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x;
if (x > sum + 1) break;
sum += x;
}
cout << sum + 1 << endl;
return 0;
} | ALGO | 0.999904 | 3.981458 |
dc409ce3-7c15-4cd7-bec0-c4a004bdb319 | marfy-47/Competitive-Programming | okeee.cpp |
/***
** Author: MD.POLASH ISLAM (PRINCE)
***/
#include<bits/stdc++.h>
using namespace std;
//constants :
const int N = (int) 1e6+5;
const int M = (int) 1e9+5;
const int mod = (int) 1000000007;
const int max_prime = (int) 1e6+3;
const int BLK = (int) 700;
cons... | ALGO | 0.999116 | 3.920609 |
998e12c3-a3fa-4c64-9c0b-642e9d4b594f | onuralcaa/C-Cplus_plus_programming_language | Bubble_sort_sıralama_algoitması.cpp | #include<stdio.h>
#include<stdlib.h>
#include<locale.h>
main()
{
setlocale(LC_ALL , "Turkish");
int N;
int i,j,gecici;
printf("Ka adet eleman ile almak istersiniz : ");
scanf("%d" , &N);
int dizi[N];
for(i=0 ; i<N ; i++)
{
printf("%d. say : ", i+1);
scanf("%d" , &dizi[i]);
}
printf("\nDizinizin elem... | ALGO | 0.999601 | 3.516558 |
2884aa1c-ee93-49d9-ad51-9bc637715bbc | Cnd96/comp | main/knackspack.cpp | #include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int knackPack(int weights[], int values[], int capacity, int noItems)
{
int packData[noItems + 1][capacity + 1];
for (int i = 0; i <= capacity; i++)
{
packData[0][i] = 0;
}
for (int i = 0;... | ALGO | 0.999971 | 4.695433 |
bb70d4c9-e961-4ead-af93-44a8de7a7551 | themathgeek13/jpeg_fpga | jpeg_tb.cpp | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define bufSize 50
#define PI 3.1415926535897932384626
//quantization function for a given quality requirement
//this simply evaluates the quantization matrix, and does not actually
//perform the quantization step in the algorithm
void calc_... | ALGO | 0.994729 | 4.861317 |
51eb4997-2d3e-4cae-ae04-bc4a82a579aa | cportugalz/pucp_gpu | samples/Samples/4_CUDA_Libraries/batchedLabelMarkersAndLabelCompressionNPP/batchedLabelMarkersAndLabelCompressionNPP.cpp | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
#define WINDOWS_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#pragma warning(disable : 4819)
#endif
#include <stdio.h>
#include <string.h>
#include <fstream>
#include <cuda_runtime.h>
#include <helper_cuda.h>
#include <helper_string.h>
... | DATA | 0.853207 | 4.321582 |
2bab96b2-9646-449b-a123-052211662455 | CN-DXTZ/Online-Judge | LeetCode_C++/387_firstUniqChar.cpp | #include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
using namespace std;
class Solution {
public:
int firstUniqChar(string s)
{
int len = s.length();
unordered_map<char, int> dict;
for (char ch : s)
dict[ch]++;
for (int i = 0; i < len; i++)
if (dict[s[i]]==1)
return i;
r... | ALGO | 0.999576 | 5.193405 |
a2dbe5d6-6936-443b-9b1b-334ec900e0ab | JARVIS-ROM/android_frameworks_av | media/libeffects/lvm/lib/Common/src/LVC_MixInSoft_D16C31_SAT.cpp | /**********************************************************************************
INCLUDE FILES
***********************************************************************************/
#include "LVC_Mixer_Private.h"
#include "VectorArithmetic.h"
#include "ScalarArithmetic.h"
/****************************************... | ALGO | 0.994565 | 6.295228 |
3e7afe58-2ee1-4db7-b0de-76c69e87e1e4 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10866_16.cpp | #include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n);
for (int i = 0; i < n; i++) cin >> a[i];
vector<int> ll(n), lr(n);
ll[n - 1] = n - 1;
for (int i = n - 2; i >= 0; i--) {
if (a[i] <= a[i + 1])
ll[i] = ... | ALGO | 0.999995 | 4.368378 |
be94e59d-e8e4-4c6c-b3e4-717f78b1044d | Bungmint/competitiveprogramming | contest/codeforces/1178/1178C.cpp | //#pragma GCC optimize("O3")
//#pragma GCC target("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_... | ALGO | 0.999907 | 5.327847 |
24e3037e-fc38-4838-a1b5-69c22e05fa79 | rajneeshkumar146/pepcoding-Batches | 2019/Sept(91)/lecture_003/l001_pattern.cpp | #include <iostream>
using namespace std;
void mirrorTraingle(int n)
{
int nst = 1;
int nsp = n - 1;
for (int r = 1; r <= n; r++)
{
for (int csp = 1; csp <= nsp; csp++)
{
cout << " ";
}
for (int cst = 1; cst <= nst; cst++)
{
cout << "*";
... | ALGO | 0.999961 | 4.602837 |
6ddf5f07-4dc2-45c6-9be5-8b5f106985aa | Klevtsovskyi/CPPAud | Archive/_CMATH_2022-2023_i/T08_Multidimensional_arrays/t08_05.cpp | #include <iostream>
#include <cstdio>
#define N 25
using namespace std;
void print(double arr[][N], int n) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
cout << arr[i][j] << ends;
}
cout << endl;
}
}
void input(double arr[][N], int n) {
for (int i = 0; i... | ALGO | 0.999738 | 3.434546 |
ca9ad291-cb15-49c5-b0e9-aed0bcb8201b | AryanChaudhary123/Linked_List | insertionattail.cpp | #include<iostream>
using namespace std;
class node{
public:
int data;
node* next;
node(int data){
this->data=data;
this->next=NULL;
}
};
void insertattail(node* &tail,int data){
node* temp=new node(data);
tail->next=temp;
tail=tail->next;
}
void print(node* &tail){
no... | ALGO | 0.997001 | 4.163041 |
2b1f9048-ee20-4cf2-8645-b1ef0a09e63f | phoenixbf/uVRmodel | Plugins/uVEd/Source/uVEd/Public/uGM.cpp | /*
uVR Model open-source UE4 plugin
author: B.Fanini (bruno.fanini__AT__gmail.com)
https://github.com/phoenixbf/uVRmodel
===================================================*/
#include "uGM.h"
AuGM::AuGM(){
_uScaleWorld = 1.0f;
// Defaults to 1x1 meters and 170 cm height
SetPlayAreaExtents(FVector(100.0f, 100... | TOOL | 0.862748 | 4.363129 |
28a238d7-ec2e-4395-a90a-c9f6d77e6a1f | VishalTyagi7011/CPP_Solutions_by_Tyagi | Insertion sort.cpp | #include <iostream>
using namespace std;
int main() {
int arr[]={1,6,8,2,4,6,8,9,3};
int size=sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<size-1;i++)
{
if(arr[i]>arr[i+1])
{
for(int j=i+1;j>=0;j--)
{
if(arr[j]<arr[j-1])
{
int temp=arr[j];
arr[j]=arr[j-1];
... | ALGO | 0.99992 | 3.505209 |
c8252fa3-694c-4fa8-8146-1728a76c619e | CarlosDavidLopezHinojosa/Curso-24-25 | Algorítmica/prácticas/práctica 2/MaterialPractica2/funcionesExtra.cpp | #include "entero.hpp"
int Entero::maxTam() const
{
return tamanoMaximo_;
}
Entero& Entero::operator-(const Entero &e) const
{
// Crear los dos enteros locales
Entero e1 = *this;
Entero e2 = e;
// Comprobamos el tamaño de los enteros y añadimos ceros si es necesario
if (e2.size() > e1.size())
... | ALGO | 0.972067 | 5.296141 |
6feb3210-b214-413a-bfa4-69eacbf7477d | HanochZhu/vts-browser-unity-plugin | externals/browser/externals/geographiclib/geographiclib/examples/example-NormalGravity.cpp | // Example of using the GeographicLib::NormalGravity class
#include <iostream>
#include <exception>
#include <GeographicLib/NormalGravity.hpp>
#include <GeographicLib/Constants.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
NormalGravity grav(Constants::WGS84_a(), Constants::WGS84_... | ALGO | 0.912628 | 7.45323 |
628aac1e-94de-4810-82b0-7a2469474641 | mahim007/Online-Judge | codeforces/B. Wonder Room.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll n,a,b;
ll check(ll z){
ll i,x,y;
for(ll i=1;i*i<=z;i++){
if(z%i==0){
x=i;
y=z/i;
if((x>=a && y>=b)){
cout<<x*y<<"\n";
cout<<x<<" "<<y<<"\n";
retur... | ALGO | 0.999396 | 3.641457 |
333e7201-7438-4c37-b46e-4954e42a961e | MorayCH/X1-Marlin-SKR | Marlin/src/libs/least_squares_fit.cpp | /**
* Least Squares Best Fit by Roxy and Ed Williams
*
* This algorithm is high speed and has a very small code footprint.
* Its results are identical to both the Iterative Least-Squares published
* earlier by Roxy and the QR_SOLVE solution. If used in place of QR_SOLVE
* it saves roughly 10K of program memory. I... | ALGO | 0.998628 | 5.047831 |
1e528840-c64d-4592-b628-63bd85811a4f | chuck8868/QuantLibQt | ql/time/calendars/hungary.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/time/calendars/hungary.hpp>
namespace QuantLib {
Hungary::Hungary() {
// all calendar instances share the same implementation instance
static boost::shared_ptr<Calendar::Impl> impl(new Hungary::Impl);
... | ALGO | 0.866575 | 6.786776 |
a40df424-4fe2-458a-aa9e-d230abe8fce7 | idkim97/Algorithm-Problem | 백준/C++/Greedy/백준1931.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
int start;
int finish;
int res = 1;
vector <pair<int, int>> sc;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
cin >> start >> finish;
sc.push_back({ finish,start });
}
sort(sc.begin(), sc.end());
// ù° ð <= ι° ۽... | ALGO | 0.999982 | 4.413159 |
ed16e699-cca3-4c98-acc4-557dd9e59e84 | redpandamonium/algorithm-engineering | data-reduction/src/desk_reduction.cpp | //
// Created by synis on 2/28/19.
//
#include <util.hpp>
#include "desk_reduction.hpp"
desk_reduction::desk_reduction(graph_unit unit) :
data_reduction_node(unit),
m_set(unit.graph().size_including_inactive()),
m_neighbor_vertex(unit.graph().size_including_inactive(), vertex::invalid_id)
{
}
std::string... | ALGO | 0.987171 | 6.924738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.