uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
1d3e8b90-824e-4809-b5a0-87f9bc06b2e5 | ishandutta2007/codeforces | sergeyrogulenko/normal/452/C.cpp | #pragma comment(linker, "/STACK:60000000")
#define _CRT_SECURE_NO_WARNINGS
#include <bitset>
#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <sstream>
#include <... | ALGO | 0.999919 | 3.239547 |
81aaae54-58e0-44d9-9ce6-026202fb2078 | 1274085042/PointCloudTools | Angle/Estimate_Normals/estimate_normals.cpp | #include <cmath>
#include <string>
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h> //pcd读写
#include <pcl/point_types.h>
#include <pcl/common/common.h>
#include <pcl/filters/filter.h>
#include <pcl/features/normal_3d.h> //法线特征
#include <pcl/features/normal_3d_omp.h>... | DATA | 0.982327 | 4.299244 |
3c8f555d-6528-4746-ad01-68643a251a94 | robertwyb/Computer-graphic-assignments | computer-graphics-meshes/libigl/include/igl/unproject.cpp | #include <Eigen/Dense>
#include <Eigen/LU>
template <
typename Derivedwin,
typename Derivedmodel,
typename Derivedproj,
typename Derivedviewport,
typename Derivedscene>
IGL_INLINE void igl::unproject(
const Eigen::MatrixBase<Derivedwin>& win,
const Eigen::MatrixBase<Derivedmodel>& model,
const Eigen::... | ALGO | 0.922419 | 5.966435 |
6c1c9c41-64ab-4b4e-a8c9-7524d5a32f01 | taleingar/meta | eigen3.2.9/doc/examples/Tutorial_ArrayClass_cwise_other.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
ArrayXf a = ArrayXf::Random(5);
a *= 2;
cout << "a =" << endl
<< a << endl;
cout << "a.abs() =" << endl
<< a.abs() << endl;
cout << "a.abs().sqrt() =" << endl
<< a.abs().sqrt() << endl... | ALGO | 0.980761 | 3.130341 |
c31a0b08-0c1b-4e4c-a372-3e51df103c62 | goodGuyGani/codeabbey_cpp | 12. modulo_and_time_difference.cpp | //https://www.codeabbey.com/index/task_view/modulo-and-time-difference
#include <iostream>
using namespace std;
int main()
{
int size = 0;
cin>>size;
int day1[size], hour1[size], min1[size], sec1[size];
int day2[size], hour2[size], min2[size], sec2[size];
int dayRes[size] = {0}, hourRes[size] = ... | ALGO | 0.99819 | 5.146306 |
fee7f53c-4b98-45ed-b659-afebc0da2940 | vaishu202004/c- | 14-03-e4.cpp | #include <iostream>
int& modifyValue(int &x) {
x *= 2;
return x;
}
int main() {
int num = 5;
std::cout << "Before modification: " << num << std::endl;
modifyValue(num) = 10;
std::cout << "After modification: " << num << std::endl;
return 0;
}
| ALGO | 0.881954 | 5.130258 |
353bbe1f-cb5d-4bb2-9eb7-43bfc06564ab | Hiyabye/Baekjoon | 21xxx/21940.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
void solve(void) {
int n, m; cin >> n >> m;
vector<vector<int>> dist(n, vector<int>(n, 1e9));
while (m--) {
int a, b, t; cin >> a >> b >> t; a--; b--;
dist[a][b] = t;
}
int k; cin >> k;
vector<int> c(k);
for (int i=0;... | ALGO | 0.999996 | 4.151354 |
19658c06-a0d2-49a3-8c84-78eb777b8571 | harsh-panchal-804/LeetCode-Solutions | Triangle.cpp | class Solution {
public:
int minimumTotal(vector<vector<int>>& triangle) {
int rows=triangle.size();
for(int r=rows-2;r>=0;--r){
for(int c=0;c<triangle[r].size();c++){
int down=triangle[r+1][c];
int nxtdown=triangle[r+1][c+1];
triangle[r][c... | ALGO | 0.999981 | 6.275776 |
1eedae7a-9c66-425c-a8a3-5068273e58e3 | Kaminoatowo/Script-SIIC | Quinta/radice_quadrata/Erone/radice1_err.cpp | #include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
#define EPS 0.001
double radice_q(double a, double x1){
if((fabs(x1 - a/x1)/2) >= EPS){
x1 = (x1 + a/x1)/2;
return radice_q(a, x1);
}
else return x1;
}
int main(){
double numero;
cout.precision(15);
... | ALGO | 0.999688 | 3.859437 |
e8d96964-f2e5-4d52-89b3-ae9d892a0fd8 | DRL-CASIA/ICV-book | Chapter_6/decision-making-CarND/CarND-test/src/Eigen-3.3/doc/examples/tut_arithmetic_dot_cross.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
using namespace std;
int main()
{
Vector3d v(1,2,3);
Vector3d w(0,1,2);
cout << "Dot product: " << v.dot(w) << endl;
double dp = v.adjoint()*w; // automatic conversion of the inner product to a scalar
cout << "Dot product via a matrix product... | ALGO | 0.998701 | 4.042919 |
c1cafcaf-b9ed-4a6b-b0bf-3381ec6ca8fb | AdarshGaur/Competitive-Programming | Codeforces/Codeforces Round #716 (Div. 2)/C. Product 1 Modulo N.cpp | // Author : Adarsh Gaur
// #define NDEBUG
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.precision(20);
int n, p=1;
cin >> n;
vector<int> subseq;
for(int i=1; i<n-1; i++){
if( __gcd(n,i) == 1){
p = (p*i)%n;
subseq... | ALGO | 0.999959 | 3.77588 |
424ad7fa-586d-4f84-ae21-7e2a2d3066b8 | Ravikumarjj/LeetCode | removing.duplicate.cpp | class Solution {
public:
string removeDuplicates(string s){
string c=" ";
for(int i=0; i<(int)s.size(); i++){
if( c.size()>0 && c.back() -- s[i]) c.pop_back();
else c.push_back(s[i]);
}
return c;
}
}; | ALGO | 0.999971 | 5.255364 |
082e420f-ddb5-4344-9eb3-fc5b01b3088c | kupian/monte-carlo | boost_1_82_0/libs/fusion/example/performance/inner_product.cpp | #include <boost/array.hpp>
#include <boost/timer.hpp>
#include <boost/fusion/algorithm/iteration/accumulate.hpp>
#include <boost/fusion/algorithm/transformation/transform.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/algorithm/transformation/zip.hpp>
#include <boost/fusion/sequence/intrinsic... | TEST | 0.995079 | 6.233133 |
358000b2-f517-4d36-8bf5-56ce7242a518 | prprprpony/oj | la/3291.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 4e4 + 414;
map<int,int> m;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);
int n;
while ((cin >> n) && n) {
m.clear();
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
++m[a];
}
int... | ALGO | 0.998498 | 3.850542 |
236e6a39-3b29-454a-aee9-595dd145c723 | siddhanttomar2003/CP | Burgers.cpp | #include <iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
cout<<min(a,b)<<endl;
}
return 0;
}
| ALGO | 0.999705 | 5.184776 |
723d39a3-45c0-47ff-b3fc-9176f6f625b5 | ifteda/cs5360-project | src/BoundingBox.cpp | #include <algorithm>
#include "BoundingBox.hpp"
#include "globals.hpp"
BoundingBox::BoundingBox() {}
BoundingBox::BoundingBox(const Vec3 &a, const Vec3 &b) : min(a), max(b) {}
Vec3 BoundingBox::centroid() const
{
return 0.5 * (min + max);
}
bool BoundingBox::intersect(const Ray &ray, double t_min, double t_max... | ALGO | 0.997842 | 7.279158 |
ce25d181-0d72-4144-8c24-2682cb670f3e | sunnnyy04/competitive_programming | C_Make_Them_Equal.cpp | #include <bits/stdc++.h>
using namespace std;
//--------------------------------------------------------------//
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<long long> vl;
typedef vector<vector<long long> > vvl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
t... | ALGO | 0.999767 | 3.693566 |
e85af57b-013a-411d-9afb-aec2db0b7a90 | luqmanarifin/cp | 0-unclassified/happyline.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N];
int main() {
int n;
scanf("%d", &n);
for(int i = 0; i < n; i++) {
scanf("%d", a + i);
a[i] += i;
}
sort(a, a + n);
for(int i = 0; i < n; i++) {
a[i] -= i;
if(i && a[i - 1] > a[i]) {
puts(":(");
ret... | ALGO | 0.999753 | 3.311664 |
875184df-23c3-4543-9dae-0bd17b1d617a | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03620/p03620_num9_parsed.cpp | #include <iostream>
#include <string>
#include <deque>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
string A, B;
cin >> A >> B;
int n = A.length();
deque<int> a(A.begin(), A.end());
vector<int> b(B.begin(), B.end());
int ans = n;
for(int shift = 0; shift < n; s... | ALGO | 0.999915 | 4.123768 |
f7fb4bea-52b1-4326-982d-e1f23a515eea | AayushMaurya/6Companies30Days | Goldman Sachs/Q1.cpp | // Given an array of string, return all groups of string that are anagram
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
ll max(ll x, ll y)
{
return (x>y)?x:y;
}
ll min(ll x, ll y)
{
return (x>y)?y:x;
}
void swap(ll *x, ll *y)
{
ll temp = *x;
*x = *y;
*y ... | ALGO | 0.99999 | 4.537412 |
8770d287-0ff1-4ffc-87c2-2b9bd9918251 | prashobkt/blender | intern/cycles/bvh/bvh_split.cpp | #include "bvh/bvh_split.h"
#include "bvh/bvh_build.h"
#include "bvh/bvh_sort.h"
#include "render/hair.h"
#include "render/mesh.h"
#include "render/object.h"
#include "util/util_algorithm.h"
CCL_NAMESPACE_BEGIN
/* Object Split */
BVHObjectSplit::BVHObjectSplit(BVHBuild *builder,
BVHS... | ALGO | 0.995901 | 7.070201 |
199c7525-b96b-448e-90f0-95596aafcd88 | hma40/Cpp-Competitive-Programming | Codeforces/CCC/500586/B.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
#define add push_back
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define f first
#define s second
#define ... | ALGO | 0.999985 | 4.278042 |
79c7bcb6-5175-4810-9c0f-c45c35c5c27e | jorgedeltoro111/cash_reader_app | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
e9c96fe5-0ee2-47b6-bdc1-9d2207ab2571 | ttnhathuy313/cp-career | Oj.uz/APIO18_duathlon.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 2e5 + 5;
int n, m, tin[N], low[N], dfsTime, biCount, biComp[N], isCut[N], sz[N], res, cutsum[N], subSize[N];
vector <int> adj[N], include[N], near[N];
stack <int> S;
void dfs(int u, int pre) {
tin[u] = low[u] = ++dfsTime;
S.push(u);
... | ALGO | 0.999184 | 4.73654 |
369d01c0-7419-4559-a7ed-427b5a8c1ccb | ishandutta2007/codeforces | rns3/normal/609/B.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, ans, x;
int cnt[30];
int main() {
// freopen("B.in", "r", stdin);
scanf("%d %d", &n, &m);
for (int i = 1; i <= n; i++) scanf("%d", &x), cnt[x]++;
for (int i = 1; i <= m; i++) {
for (int j = i + 1; j <= m; j++) ans += cnt[i] * cnt[j];
}
printf("%d\n", ans);
... | ALGO | 0.999906 | 3.180141 |
a8d523fd-46d2-4076-ae8a-563c198d920c | gongbaochicken/Coding-Practice | C++ Solutions/Binary Search/FirstBadVersion.cpp | //First Bad Version
/*
You are a product manager and currently leading a team to develop a
new product. Unfortunately, the latest version of your product fails
the quality check. Since each version is developed based on the previous
version, all the versions after a bad version are also bad.
Suppose you have n... | ALGO | 0.987668 | 6.581748 |
06630365-9e05-459a-b9f8-262d833833be | AbdMamun1999/xcpc_club | week_thirteen/day_four/A_Happy_Birthday_Polycarp.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
vector<int> v;
int val = 0;
for (int i = 1; i <= 9; i++)
{
val = val * 10 + 1;
for (int j = 1; j <= 9; j++)
{
v.push_back(val * j);
}
}
i... | ALGO | 0.999698 | 5.122503 |
68d8b5b0-4f87-4d1b-9ab0-88fe5bb62d6f | ChandraMohan-Sah/Practice-CPP | 4.Character-Array-and-String/2_string/7_Ternary_operator.cpp | /*
Defanging an IP Address --LeetCode
Input: address = "<IP_ADDRESS>"
Output: "255[.]100[.]50[.]0"
--------------------------------------------
Ternary Operator:
testCondition ? expression1 : expression 2;
(age >= 18) ? printf("Can Vote") : printf("Cannot Vote");
----------------------... | ALGO | 0.860763 | 5.256625 |
15ff39c0-8c8e-4246-9fdf-1cc08e5844f3 | fahimshahriarv1/graphics_C_Codes | midpoinnt.cpp | #include<stdio.h>
#include<graphics.h>
int main()
{
int gd=DETECT,gm;
int c=14;
int xc,yc,R;
printf("Enter center and radius: ");
scanf("%d%d%d",&xc,&yc,&R);
initgraph(&gd,&gm,"");
int x,y;
float di;
di=1-R;
x=0;
y=R;
while(x<y)
{
if(di<0)
{
... | ALGO | 0.963579 | 3.153254 |
f2227a11-99ef-418e-ae84-fbed75e7d34d | Kushaal-k/DSA | Strings/sum-of-digits-of-string-after-convert.cpp | // #LeetCode 1945
#include <iostream>
using namespace std;
int sum(int n) {
int sum = 0;
while (n) {
sum += n % 10;
n /= 10;
}
return sum;
}
int getLucky(string s,int k) {
string s1 = "";
for(int i=0;i<s.length();i++){
... | ALGO | 0.999955 | 4.895965 |
bdde760f-d972-4320-bfa0-5f0dbb1f8bb8 | mohumedsalah/Problem-Solve | sagheeer/Greedy/11520 - Fill the Square.cpp | #include <bits/stdc++.h>
using namespace std;
#define repi(i, j, n) for(int i=(j);i<(int)(n);++i)
#define rln() getchar()
#define rint(n) scanf("%d",&n)
#define rs(n) scanf("%s",n)
#define rc(n) scanf("%c",&n)
#define rf(n) scanf("%lf",&n)
#define rl(n) scanf("%lld",&n)
#define pint(x) printf("%d", x)
#define psp() p... | ALGO | 0.998248 | 3.597205 |
4820836c-40b9-411c-ab38-a9e7f02f7d83 | Y3U18/ollvm-poject | llvm/utils/TableGen/OptEmitter.cpp | #include "OptEmitter.h"
#include "llvm/ADT/Twine.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <cctype>
#include <cstring>
namespace llvm {
// Ordering on Info. The logic should match with the consumer-side function in
// llvm/Option/OptTable.h.
// FIXME: Make this take StringRefs ins... | TOOL | 0.860722 | 7.790418 |
8dc8b4e8-c447-42aa-8c47-c8d3b6c87cc4 | useyourfeelings/cranks-renderer | src/core/texture.cpp | #include "texture.h"
#include "interaction.h"
float Lanczos(float x, float tau) {
x = std::abs(x);
if (x < 1e-5f) return 1;
if (x > 1.f) return 0;
x *= Pi;
float s = std::sin(x * tau) / (x * tau);
float lanczos = std::sin(x) / x;
return s * lanczos;
}
UVMapping2D::UVMapping2D(float su, flo... | ALGO | 0.953718 | 6.363909 |
4e35cbb2-4310-450c-870a-a335662c99ce | Siddharth-kumar-shukla/DSA-Practice-Questions | sorting/bucket_sort.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int k = 10;
cout << ++k << " " << k++ << endl;
return 0;
}
| ALGO | 0.996861 | 4.012521 |
2d9eed93-3358-47b1-94ec-b57bacef253c | FelipeGregue/PI-P006 | determinarQuadrante.cpp | #include <iostream>
using namespace std;
int main() {
float x, y;
cout << "Insira as coordenadas (x, y) do ponto: " << endl;
cin >> x >> y;
string quadrante = (x > 0) ? (y > 0 ? "primeiro" : "quarto") : (y > 0 ? "segundo" : "terceiro");
cout << "O ponto está no " << quadrante << " quadrante." <... | ALGO | 0.996459 | 4.786279 |
26b74651-42a0-4d7b-b8f2-55f69340edeb | Ryann-security/devc | bai 17.cpp | #include<stdio.h>
#include<math.h>
int main(){
int n;
float tong = 0;
printf("vui long nhap so: ");
scanf("%d",&n);
if(n%2==0){
for(int i = 1; i<= n ; i++){
tong=tong+ sqrtf(i);
}
}
else{
for(int i = 1; i<= n ; i+=2){
tong=tong+ sqrtf(i);
}
}
printf("ket qua:%.2f",tong);
}
| ALGO | 0.999851 | 3.231423 |
a786d83f-dcfa-44b4-8e5f-f3f32a01428f | hansolpp/Algorithm | Math/더하기 사이클_1110/1110.cpp | #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
using namespace std;
int sum(int N) {
int newone = N/10 + N%10;
return (N%10)*10 + newone%10;
}
int main() {
int N;
int count = 1;
int temp;
scanf("%d", &N);
temp = sum(N);
while(!(N == temp)) {
temp = sum(temp);
count++;
}
printf... | ALGO | 0.999868 | 4.022345 |
3f92d2fd-b630-4c75-a9e5-c64458649dde | P0L3NARUBA/roblox-2016-source-code | Contribs/Qt/4.8.5/win_VS2012/src/3rdparty/webkit/Source/JavaScriptCore/wtf/SHA1.cpp | // A straightforward SHA-1 implementation based on RFC 3174.
// http://www.ietf.org/rfc/rfc3174.txt
// The names of functions and variables (such as "a", "b", and "f") follow notations in RFC 3174.
#include "config.h"
#include "SHA1.h"
#include "Assertions.h"
#ifndef NDEBUG
#include "StringExtras.h"
#include "text/CS... | ALGO | 0.884797 | 7.624524 |
97305b94-2767-482b-a952-a2abde23a59a | belowlab/pedigree-simulator | dependencies/cranefoot/source/source/familyobject.link.cpp | #include "familyobject.h"
struct MEntry {
int index;
int father;
int mother;
float age;
};
class CompareParent {
public:
bool operator()(const MEntry& mb1, const MEntry& mb2) const {
if(mb1.father < mb2.father) return true;
if(mb1.mother < mb2.mother) return true;
return false;
};
};
cl... | ALGO | 0.99667 | 4.987146 |
18329304-9496-4508-939b-efdddee7ef2a | CAPS-UMU/gem5-21-1-Berti-IPCP | src/systemc/tests/systemc/misc/user_guide/chpt11.1/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999323 | 4.69205 |
24cd8512-00a9-4ed7-9a49-338e1ace43b7 | anishnair95/LetsLearnGit | arr.cpp | #include<iostream>
#include<map>
#include<algorithm>
using namespace std;
int main(){
cout<<"Changes in the branch - Fetch and sync using github" ;
string s;
map<int,string> m;
for(int i = 0;i < 5; i++ ) {
if (i%2==0) {
m[i] = "even";
}
else {
m[i] = "odd";
}
}
for(auto it: m... | ALGO | 0.97565 | 4.137089 |
a3b7f7dd-22f9-4ef9-8c6f-d795a3af42fd | JunNishimura/AtCoder | math-algorithm-book/026.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
double ans = 0.0;
for (int i = 0; i < n; i++) {
ans += 1.0 * n / (n - i) ;
}
printf("%.12lf\n", ans);
} | ALGO | 0.999699 | 3.526984 |
ac3bf3b6-90cc-4922-83ad-0a0ab589e0bf | Kitware/VTK | ThirdParty/libproj/vtklibproj/src/auth.cpp | /* determine latitude from authalic latitude */
#include <math.h>
#include <stddef.h>
#include "proj.h"
#include "proj_internal.h"
# define P00 .33333333333333333333 /* 1 / 3 */
# define P01 .17222222222222222222 /* 31 / 180 */
# define P02 .10257936507936507937 /* 517 / 5040 */
# define P10 .0638888888888... | ALGO | 0.998344 | 5.038429 |
9dc9f1d6-a4e8-428b-a1c5-61d65bcfd9c2 | diana-pure/_Graphics | Plotter/FIT0201ANISUTINA_Plotter/cassinithread.cpp | #include "cassinithread.h"
#include <QMutexLocker>
#include <QColor>
#include <qmath.h>
#include <QDebug>
CassiniThread::CassiniThread(QObject *parent) :
QThread(parent)
{
radius = 0;
envir = QVector<QPoint>();
}
CassiniThread::~CassiniThread(){}
void CassiniThread::run()
{
mutex.lock();
QPoint fo... | ALGO | 0.870082 | 5.060862 |
ec6db6bf-b48d-4e81-8705-f7ac5ffdd939 | pce913/Algorithm | baekjoon/11811.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<iostream>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<tuple>
#include<iomanip>
#include<algorithm>
#include<functional>
#include<cmath>
#include<unordered_set>
#include<unordered_map>
... | ALGO | 0.999777 | 3.465188 |
d0849634-0f1b-4cab-a3e0-d59010eb39c2 | comcon1/scaling-codes | phen-models/ci+/cip-model.cpp | // чувак, попробуй, чтобы морфоген хуярил контрактор в зоне своей экспрессии
// тогда контрактор будет развиваться комплементарно морфогену
// что в целом сделает паттерн более заебись
#include "boost/program_options.hpp"
#include "boost/format.hpp"
#include <iostream>
#include <vector>
using std::vector;
namespace p... | ALGO | 0.872724 | 4.599424 |
4263758b-4a41-48a4-b633-9ca5e80c2b6c | Slashz07/Alpha-Intern-Mentorship-Worksheets | c++/5thWorksheet/multiplicationTables.cpp | // Print the table of ‘n’.Here ‘n’ is an integer which the user will input
#include<iostream>
using namespace std;
int main(){
int num;
cout << "enter the number whose table is to be printed";
cin >> num;
for (int i = 1; i <= 10; i ++)
{
cout << i*num << ' ';
}
return 0;
} | ALGO | 0.988522 | 3.076968 |
c5449558-0070-4a12-b01a-a23d008bd630 | BARDAMRI/3D-Animation | ass1/igl/false_barycentric_subdivision.cpp | #include "verbose.h"
#include <algorithm>
#include <igl/barycenter.h>
template <typename Scalar, typename Index>
IGL_INLINE void igl::false_barycentric_subdivision(
const Eigen::PlainObjectBase<Scalar> & V,
const Eigen::PlainObjectBase<Index> & F,
Eigen::PlainObjectBase<Scalar> & VD,
Eigen::PlainObject... | ALGO | 0.993637 | 6.688528 |
109cd7e6-77fe-45e0-97ad-3829de609855 | ayush9h/DSA-Sheet | Dynamic-Programming/kInverse.cpp | class Solution {
public:
int MOD = 1e9 + 7;
int kInversePairs(int n, int k) {
vector<vector<int>> dp(n + 1,vector<int>(k + 1));
for(int i =0;i<=n;i++)
{
dp[i][0] = 1;
}
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=k;j++)
{
... | ALGO | 0.999954 | 5.806774 |
fe78d90f-1288-423e-88ce-43898288c614 | alittlekitten/AlgorithmStack | Baekjoon/Cpp/Binary_Search/P5_3651_이항계수.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long long m;
long long nCr(long long n, long long r) {
if (r > n) return 0;
if (r > n - r) r = n - r;
long long res = 1;
for (long long i = 0; i < r; ++i) {
res *= (n - i);
res /= (i + 1);
if (res > m || res < 1) return m + 1; /... | ALGO | 0.999941 | 3.739627 |
8ad7fc5a-4b5e-4d45-bc53-b4f456cc0b85 | Rohitwagh0550/Apllication-Programing | program365.cpp | #include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
struct node *prev;
};
typedef struct node NODE;
typedef struct node* PNODE;
class DoublyCLL
{
private:
PNODE first;
PNODE last;
int iCount;
public:
DoublyCLL();
void Displa... | ALGO | 0.999081 | 4.907001 |
a558075d-b550-44ad-ac52-915e3f709338 | Div25singh/Cplus-_Programming | array/smallest_in_array.cpp | #include<iostream>
#include<conio.h>
int small(int [], int);
//selection sort
using namespace std;
int main()
{
int arr[50],n;
cout<<"enter the size of array";
cin>>n;
cout<<"enter the array elements";
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
cout<<"the array is: \n";
for(int i=0; i<n ; i++)
{
cout<<arr[i]<... | ALGO | 0.999291 | 3.03598 |
87334980-918d-45dd-b059-5fc9f4c73fde | Thalisson-Alves/Competitive-Programming | submissions/CodeForces/236/b.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "debug.cpp"
#else
#define dbg(...) 4269
#endif
#define all(x) x.begin(), x.end()
using ll = long long;
ll oo = 1e18;
const vector<pair<int, int>> dir4{{1,0},{-1,0},{0,1},{0,-1}};
map<ll, ll> factors(ll n)
{
map<ll, ll> ans;
for (ll i = 2; ... | ALGO | 0.99992 | 5.507866 |
c0ef236b-229f-4788-aa6a-b867b2ea3beb | UtahMSD/anirudhLath | CS6010/04 - Fifth Week/Day22/mapAndSet/mapAndSet/main.cpp | //
// main.cpp
// mapAndSet
//
// Created by Anirudh Lath on 9/22/21.
//
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <set>
#include <iterator>
#include <map>
#include <string>
using namespace std;
int main(int argc, const char * argv[]) {
string filename = "1.txt";
if( arg... | TOOL | 0.982781 | 5.250779 |
6f64f57f-7acd-401e-9edf-4307840dc6e8 | menew95/CodingTest | 프로그래머스/2/1835. 단체사진 찍기/단체사진 찍기.cpp | #include <string>
#include <vector>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
// 전역 변수를 정의할 경우 함수 내에 초기화 코드를 꼭 작성해주세요.
int solution(int n, vector<string> data) {
int answer = 0;
string _s = "ACFJMNRT";
auto condition = [](string& s, string& condition)
{
... | ALGO | 0.999428 | 4.820231 |
f054e75a-c649-467a-ab44-846047a36647 | zandershah/contest-problems | coci/Jabuke.cpp | #include <algorithm>
#include <cstdio>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <bitset>
#include <stdio.h>
#define pb push_back
#define mp make_p... | ALGO | 0.998783 | 3.819593 |
6d908b74-f5a0-4f22-8f0e-e2b7342176af | MyAmbitious/vscpp | cppeaning/set改变内部数据的排序规则.cpp | #include <set>
#include "../header/header.h"
class MyCompare {
public:
bool operator()(int v1, int v2) { return v1 > v2; }
};
void test01() {
set<int> s1;
s1.insert(10);
s1.insert(40);
s1.insert(20);
s1.insert(30);
s1.insert(50);
//ĬϴС
for (set<int>::iterator it = s1.begin(); it != s1.end(); it++) {
... | TOOL | 0.945085 | 4.287121 |
47f90804-1e4c-49f3-b577-cffa67a823c8 | samek567/ZadaniaAlgorytmiczne | OIG/urzednicy_100pkt_zachlan_na_drzewie.cpp | #include <iostream>
#include <vector>
using namespace std;
int n = 0, wyn = 0, wczytana_liczba = 0;
vector<int> parent;
vector<int> ile_zapas;
vector<bool> czy_lisc;
int main()
{
// O(N), zachlan na drzewie, nie mozna zrobic vectora vectorow krawedzie, bo zamala pamiec.
ios_base::sync_with_stdio(0);
cin.... | ALGO | 0.999813 | 4.068289 |
95d097ba-f24b-4d78-84df-cd6348e5285f | akshit019/DSA | geeksforgeeks/graphs/dijsktra.cpp | #include <bits/stdc++.h>
using namespace std;
vector< pair<int, int> > adj[100];
typedef pair<int, int> ipair;
void dijsktra(int v, int src){
// priority queue to store vertices that are being preprocessed
// min heap using pq
// priority_queue <Type, vector<Type>, ComparisonType > min_heap;
priority_queue< ipai... | ALGO | 0.999932 | 3.887129 |
c6a5d239-8035-4d8a-a380-70e566491495 | lvirgili/programming_challenges | uri/uri1154.cpp | #include <iostream>
#include <cstdio>
using namespace std;
int main() {
int idade;
double total = 0;
int n = 0;
while (cin >> idade, idade >= 0) {
total += idade;
++n;
}
printf("%.2f\n", (double)total/n);
return 0;
}
| ALGO | 0.987849 | 3.120552 |
801025af-3ae8-4beb-8ca2-6bc6c053e723 | twbro54l/Triunghi | Triunghi/Triunghi.cpp | #include "Triunghi.h"
#include <iostream>
using namespace std;
int main() {
unsigned int x, x0, x1, x2, x3, x4, x5;
cin >> x;
x0 = x % 10;
x = x / 10;
x1 = x % 10;
x = x / 10;
x2 = x % 10;
x = x / 10;
x3 = x % 10;
x = x / 10;
x4 = x % 10;
x = x / 10;
x5 = x % 10;
x = x / 10; // x cifra zecilor de ... | ALGO | 0.999695 | 3.495265 |
6e849ae7-af1e-4bdc-8297-986402c9132f | edinakaknjo/CPPvjezba | CPPvjezba/PR1/Z2/main.cpp | //TP 2018/2019: Ispit 1, Zadatak 2
#include <iostream>
#include <vector>
using namespace std;
bool JeLiNul(vector<double>v){
for(int i=0; i<v.size(); i++){
if(v.at(i)!=0) return false;
}
return true;
}
void AnalizaMatrice(vector<vector<double>> mat, vector<int> &nulred, vector<int> &nulkol){
... | ALGO | 0.995931 | 3.719845 |
917a139c-5ce4-475e-8d0e-5ba6db92d8c2 | gafeol/competitive-programming | Contests/NEERC16/J.cpp |
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 102;
const int INF = 0x3f3f3f3f;
typedef long long ll;
typedef pair<ll, ll> pii;
#define fst first
#define snd second
#define pb push_back
int s[MAXN], v[MAXN];
int dp[MAXN][MAXN][MAXN*MAXN];
int sum;
int n;
int ind[MAXN];
bool cmp(int a, int b){
... | ALGO | 0.999988 | 3.501222 |
c924c187-39d5-4bc2-8fe2-953b68442ece | leonardoAnjos16/Competitive-Programming | Other/equivalent.cpp | #include <bits/stdc++.h>
using namespace std;
#define llong long long int
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string S; cin >> S;
int K; cin >> K;
int N = S.size();
llong ans = N;
for (int i = 0; i < N; i++) {
int l = i, r = i + 1, cnt = 0;
whi... | ALGO | 0.999702 | 4.416173 |
066ba91a-787d-4d78-90b6-f3c8ed249912 | Julia-meets-String-Theory/RootCounter | tst/poly88.cpp | #include "include.cpp"
int main(int argc, char* argv[]){
std::string input = "5 16 80 32 16 16 0 1 0 0 0 9 4 0 0 3 2 3 2 4 0 1 1 4 1 3 1 2 1 2 6 20 8 3 5 0 6";
std::vector<std::vector<boost::multiprecision::int128_t>> n_exact_expected =
{{781680888, 366819888, 78164104, 9089200, 533200, 16400, 0},{25196800, ... | TEST | 0.997993 | 3.585673 |
83d1e882-1de6-45f2-9205-cac0631eb72f | YashSaroha/DSA---Love-Babbar | Phase 2/Recursion/lecture 31/power_of_2.cpp | #include<iostream>
using namespace std;
int power(int n)
{
// base case
if(n==0)
return 1;
// recursive relation
return 2 * power(n-1) ;
}
int main()
{
int n;
cin >> n;
int ans = power(n);
cout << ans << endl;
} | ALGO | 0.999922 | 5.085021 |
f5c4af55-3a0a-491b-88e4-cf806e5f4289 | alwinyang91/openCV | opencv-4.7.0/modules/dnn/src/layers/recurrent_layers.cpp | #include "../precomp.hpp"
#include <iostream>
#include <cmath>
#include <opencv2/dnn/shape_utils.hpp>
#ifdef HAVE_CUDA
#include "../cuda4dnn/primitives/recurrent_cells.hpp"
using namespace cv::dnn::cuda4dnn;
#endif
#include "layers_common.hpp"
namespace cv
{
namespace dnn
{
template<typename Dtype>
static void tanh... | ALGO | 0.94595 | 7.58013 |
882fd007-e5be-43b0-8054-61cae78d40cb | bmstu-iu9/refal-5-lambda | autotests/Hash/lookup3.cpp | /*
-------------------------------------------------------------------------------
lookup3.c, by Bob Jenkins, May 2006, Public Domain.
These are functions for producing 32-bit hashes for hash table lookup.
hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
are externally useful functions. Routines... | ALGO | 0.997151 | 6.002968 |
43fcc0e5-12bd-4309-ba64-d6e9f0cad7a9 | 58Tinkal/Leetcode | 2204-find-subsequence-of-length-k-with-the-largest-sum/find-subsequence-of-length-k-with-the-largest-sum.cpp | class Solution {
public:
vector<int> maxSubsequence(vector<int>& nums, int k) {
vector<pair<int, int>> v, v1;
int n = nums.size();
for (int i = 0; i < n; i++) {
v.push_back({nums[i], i});
}
sort(v.begin(), v.end());
for (int i = n - 1; i >= 0 && k > 0; i--... | ALGO | 0.99999 | 5.69131 |
1161b857-ea7a-47d5-91e1-be5e2c0a565c | nqdat2002/My-Source | Luyencode.net/ELECTRC.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAXN = 4005;
const int MAXM = 400005;
struct Edge {
int u, v, w;
bool inline operator < (const Edge &rhs) const {
return w < rhs.w;
}
};
class DSU {
private:
vector<int> pset;
public:... | ALGO | 0.999957 | 4.858033 |
8421c2bd-63d1-4c52-8889-d845357c0f96 | miao-hub/HUST_C | C实验作业第一次/C语言第一次3.2.cpp | #include "stdio.h"
int main()
{
unsigned short x,m,n;
printf("x(ʮ)m(0~15)n(1~16-m):\n");
scanf("%x %hu %hu",&x,&m,&n);
if(m>=0 && m<=15 && n>=1 && n<=(16-m))
{
x=(x>>m)<<(16-n);
printf("%0X",x);
}
else
{
printf("\n");
}
return 0;
}
| ALGO | 0.964182 | 3.598289 |
97475e8e-46ba-4fcd-8e3d-22d1a8b034aa | alihamza792/ProblemC- | Pattern 30.cpp | #include <iostream>
using namespace std;
bool isPronic(int num) {
for (int i = 0; i * (i + 1) <= num; i++) {
if (i * (i + 1) == num) {
return true;
}
}
return false;
}
int main() {
int num;
cout << "Enter an integer: ";
cin >> num;
if (isPronic(num)) {
... | ALGO | 0.992849 | 4.776419 |
6f73cf5f-8a08-4c08-a4a3-09de23341747 | shanPic/CodeOfAcm | 2017训练比赛/七月训练四/1003-pro.cpp | /*
* @FileName: D:\代码与算法\2017训练比赛\七月训练四\1003-pro.cpp
* @Author: Pic
* @Date: 2017-07-30 20:06:39
* @Last Modified time: 2017-07-30 21:00:18
*/
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string.h>
#include <queue>
#include <iomanip>
using namespace std;
double res=0;
int n;double a;
bool fun... | ALGO | 0.995899 | 3.210129 |
323ca702-607b-40c5-9d90-37457f0ae7a5 | Luoyingfeng8/fairseq-NMT | requirements/mosesdecoder-master/moses/TranslationModel/fuzzy-match/create_xml.cpp |
#include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <string>
#include "moses/Util.h"
#include "Alignments.h"
using namespace std;
using namespace Moses;
inline const std::string TrimInternal(const std::string& str, const std::string dropChars = " \t\n\r")
{
std::string res = str;
... | TOOL | 0.984848 | 3.717501 |
6825bba7-1441-4e96-b4ec-aee520646e74 | Sagar7057/fluttertutorial | 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 |
626c4874-74c4-4c22-8d4f-5f0bd9173b0b | bioyoshoo/atcoder | review-contest/ABC240/a.cpp | #include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
int main() {
int a, b; cin >> a >> b;
if (b - a == 1) cout << "Yes" << endl;
else if (abs(a % 10 - b % 10) == 1) cout << "Yes" << endl;
... | ALGO | 0.99995 | 4.780944 |
8441e203-0ac2-4d19-b40f-043859bc44a8 | le-incroyable1-dev/dsa_archive | sar_phod_lo_apna_idhar/cc/ONEORALL.cpp | //author : aurav
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
typedef long long ll;
typedef long double ld;
#define pii pair<ll,ll>
#define vi vector< ll >
#define vvi vector< vi >
#define vpi vector< pii >
#define vvpi... | ALGO | 0.999919 | 4.313033 |
4b44e60f-2962-49de-8ded-8f934f63d002 | yqw1212/fuzztruction-llvm17.0.6 | llvm/lib/Transforms/IPO/Inliner.cpp | #include "llvm/Transforms/IPO/Inliner.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PriorityWorklist.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llv... | TOOL | 0.922363 | 6.651255 |
dbc5e13b-f822-4d08-9ee0-10d83965fd31 | henry4724/ardu_ws | src/ardupilot/libraries/AP_Landing/AP_Landing_Deepstall.cpp | /*
* AP_Landing_Deepstall.cpp - Landing logic handler for ArduPlane for deepstall landings
*/
#include "AP_Landing_config.h"
#if HAL_LANDING_DEEPSTALL_ENABLED
#include "AP_Landing.h"
#include <GCS_MAVLink/GCS.h>
#include <AP_HAL/AP_HAL.h>
#include <SRV_Channel/SRV_Channel.h>
#include <AP_Common/Location.h>
#inc... | CONFIG | 0.908315 | 6.555229 |
44710374-22bf-4b02-9af4-5d9b74c71dd0 | ailovejinx/GSOT3D | dep_libs/pointnet2_ops_lib/pointnet2_ops/_ext-src/src/interpolate.cpp | #include "interpolate.h"
#include "utils.h"
void three_nn_kernel_wrapper(int b, int n, int m, const float *unknown,
const float *known, float *dist2, int *idx);
void three_interpolate_kernel_wrapper(int b, int c, int m, int n,
const float *points, cons... | ALGO | 0.982758 | 6.538733 |
4567c186-81ee-437b-96a4-86ecc4a36cca | AnuraagDev/Leetcode-Solution-By-AnuraagDev | 0440-k-th-smallest-in-lexicographical-order/0440-k-th-smallest-in-lexicographical-order.cpp | class Solution {
public:
int findKthNumber(int n, int k) {
int curr = 1;
--k;
while (k > 0) {
long long step = countSteps(n, curr, curr + 1);
if (step <= k) {
curr++;
k -= step;
} else {
curr *= 10;
... | ALGO | 0.999777 | 7.384615 |
4edc588d-6202-4ef7-bbec-8959264f47e7 | himanshu13196/interviewbit | backtracking/Combinations.cpp | /*Given two integers n and k, return all possible combinations of k numbers out of 1 2 3 ... n.
Make sure the combinations are sorted.
To elaborate,
1. Within every entry, elements should be sorted. [1, 4] is a valid entry while [4, 1] is not.
2. Entries should be sorted within themselves.
Example :
If n = 4 and ... | ALGO | 0.999915 | 5.829232 |
34e268e7-4418-4070-9813-bb1a0b03bdd3 | sarahcrowle/crystalspace | libs/csutil/win32/winprintf.cpp | #include "cssysdef.h"
#include "csgeom/math.h"
#include "csutil/ansiparse.h"
#include "csutil/csstring.h"
#include "csutil/csunicode.h"
#include "csutil/dirtyaccessarray.h"
#include "csutil/snprintf.h"
#include "csutil/sysfunc.h"
#include "csutil/util.h"
#define WIN32_LEAN_AND_MEAN
#include <wincon.h>
#include "csutil... | TOOL | 0.868874 | 5.406003 |
bd5efe43-7fa5-41dd-9a77-519e99a58694 | KhanShaheb34/Solved-OJ-Problems | Codeforces/1027 - A - Palindromic Twist.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int t, n;
string s;
cin>>t;
while(t--){
int f=1;
cin>>n>>s;
for (int i=0; i<(n/2)+1; i++) {
char a=s[i], b=s[n-i-1];
// if((a=='a' && b=='y') || (a=='y' && b=='a') || (a=='b' && b=='z'... | ALGO | 0.999582 | 3.955591 |
998ed51b-4f9b-480f-8788-3b025a063b8e | qPCR4vir/myNana | Nana.Cpp11/source/unicode_bidi.cpp | #include <nana/unicode_bidi.hpp>
namespace nana
{
namespace bidi_charmap
{
enum t{ L, LRE, LRO, R, AL, RLE, RLO,
PDF, EN, ES, ET, AN, CS, NSM, BN,
B, S, WS, ON};
static unsigned char charmap_0x0000_0x00C0[192] = {
BN, BN, BN, BN, BN, BN, BN, BN, BN, S, B, S, WS, B, BN, BN,
BN, BN, BN, BN, BN, B... | CONFIG | 0.985422 | 4.258139 |
7e8f671d-1f94-4eab-a697-0e406f78f725 | CesarEmilioDLM/F_programacion_ZAP1079_24_2 | 024_palindromo/024_palindromo.cpp | #include <iostream>
#include <string>
#include <cctype>
#include <locale>
/**
* Prepara una frase para ser verificada como palíndroma.
* Elimina los espacios y convierte la frase a minúsculas.
* @param frase La frase original que se va a preparar.
* @return La frase preparada sin espacios y en minúsculas.
*/
std:... | ALGO | 0.991491 | 6.864166 |
88711ec7-9326-40ea-ac86-91aef267a013 | ishandutta2007/codeforces | tfg/normal/1641/D.cpp | #include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <cassert>
#include <map>
#include <algorithm>
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
std::unordered_map<unsigned long long, int> f;
int main() {
std::ios_base::sync_with_stdio(false); ... | ALGO | 0.999923 | 4.20242 |
d198c6ad-a137-4b7b-a83f-7d1e239885b4 | pouryashirazian/FemBrain | src/3rdparty/vegafem/integrator/implicitNewmarkSparse.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "matrixIO.h"
#include "performanceCounter.h"
#include "insertRows.h"
#include "implicitNewmarkSparse.h"
ImplicitNewmarkSparse::ImplicitNewmarkSparse(int r, double timestep, SparseMatrix * massMatrix_, ForceModel * forceModel_, int positiveDefiniteSolv... | ALGO | 0.999573 | 5.167689 |
d3f908f6-b795-47ed-bd71-e18e33bd5627 | skandavc18/logic_detector | backend/CDataset/mySqrt/mySqrt_5.cpp | class Solution {
public:
int mySqrt(int x) {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
long long int l=0,r=x,m;
while(l<=r) {
m = l + (r-l)/2;
if(m*m >= x) {
r = m-1;
}
else {
if((m+1)*(m+1) > x ) {
... | ALGO | 0.999968 | 4.807277 |
f5d23482-7358-4d5e-9f5d-b2b25aafa192 | yyehl/Intro_algorithms | chapter-4/4.1-5.cpp | /**
* Filename: 4.1-5.cpp
*
* 题目:线性时间O(n)的最大子数组算法,基于动态规划
*
**/
#include <iostream>
using namespace std;
void find_max_subarray(int arr[], int sz, int* ret)
{
int left, right, sum = 0, max = -10000;
for (int i = 0; i < sz; ++i)
{
if (sum > 0)
{
sum += arr[i];
if (sum > max)
{
max = sum;
... | ALGO | 0.999854 | 4.619151 |
d30cffa0-b47a-4344-8345-6da155f98dd9 | Lakshk25/dsa | Arrays/09_MissingNumber.cpp | #include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int>nums = {3,0,1};
int ans = 0;
for (int num : nums)
{
cout<<num<<" XOR "<<ans;
ans ^= num;
cout<<" = "<<ans<<endl;
}
cout<<"*****"<<endl;
for (int i = 0; i <= nums.size(); i++)
{
... | ALGO | 0.999933 | 3.500251 |
f772caa1-fd46-4b54-a7a9-7e2780bfbd5c | PSampaio-Isel/NETMF-LPC | MicroFrameworkPK_v4_1/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/crypto/modes/cfb128.cpp | #include "cryptlib.h"
#include <openssl/modes.h>
#ifdef OPENSSL_SYS_WINDOWS
#include <string.h>
#include <assert.h>
#endif
#ifndef MODES_DEBUG
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#define STRICT_ALIGNMENT
#if defined(__i386) || defined(__i386__) || \
defined(__x86_64) || defined(__x86_64__) || \
de... | ALGO | 0.987018 | 5.913647 |
4204d655-6051-4221-a37c-4562a86ea407 | Kolesnichenko0/programming-basics | 1 семестр/Lab 4/Лаба 4(1).cpp | //Двійкове представлення числа
#include <iostream>
using namespace std;
void next(unsigned short int a, int counter)
{
cout << "Двiйкове представлення числа: ";
for (int j = counter; j < 16; j++) // цикл буде починатися з counter, щоб не писати 0, кількість яких порахував лічильник
{
cout << (a >> ... | ALGO | 0.998915 | 5.202893 |
cc7fb4fa-8c86-4fea-8da0-d6dbf3c8e4a5 | JosueRR/parallel-concurrent-programming | Tareas/Tarea05/roundabout_sync/src/roundabout.cpp | #include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/random.h>
#include <unistd.h>
#include <vector>
/**
@brief Datos compartidos entre hilos
@param drive_min_delay rango de delay, mínimo
@param drive_max_delay rango de delay, máximo... | TOOL | 0.973736 | 4.882225 |
e9bc42df-69c7-4ac0-b7ef-e39472f576de | sensival/3_1_C | C활용 14주차 코드/14주차 예제 17번.cpp | #include<stdio.h>
#define SIZE 4
void ssSort(int a[], int size);
void SelectionSort(int a[], int size);
void bubbleSort(int a[], int size);
void insertionSort(int a[], int size);
int partition(int a[], int begin, int end);
void quickSort(int a[], int begin, int end);
int main(){
int list[SIZE]={0};
int i, choice;
p... | ALGO | 0.999896 | 3.222522 |
e500697a-d2d7-4d4d-b844-e67faad211a8 | gorbit99/AoC2021 | day11/day11-1.cpp | #include <cstddef>
#include <cstdint>
#include <iostream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
int main() {
std::vector<std::vector<uint64_t>> values;
std::string line;
uint64_t flashes = 0;
while (std::cin >> line) {
std::vector<uint64_t> lineValues;
... | ALGO | 0.999539 | 6.619256 |
328d0557-6960-4177-9a24-ff802f8b47cc | DTPMH/exploration | FUEL/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/stiff_system.cpp | #include <iostream>
#include <fstream>
#include <utility>
#include <boost/numeric/odeint.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
using namespace std;
using namespace boost::numeric::odeint;
namespace phoenix = boost::phoenix;
//[ stiff_system_d... | ALGO | 0.99173 | 5.37862 |
ff55dbc6-7ad8-479a-a939-bd761a294510 | Abdullah-Builds/Data_Structures_And_Algorithms | Queue/Reverse_Queue.cpp | #include<iostream>
#include<queue>
using namespace std;
void reverse(queue<int>&q,int num){
q.push(num);
}
void solve(queue<int>&q){
if( q.empty() ) return;
int num = q.front();
q.pop();
solve(q);
reverse(q,num);
}
int main(){
queue<int>q;
q.push(1);
q.push(2);
q.push(3);
... | ALGO | 0.999978 | 4.441741 |
589a2dad-4619-4168-bb35-02b53a435424 | shhyonn/nwmaleok | c++/Yeva Rapovcyh, rozkład liczb na czynniki pierwsze.cpp | #include <iostream>
using namespace std;
void rozklad(int n) {
for (int k = 2; n > 1; ++k) {
while (n % k == 0) {
cout << k << " ";
n /= k;
}
}
cout << endl;
}
int main() {
int n;
cout << "Podaj liczbe : ";
cin >> n;
cout << "Czynniki pierwsze liczby... | ALGO | 0.999623 | 4.618855 |
c892e89e-bca7-4d9d-8788-a1a4a4986954 | LyTruongsinh/DSA | Data_Structures/Array/array5.cpp | #include <iostream>
#include <vector>
#include <stack>
using namespace std;
class Solution
{
public:
vector<int> plusOne(vector<int> &digits)
{
vector<int> result;
stack<int> s;
int n = 0;
int number = 0;
while (n <= digits.size() - 1)
{
number = numbe... | ALGO | 0.99981 | 6.022611 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.