uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
3e35662f-18aa-4f0f-a23c-89de80963458 | FaiiFaiipuipui/DSA_CEDT1 | ex07e2_iss.cpp | #include <bits/stdc++.h>
using namespace std;
void InSeSum(int currentSum, vector <int> seq, int minUsable, int N, int& howMany)
{
if (minUsable != 0) seq.push_back(minUsable);
currentSum += minUsable;
if (currentSum == N)
{
/*for (int a : seq)
{
cout << a << " ";
}
cout << endl;*/
ho... | ALGO | 0.99997 | 4.354837 |
9697cef6-0eab-4fe4-a140-aac27f7846e3 | JK-Lix/Data_Structure | LeetCode/Tree/104.cpp | /*************************************************************************
> File Name: 104.cpp
> Author: Lix
> Mail: <EMAIL>
> URL: https://github.com/JK-Lix
> Created Time: 2019年
************************************************************************/
/*
* Problem:
*
* Given a binary tree, find its maximum... | ALGO | 0.999095 | 5.9548 |
785fa5a7-ee63-43ee-919e-8e0942f8eb14 | manikanta2901/ubuntu | .history/SRM/elab/OOPS/ExceptionHandling.cpp/RelationalOperators_20200928145929.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int a,b;
cin >> a >> b;
try{
if(a > 0 && b > b){
cout << a << " " <<
}else{
throw(false);
}
}catch(bool){
}
return 0;
} | ALGO | 0.999412 | 3.738491 |
b0488662-2d10-4d7c-bd3c-c63d37d7abc2 | Henrik-Yao/NEUQ-ACM-Solution | week7/邓宇哲/神秘密码.cpp | #include <iostream>
using namespace std;
string bds(string);
string xiang(string);
int point = 0;
int lengths;
string outcome;
main()
{
string compressed;
cin >> compressed;
lengths = compressed.length();
cout << bds(compressed);
}
string bds(string a)
{
string result;//储存表达式的返回值的变量
result += xi... | ALGO | 0.999836 | 4.092368 |
1be7223c-a774-4e60-afeb-7a9284177b7b | julianeisel/blender-archived | source/blender/freestyle/intern/stroke/Operators.cpp | /** \file
* \ingroup freestyle
* \brief Class gathering stroke creation algorithms
*/
#include <algorithm>
#include <stdexcept>
#include "Canvas.h"
#include "CurveIterators.h"
#include "Operators.h"
#include "Stroke.h"
#include "StrokeIterators.h"
#include "BKE_global.h"
namespace Freestyle {
Operators::I1DCont... | ALGO | 0.990411 | 5.247239 |
cae9fb75-9ccf-4a1d-b7e0-26aa6167fb89 | VladDorofeev/Contests | Spring/Is/I3.cpp | #include <iostream>
#include <vector>
#include <deque>
#include <list>
template<typename Container>
typename Container::value_type last3(const Container &cont) {
if (cont.size() < 3) {
throw std::invalid_argument("Container hasn`t 3 nums");
}
typename Container::const_reverse_iterator iter = c... | ALGO | 0.978833 | 5.853231 |
2d9e5747-f898-45dd-a1f8-4489d7babcf2 | su-hyunieee/vs_code_copy | codility__Naver/sus.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <set>
using namespace std;
// score : one hundred~~
int solution(vector<int> &A)
{
// write your code in C++14 (g++ 6.2.0)
set<int> s;
long n = A.size();
long ret = 0;
long sum = (n + 1) * n / 2;
sort(A.... | ALGO | 0.999929 | 4.677722 |
8150cbcb-acb4-4b52-a9a4-0db767e73557 | youssefBlm/GrapheAlgo | projet Graphe/graphe.cpp | #include "graphe.h"
#include "liste.h"
#include "grapheOV.h"
#include "grapheNOV.h"
#include "grapheNONV.h"
#include "grapheONV.h"
#include "QPaintEvent"
graphe::graphe() : d_fs(NULL), d_aps(NULL)
{ }
graphe::graphe(int *fs, int *aps) : d_fs(NULL), d_aps(NULL)
{
if(fs == NULL || aps == NULL)
return ;
... | ALGO | 0.885566 | 3.20577 |
dbeabd51-3614-49ee-b66c-199aadee9f76 | reona-inamura/- | pp/kadai_1_1_reona_inamura.cpp | #include<iostream>
#include<cmath>
#include<random>
#include<vector>
using namespace std;
/*double unirand(){
random_device rd;
mt19937 mt(rd());
uniform_real_distribution<double> dist(0,1);
return dist(mt);
}
double exprand(double lamda){
double x = -1 / lamda * log(unirand());
return x;
}
vect... | ALGO | 0.999093 | 3.675007 |
ee54a666-a709-44f2-9cdd-22637ba9ea93 | khaledgabr77/cpp_udacity_nanodegree | cpp_practice/1-Foundation/3-A*search/10-EpandTheA*SearchNeighbors/main.cpp | #include <algorithm> // for sort
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using std::cout;
using std::ifstream;
using std::istringstream;
using std::sort;
using std::string;
using std::vector;
using std::abs;
enum class State {kEmpty, kObstacle, kClosed, kPath};
/... | ALGO | 0.99986 | 5.888322 |
14ea5670-8417-4b58-9034-910ba915620f | batsalee/Baekjoon_Programmers | 프로그래머스/0/120911. 문자열 정렬하기 (2)/문자열 정렬하기 (2).cpp | #include <string>
#include <algorithm>
std::string solution(std::string my_string) {
transform(my_string.begin(), my_string.end(), my_string.begin(), ::tolower);
sort(my_string.begin(), my_string.end());
return my_string;
} | ALGO | 0.999566 | 5.332323 |
10e91d54-0569-4c69-b2c4-bcf04b1b978f | Musa-Mahmoud/Coach_Academy | Level1/sheet_02/I - Rainy Season/main.cpp | /*
#include <iostream>
using namespace std;
int main()
{
unsigned short max_r = 0, counter = 0;
string str;
cin >> str;
for(unsigned short i = 0; i < 3; i++)
{
if('R' == str[i])
counter++;
else
counter = 0;
max_r = (max_r > counter)? max_r ... | ALGO | 0.982362 | 3.564531 |
344ef608-4e84-4996-9b88-cb19c68df16d | ishandutta2007/codeforces | wifiiii/normal/1684/G.cpp | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
template<typename T>
struct dinic {
struct edge {
int v, nxt;
T f, c;
};
vector<edge> es;
vector<int> head, cur, d;
int n, tot;
const T inf = numeric_limits<T>::max();
dinic(int n):n(n) {
cur.resize... | ALGO | 0.999977 | 3.801752 |
8b5277ac-3adc-4214-93a6-f3cc011687f0 | ishandutta2007/codeforces | vercingetorix/normal/1648/A.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <queue>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999898 | 3.023765 |
340b168b-739d-4fa7-b44c-05676f19d60f | Manas1820/ProCodes | Euclidean algorithm/FLOW016.cpp | // https://www.codechef.com/problems/FLOW016
#include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL)
#define lo(n) for(int i=0;i<n;i++)
#define fo(k,n) for(int i=k;i<n;i++)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define si(x) scanf("... | ALGO | 0.999746 | 5.112963 |
06b364be-fdd8-4456-a3e9-ddabb0ad3115 | SA-K1B/Problem-Solving | Notes/set custom sort/setindescending.cpp | #include<bits/stdc++.h>
using namespace std;
#define Max 1000000000
#define Min -1000000000
#define fr(i,n,j) for(i=j;i<n;i++)
#define rfr(i,n,j) for(i=n;i>=j;i--)
#define pi acos(-1.0)
#define vi vector<int>
#define vll vector<ll>
#define ys cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define dbg(x) cout<<#x<<": "<<... | ALGO | 0.999248 | 3.49793 |
daf848b8-2c41-4c58-99b8-d49176cc415c | AviRoy32/XPSC | week 8/Day 4/D_Children_Holiday.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int m, n;
cin >> m >> n;
vector<tuple<int, int, int>> a(n);
for (int i = 0;i < n;i++)
{
int t, z, y;
cin >> t >> z >> y;
a[i] = make_tuple(t, z, y);
}
vector<int> can(n);
auto ok = [&](int mid)
{
... | ALGO | 0.999988 | 3.399014 |
1d21004a-e2b4-4b09-8d71-360b0c34fb05 | PierreBlancfat/cpu_meshing | eigen/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.998725 | 5.98889 |
d0e99d80-3a14-4786-88b8-0a107f24da74 | The-CopyNinja-Kakashi/dsa | 11 kruskal.cpp | #include<bits/stdc++.h>
using namespace std;
class DisjointSet{
vector<int>parent ,size;
public:
DisjointSet(int n){
parent.resize(n);
size.resize(n,1);
for(int i=0 ;i<n ;i++){
parent[i]=i;
}
}
int findUPar(int node){
if(node==parent[node])... | ALGO | 0.999943 | 5.660696 |
f3ed897d-de28-43cb-91c9-45140718bd7b | qiaozishun4/CSP2024_BJ | BJ-Junior/answers/BJ-J01149/explore/explore.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
ll t,tot;
ll n,m,k,sx,sy,d;
bool vis[1050][1050];
char mp[1050][1050];
const int X[]={0,1,0,-1};
const int Y[]={1,0,-1,0};
bool inmap(ll x,ll y){
if(x<1||x>n||y<1||y>m) return 0;
return 1;
}
int main(){
freopen("explore.in","r",stdin);
fr... | ALGO | 0.999768 | 4.047681 |
9128549a-b423-47c1-929a-ce78459840f8 | ddedida/fp-ppb-expense-tracker | 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 |
11ff96c6-0a95-405c-af6b-6dda7a6a22cf | Parthmudgal15105/CP | A_Serval_and_Mocha_s_Array.cpp | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
if (a == 0)
return b;
return gcd(b % a, a);
}
// Function to find gcd of array of
// numbers
int findGCD(int arr[], int n)
{
int result = arr[0];
for (int i = 1; i < n; i++)
{
result = gcd(arr[i], result);
... | ALGO | 0.999978 | 5.152384 |
7153246f-b15b-4e53-81ca-85b0c0a71e2d | Tamimkhan7/CF | previous/V. Comparison.cpp | #include <bits/stdc++.h>
using namespace std;
#define MTK \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define mem(a, b) memset(a, b, sizeof(a))
#define trace(x) cout << #x << ' ' << x << endl
#define all(x) (x).begin(), (x).end()
#define ll int long l... | ALGO | 0.999979 | 3.492125 |
6c104159-b4b1-41d6-891a-07591d2dc3a8 | sonidarshan142/Tops-assignment | SE-module-3/Loop conditional statements/factorial.cpp | //print factorial of given number
#include <stdio.h>
int main()
{
int i, f, num=0;
printf("Input the number : ");
scanf("%d", &num);
for(i = 1; i <= num; i++)
f = f*i;
printf("The Factorial of %d is: %d\n", num, f);
return 0;
}
| ALGO | 0.999837 | 3.346361 |
0d4bdd6e-d1de-49a0-846e-cf57c41fed8b | adityak54/cp | CSES/Trees/Tree_Diameter.cpp |
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define pi pair<int,int>
#define all(n) n.begin(), n.end()
#define rall(n) n.begin(), n.end(), greater<int>()
#define fr(i,a,b,c) for(int i=a;i<b;i+=c)
#define rfr(i,a,b,c) for(int i=a;i>=b;i-=c)
#define pb push_back
// Input Functions
template<t... | ALGO | 0.999204 | 4.831318 |
f447c662-a787-4cba-a79c-dbde18740e91 | YuHuaiCn/HotlineMiami | frameworks/cocos2d-x/tools/simulator/libsimulator/lib/platform/win32/PlayerFileDialogServiceWin.cpp |
#include <string.h>
#include "stdafx.h"
#include <Windowsx.h>
#include <Shlobj.h>
#include <Commdlg.h>
#include "cocos2d.h"
#include "PlayerUtils.h"
#include "PlayerFileDialogServiceWin.h"
PLAYER_NS_BEGIN
PlayerFileDialogServiceWin::PlayerFileDialogServiceWin(HWND hwnd)
: _hwnd(hwnd)
{
}
std::string PlayerFileDia... | TOOL | 0.913521 | 5.752508 |
15e7c427-b267-422e-a348-67aa1b045874 | shirobrak/procon | atcoder/abc136/c.cpp | /**
* C - Build Stairs
* https://atcoder.jp/contests/abc136/tasks/abc136_c
**/
#include<iostream>
using namespace std;
const int MAX_N = 100000;
const int MAX_H = 1000000000;
int N;
int H[MAX_N+1];
bool hoge(int i, int j) {
if(i < 0) {
return true;
}
bool res;
if(H[i] - j <= 0) {
... | ALGO | 0.999973 | 4.279189 |
799293a6-b60f-42e2-99cd-0fa7043f6f64 | AyeshaStg/pd-6 | task3.cpp | #include <iostream>
#include <string>
using namespace std;
string findzodiacsign(int date, string month);
main()
{
int date;
string month;
string symbol;
cout<<"Enter the date of birth: "<<endl;
cin>>date;
cout<<"Enter the month of birth(e.g ,january, Febuary): "<<endl;
cin>>month;
symbol=findzodiacsign(date, month);
... | ALGO | 0.998751 | 4.016386 |
aa5a5cef-329b-4745-8551-9ae3b61bcfcd | amanjha491/Leetcode_Solution | 0900-0999/0994.Rotting Oranges/Solution.cpp | class Solution {
public:
int orangesRotting(vector<vector<int>>& grid) {
int m = grid.size(), n = grid[0].size();
int cnt = 0;
typedef pair<int, int> pii;
queue<pii> q;
for (int i = 0; i < m; ++i) {
for (int j = 0; j < n; ++j) {
if (grid[i][j] == 2... | ALGO | 0.999961 | 6.124527 |
8472c56c-91a0-4763-96fa-d295e2c737af | Ellian-aragao/URI | cpp/media2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main(){
double a = 2, b = 3, c = 5, media = a+b+c;
double aux;
cin >> aux;
a *= aux;
cin >> aux;
b *= aux;
cin >> aux;
c *= aux;
media = (a+b+c) / media;
cout << "MEDIA = " << fixed << setprecision(2) << media << endl;
return 0;
} | ALGO | 0.996895 | 3.640347 |
5fead21a-4cef-4f2c-bdb3-96b5e4c6ea5f | LuckyN510/CODE_PTIT | C/C04034.cpp | #include<stdio.h>
#include<math.h>
int main() {
int t;
scanf("%d",&t);
while(t--) {
int n;
scanf("%d", &n);
int a[n];
for(int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for(int i = 0; i < n; i++) {
int check = 1;
for(int j = i + 1; j < n; j++) {
if(a[i] <= a[j]) {
check = 0;
brea... | ALGO | 0.999883 | 3.160794 |
844f79f4-73f9-467d-abc5-40b89b331a53 | DrWhoFan13/Code-Snippets | C++/rectangle array & array of int.cpp | #include <iostream> #include <iomanip> using namespace std;
class Rectangle {
private:
double length; double width;
public: Rectangle() {
length = 2;
width = 1; }
Rectangle(double newLength, double newWidth) {
length = newLength;
width = newWidth; }
double getArea() {
return length * width; }
double getLength() {
retur... | ALGO | 0.998016 | 4.614719 |
b525845b-8f32-4d3a-b38d-1ec3d5459096 | Pravasta/AirPlane | 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.998841 | 6.783336 |
9d28a1bd-98d3-46d6-b6eb-e871e8224622 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10794_7.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
long long x, y;
int n;
cin >> n >> x >> y >> s;
int i0 = 0, i1 = 0;
char on = 0;
for (auto it = s.begin(); it != s.end(); ++it) {
if (*it != on) {
if (*it == '0') {
++i0;
on = '0';
} else {
++i1;
... | ALGO | 0.999705 | 3.990759 |
8704f316-4aec-4a00-a38b-751b66730489 | alexandraback/datacollection | solutions_5751500831719424_1/C++/wjsw/1ba.cpp | #include <stdio.h>
#include <string.h>
char s[100][101];
int a[100];
int b[100];
int abs(int x) {
return x > 0 ? x : -x;
}
int main() {
freopen("in", "r", stdin);
freopen("out", "w", stdout);
int t;
scanf("%d", &t);
for (int tt = 1; tt <= t; ++tt) {
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
... | ALGO | 0.999664 | 3.616783 |
91e873d3-891e-4ff8-ac6c-2f43f1323d1c | ishandutta2007/codeforces | potassium/normal/1514/D.cpp | #pragma GCC optimize ("O3", "unroll-loops")
// #pragma GCC target ("avx2")
// #pragma comment(linker, "/stack:200000000")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define disti... | ALGO | 0.999929 | 4.706976 |
e9d9a3e8-4d95-478d-9990-1012c660d9bb | StephenMeansMe/textbook_cpp4sci | exercises05/Exercise5-7.cpp | #include <iostream>
#include <cmath>
double CalculatePNorm(int size, double* v, int p = 2);
int main(int argc, char** argv)
{
int n = 3;
double* x = new double [n];
x[0] = 1.0; x[1] = 4.0; x[2] = -7.0;
for(int i = 1; i < 4; i++)
{
double vecpnorm = CalculatePNorm(n, x, i);
std::cout << "Scalar product = "... | ALGO | 0.999147 | 4.66829 |
041a015a-d38a-4e76-8689-0783283895dd | ezyo44/GodotProject | thirdparty/icu4c/common/bytestriebuilder.cpp | #include "unicode/utypes.h"
#include "unicode/bytestrie.h"
#include "unicode/bytestriebuilder.h"
#include "unicode/stringpiece.h"
#include "charstr.h"
#include "cmemory.h"
#include "uhash.h"
#include "uarrsort.h"
#include "uassert.h"
#include "ustr_imp.h"
U_NAMESPACE_BEGIN
/*
* Note: This builder implementation stor... | TOOL | 0.958516 | 7.603553 |
491ec361-a9c6-4c5d-b2c4-4c84172927a6 | ksw51101/Algorithm | Practice/Practice/6-2.cpp | #include <iostream>
using namespace std;
int n = 10;
int arr[10] = { 7, 5, 9, 0, 3, 1, 6, 2, 4, 8 };
int main() {
for (int i = 1; i < n; i++) {
for (int j = i; j > 0; j--) {
if (arr[j] < arr[j - 1])
swap(arr[j], arr[j - 1]);
else
break;
}
}
for (int i = 0; i < n; i++)
cout << arr[i] << ' ';
... | ALGO | 0.999974 | 4.151066 |
ac083e81-3f76-457d-810d-eb17ffe860c9 | sarvex/cpp-leetcode | 0098.Validate 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.99999 | 7.238431 |
c0d31e6f-57de-4ac8-be4a-b0131b972543 | fanfuhan/learnOpencv | 031-060/053-二值图像分析(使用Hu矩实现轮廓匹配).cpp | #include <iostream>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
void contours_info(Mat &image, vector<vector<Point>> &pts);
/*
* 二值图像分析(使用Hu矩实现轮廓匹配)
*/
int main() {
Mat src = imread("../images/abc.png");
Mat src2 = imread("../images/a5.png");
if (src.empty() || src2.empty()) ... | ALGO | 0.996055 | 5.020023 |
b9511b65-4612-40f1-b49a-1c4baf055c4d | LinPr/Search_Engine | test_little_parts/cosSimilarity.cpp | #include <math.h>
#include <vector>
#include <iostream>
double cosSimilarity(std::vector<double> A, std::vector<double>B)
{
if(A.size() == 0 || B.size() == 0)
{
std::cout << "vector A and vector B can't be zero-vector" << std::endl;
exit(-1);
}
if (A.size() != B.size())
{
s... | ALGO | 0.999521 | 4.801794 |
66386996-f65e-403a-b8ea-b02abbc7d35a | carlpitt/leetcode | cpp/1684-count-the-number-of-consistent-strings.cpp | #include <algorithm>
#include <array>
#include <string>
#include <vector>
using uint = unsigned;
class Solution {
public:
[[nodiscard]] constexpr auto countConsistentStrings(
const std::string &allowed,
const std::vector<std::string> &words
) const noexcept -> uint {
... | ALGO | 0.999798 | 6.039454 |
3f96e960-5864-449f-922d-deabec7e7532 | Ketan9548/C--practies | Practies.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> v = {3,42,221,4,53,2,121,53};
int n = v.size();
int smaller = v[0];
for (int i = 0; i < n; i++)
{
if(v[i]<smaller){
smaller = v[i];
}
}
cout<<smaller;
return 0;
} | ALGO | 0.999539 | 3.580362 |
37691cd7-7d66-4732-844d-00c57a99b060 | Shantanu9799/Coding_Ninjas-Problem | FirstAndLastPositionOfAnElementINSortedArray.cpp | #include <bits/stdc++.h>
int firstPosition(vector<int> a, int n, int k) {
int s = 0, e = n-1;
while(s <= e) {
int mid = s + (e-s)/2;
if(a[mid] >= k) {
e = mid - 1;
} else {
s = mid + 1;
}
}
return s;
}
int lastPosition(vector<int> a, int n, int ... | ALGO | 0.999963 | 6.030733 |
dc2a369c-3dd4-4ea4-98d5-fb5ac52fe608 | Sookmyung-Algos/2021algos | algos_assignment/team_pratice/ACM ICPC/AvengersAssemble/10월1주차/9084.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m;
int coin[21], dp[100001] = { 0, };
cin >> n;
for (int i = 1; i <= n; i++) cin >> coin[i];
cin >> m;
dp[0] = 1;
for (int i = 1; i <= n; i++) {
for (int j = coin[i]; j <= m; j++) {
//j원을 coin[i]로 만들 수 ... | ALGO | 0.999985 | 3.870511 |
dd494e98-f1aa-47f9-aa4f-d32cb9858eb6 | nitcse2018/daa-sumi1999 | Graph_Algorithms_Assignment/Codes/PRIM.cpp | #include <stdlib.h>
#include <iostream>
#include <conio.h>
#include <stdio.h>
using namespace std;
struct node
{
int fr, to, cost;
}p[6];
int c = 0, temp1 = 0, temp = 0;
void prims(int *a, int b[][7], int i, int j)
{
a[i] = 1;
while (c < 6)
{
int min = 999;
for (int i = 0; i < 7; i++)
... | ALGO | 0.9998 | 3.106395 |
7133a246-fa59-4fa4-ae19-160b381373e3 | raincross7/code-similarity | codes/train_code/problem443/problem443_111.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
map<int,int> m;
bool ok=1;
for(int i=0;i<n;i++){
int x;
cin >> x;
if(m[x]!=0){
ok=0;
}
m[x]++;
}
if(ok) cout << "YES" << endl;
else cout << "NO" << endl;
}
| ALGO | 0.999986 | 4.029788 |
a7f9bef7-2161-4a25-b3bb-0dd4733cb09c | mrakib007/DSA_WITH_CPP | Problems/Array/Easy/SecondLargestAndSmallest.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> arr(n);
for(int i=0;i<n;i++) cin >> arr[i];
int largest = arr[0];
int second_largest = -1;
int smallest = arr[0];
int second_smallest = INT_MAX;
for(int i=1;i<n;i++){
if(arr[i]>largest){
... | ALGO | 0.999992 | 3.802006 |
34d5dde2-f611-4f77-96e1-e63a04956cbf | boomdabase/skullcoin | src/script/sign.cpp | #include <script/sign.h>
#include <key.h>
#include <policy/policy.h>
#include <primitives/transaction.h>
#include <script/standard.h>
#include <uint256.h>
typedef std::vector<unsigned char> valtype;
MutableTransactionSignatureCreator::MutableTransactionSignatureCreator(const CMutableTransaction* txToIn, unsigned int... | TOOL | 0.919749 | 6.851022 |
62ec8e4d-4157-4dc7-aa77-9fd54aca5f14 | kitsilanosoftware/EAWebKit | WebCore/platform/audio/SincResampler.cpp | #include "config.h"
#if ENABLE(WEB_AUDIO)
#include "SincResampler.h"
#include <wtf/MathExtras.h>
using namespace std;
// Input buffer layout, dividing the total buffer into regions (r0 - r5):
//
// |----------------|----------------------------------------------------------------|----------------|
//
// ... | ALGO | 0.912077 | 7.084173 |
0a6b36d9-6118-4703-9a95-f8717dbf453d | FosterG4/xmrignodevfee | src/base/crypto/Algorithm.cpp | #include "base/crypto/Algorithm.h"
#include "3rdparty/rapidjson/document.h"
#include "base/tools/String.h"
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <map>
#ifdef _MSC_VER
# define strcasecmp _stricmp
#endif
namespace xmrig {
const char *Algorithm::kINVALID = "invalid";
const char *... | TOOL | 0.896114 | 6.608073 |
08efbad2-2e48-4b19-8e52-3b0d53bd8edb | wi-seong-cheol/Algorithm | Backjoon/SJAlgorithm/220102~220108/21313.cpp | //
// main.cpp
// 21313
//
// Created by wi_seong on 2022/01/04.
//
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(NULL);
cin.tie(NULL); cout.tie(NULL);
int N; cin >> N;
bool odd = false;
if(N%2) {
odd = true;
N--;
}
while(N--) {
... | ALGO | 0.999959 | 5.041395 |
494101bc-503d-4893-b82d-4645590fee2b | tlim8772/Train-Network-Simulator | test_state.cpp | #include "state.hpp"
#include <bits/stdc++.h>
using namespace std;
vector<string> station_ids_to_string = {"changi", "tampines", "clementi"};
void test1() {
State s = {'g', 1, 0, 1, 0, 100};
string ans = link_state_to_string(s, station_ids_to_string);
string expected = "g1-changi->tampines";
//cout <<... | ALGO | 0.995437 | 4.545641 |
e66b3aa1-4ab5-49ef-b415-e2ca8151a684 | RahulK4102/LeetCode | 0011-container-with-most-water/0011-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int s = 0;
int e = height.size()-1;
int max = 0;
while(s<e){
int temp = min(height[s],height[e]) * (e-s);
if(max<temp){
max = temp;
}
if(height[s]<height[e]){
... | ALGO | 0.999967 | 6.619016 |
112a804b-50a2-4b6e-a175-e6f4b8b9f7fc | bioyoshoo/atcoder | Boot-camp/Hard-lap2/60.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N;
cin >> N;
vector<vector<int64_t>> table(10, vector<int64_t>(10, 0));
for (int64_t n = 1; n <= N; n++) {
string n_s = to_string(n);
int size = n_s.size();
int head = n_s[0] - '0', tail = n_s[size - 1] - '0';
... | ALGO | 0.999798 | 5.122181 |
d8d6ae63-debc-438b-aa17-407beaa400db | hkcc375/NC501-Networking-Communication | Part_3.cpp | #include <cstdlib>
#include <fstream>
#include <iostream>
#include <queue>
#include <stack>
#include <unordered_map>
#include <utility>
using namespace std;
class LinkStateAlgorithm
{
public:
void build_topology( const string& file_name )
{
// Read from the testfile each link in the form (source, destination... | ALGO | 0.951991 | 4.424192 |
89083544-780a-4e70-96bc-79e1c4751535 | Aleena-01/Programming-Day | pd 09/CS-2023-183-PD09.CPP | //TASK 1
#include<iostream>
using namespace std;
main()
{
int result;
string word;
cout<<"Enter a String: ";
getline(cin,word);
int length=word.length();
int count=0;
for(int i=0;i<length;i++)
{
count++;
}
if(count%2==0)
{
result=1;
}
else
{
result=0;
}
cout<<result;
}
//TASK 2
#include <iostream>
using namespace... | ALGO | 0.970446 | 3.312632 |
f8a25bd2-b2f5-4f43-9855-e5763e2ae2e7 | ManojKumarPatnaik/Sr.SoftwareEngineerInterviewPrep | Miscellaneous/C++/K_Closest_Points_to_Origin.cpp | /*
K Closest Points to Origin
=================================
Problem Statement:
Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k,
Print the k closest points to the origin i.e (0, 0).
The distance between two points on the X-Y plane is the Euclidean distance (i.... | ALGO | 0.999999 | 5.414698 |
3441336c-5b04-4675-b396-ae058022d6d2 | mmbrites/TestingCPP | TestingPointersAndStrings/main.cpp | #include <iostream>
int main() {
int a = 5;
int * pointerToa = &a;
int * * pointerToPointerToa = &pointerToa;
std::cout << "Address of the pointer that points to a pointer that points to a: " << &pointerToPointerToa << std::endl;
std::cout << "Address of the pointer that points to a: " << pointer... | TOOL | 0.927728 | 4.747163 |
ef555763-c17c-4a9b-9faf-ac81698bdbab | GuillermoTafoya/AlgoToolboxSolutions | Advanced Algos - ITESM/Tik Tak Toe/Ejercicio_07/main.cpp | /*
Extend the program written for exercise 5 to use a random heuristic to find the solution.
*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <map>
#include <random>
using namespace std;
void printVector(vector<int> v) {
for (int i = 0; i < v.size(); i+... | ALGO | 0.999918 | 4.706242 |
81c791b0-1b9e-4704-8dc7-4f0e9d1f0172 | GyuJin-Cho/Algorithm | 백준/예상대진표.cpp | #include<iostream>
using namespace std;
int solution(int n, int a, int b)
{
for (int i = 1; i < n; i++)
{
if (a % 2 == 1)
a++;
if (b % 2 == 1)
b++;
a = a / 2;
b = b / 2;
if (a == b)
{
return i;
}
}
}
int main()
{
cout << solution(8, 4, 7);
return 0;
} | ALGO | 0.999911 | 4.232614 |
d84ee5f9-8192-46b1-a408-dc9fe0f6bcee | Simon-Fuhaoyuan/LeetCode-100DAY-Challenge | SpiralMatrix/main.cpp | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> spiralOrder(vector<vector<int> >& matrix) {
vector<int> ans;
int row = matrix.size();
if (row == 0) return ans;
int column = matrix[0].size();
int current_circle = 0;
whi... | ALGO | 0.999973 | 4.867971 |
7819c215-114a-40f5-93da-20d394ed8213 | gaby22v/C | Media aritmetica lsi.CPP | #include <stdio.h>
#include <conio.h>
#include <alloc.h>
#include <string.h>
#include <stdlib.h>
struct lista
{int k;
struct lista *next,*prev;
};
/*struct lista *cons_2inl(int k,struct lista *l)
{ struct lista *aux;
aux=(struct lista *)malloc(sizeof(struct lista));
aux->k=k; aux->next=l;
aux->prev=NULL; l->p... | ALGO | 0.999679 | 4.173823 |
4645379a-de30-4eea-a212-b10a4139bd6d | Skray10/LOVE-BABBAR-450-MASTER | 09_backtracking/08_subset_sum_problem.cpp | /*
link: https://practice.geeksforgeeks.org/problems/subset-sum-problem2014/1
*/
// ----------------------------------------------------------------------------------------------------------------------- //
/*
TC: O(N)
*/
bool solve(int idx, int sum, vector<int>& ans, int arr[], int N) {
// if sum is already less t... | ALGO | 0.999971 | 5.64278 |
3f9fae2c-d48a-4035-ad53-f7d7708b593b | ginnigarg/CodeChef | PermutationExists.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int tc;
cin >> tc;
while(tc--) {
int size;
cin >> size;
int* arr = new int[size];
for(int i = 0; i < size; i++) {
cin >> arr[i];
}
sort(arr, arr + size);
int flag =... | ALGO | 0.999645 | 4.639494 |
ee660b5b-345f-49ac-a2a2-753c7f80c022 | mdfahimrahman22/Programming-Problem-Solving | Toph's Problems/Pie Are Squared.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
double pi=acos(-1);
float input;
cin>>input;
double ans=pi*input*input;
cout<<fixed<<setprecision(10)<<ans<<endl;
return 0;
}
| ALGO | 0.993677 | 3.87696 |
cea334a6-e17d-412e-b496-0fea5a3108c6 | lukaszWroc/rbg_reasoners | src/chess_kingCapture.cpp | #include "reasoner.hpp"
namespace reasoner
{
int game_state::get_current_player(void) const
{
return current_player;
}
int game_state::get_player_score(int player_id) const
{
return variables[player_id-1];
}
bool game_state::apply_any_move(resettable_bitarray_stack&)
{
return false;
}
int game_state::get_mon... | ALGO | 0.997443 | 3.265717 |
08faef9b-5104-4323-b9d7-d1bd7ea3cd53 | ASHD27/algorithmBasic | cpp/BruteForce/BOJ3085_khusw.cpp | /*
BOJ 3085 사탕 게임
https://www.acmicpc.net/problem/3085
봄보니 게임
N*N 행렬이 주어지고 이 행렬에 1*1 크기의 사탕으로 꽉 채워넣는다.
게임 플레이어는 사탕의 색이 다른 인접한 두칸을 고르고, 고른 칸에 들어 있는 사탕을 서로 교환한다.
모두 같은 색으로 이뤄진 행 또는 열 하나를 골라서 그곳에 해당하는 모든 사탕을 다 먹는다.
입력은 사탕이 N*N 행렬로 주어지며, 이때 플레이어가 먹을 수 있는 사탕의 최대 갯수를 구하는 프로그램을 작성해야한다.
N 은 보드... | ALGO | 0.99972 | 5.30677 |
f7ef5fc8-230c-4cfe-b4e8-0607658e7a70 | manankshastri/CarND-Path-Planning-Project | src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple_rowwise.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(4);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,1,2,3;
//add v to each row of m
mat.rowwise() += v.transpose();
std::cout << "Broadcasting result: " << std::... | ALGO | 0.993095 | 4.296038 |
290c5e9d-6014-4ef9-ac3b-1f2b505a53d1 | DZUAV/S2 | libraries/AP_Math/polygon.cpp | #include "AP_Math.h"
/*
* The point in polygon algorithm is based on:
* http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
*/
/*
* Polygon_outside(): test for a point in a polygon
* Input: P = a point,
* V[] = vertex points of a polygon V[n+1] with V[n]=V[0]
* Retu... | ALGO | 0.999406 | 7.596385 |
0b6c2d5c-d2b6-4af3-9203-bdefb85dde52 | namandeep-123/DSA | stack and queue/BalancedParenthesis.cpp | #include <iostream>
using namespace std;
template <typename T>
class Stack
{
T *data;
int index;
int capacity;
public:
Stack()
{
data = new T[4];
capacity = 4;
index = 0;
}
T size()
{
return index;
}
bool isEmpty()
{
return index == 0;... | ALGO | 0.999837 | 4.595923 |
b006d8bd-da24-45ea-8642-60d8253904cd | scott-sihui-wang/LeetCode | 454_4Sum_II.cpp | class Solution {
public:
int fourSumCount(vector<int>& nums1, vector<int>& nums2, vector<int>& nums3, vector<int>& nums4) {
unordered_map<int,int>sum_freq;
for(int i=0;i<nums1.size();i++){
for(int j=0;j<nums2.size();j++){
sum_freq[nums1[i]+nums2[j]]++;
}
... | ALGO | 0.999681 | 6.288565 |
6e28ead1-eaff-4e6c-8cfa-f9a4090c16a4 | mamun4122/My-Online-Judge-Submission | Codeforces/2003-2004 Petrozavodsk Summer Training Camp, Saratov SU Contest - 100975/100975J-Sea Battle.cpp | #pragma comment(linker, "/stack:640000000")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <list>
#include <map... | ALGO | 0.999881 | 3.753789 |
dade9df0-9a40-476a-9189-e25ddf183631 | tiemuhua/EGO | src/uav_simulator/so3_quadrotor_simulator/include/ode/libs/numeric/odeint/examples/heun.cpp | #include <iostream>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
namespace fusion = boost::fusion;
//[ heun_define_coefficients
template< class Value = double >
struct heun_a1 : boost::array<... | ALGO | 0.99986 | 6.92598 |
ca8fb616-5b6c-4727-9a60-45ba9a436664 | yantze/cppprimer-exercise | chapter02/litao/examples/2_3.cpp | // p35 example 2.3
#include <iostream>
using namespace std;
int main() {
unsigned u = 10, u2 = 42;
cout << u2 - u << endl; // 32
cout << u - u2 << endl; // 2**32 - 32 = 4294967264
int i = 10, i2 = 42;
cout << i2 - i << endl; // 32
cout << i - i2 << endl; // 32
cout << i - u << endl; // 0
cout << u - i << endl... | ALGO | 0.99435 | 3.902746 |
7e9dc02b-299f-4a0f-baa0-17acfefad120 | nitishkiitk/DSA | searching/first_and_last_occurances.cpp | vector<int> searchRange(vector<int>& nums, int target) {
int n=nums.size();
int l=0,h=n-1,m=(l+h)/2;
vector<int>result;
int first=-1, last=-1;
// checking first occurance
while(l<=h){
m=(h+l)/2;
if(target>nums[m]){
l=m+1;
}... | ALGO | 0.999986 | 6.080721 |
1527e7e3-fafc-4405-9e4c-f356a2fa850b | cmangos/mangos-tbc | dep/g3dlite/Matrix.cpp | /**
@file Matrix.cpp
@author Morgan McGuire, http://graphics.cs.williams.edu
*/
#include "G3D/Matrix.h"
#include "G3D/TextOutput.h"
static inline G3D::Matrix::T negate(G3D::Matrix::T x) {
return -x;
}
namespace G3D {
int Matrix::debugNumCopyOps = 0;
int Matrix::debugNumAllocOps = 0;
void Matrix::serialize(T... | TOOL | 0.937787 | 7.73564 |
3d0b71f3-11a9-4cf5-baa6-fd48cd990200 | alogeclock/Problem-Solving | BOJ/~Silver/PS 23W/~week 6/[1991] 트리 순회.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAX_NUM ((int)1e6 + 5)
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define PINF ((int)1e9 + 7)
#define ll long long
struct Tree {
char left_child, right_child;
};
map<char, Tree> g;
void preorder(char i) {
cout << i;
if (g[i].left_child != '.') p... | ALGO | 0.999985 | 4.552018 |
fefbb40e-dffe-44bf-98bd-4424c44153c2 | jonayeddewan/MyCodes | Random Problems For '20/G_-_Sum_of_Two_Values.cpp | #include<bits/stdc++.h>
#include<string.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;
c... | ALGO | 0.999899 | 3.895976 |
ce6b2a16-0f71-4549-84e6-d9fec25a11b8 | VeloxChem/VeloxChem | src/t4c_electron_repulsion/ElectronRepulsionContrRecXXGG.cpp | #include "ElectronRepulsionContrRecXXGG.hpp"
#include "TensorComponents.hpp"
namespace erirec { // erirec namespace
auto
comp_ket_hrr_electron_repulsion_xxgg(CSimdArray<double>& cbuffer,
const size_t idx_xxgg,
const size_t ... | ALGO | 0.853502 | 3.187122 |
1533cfe7-599b-4c77-8878-515af3d5386a | yorklephone/android_framework_base | libs/utils/CallStack.cpp | #define LOG_TAG "CallStack"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#if HAVE_DLADDR
#include <dlfcn.h>
#endif
#if HAVE_CXXABI
#include <cxxabi.h>
#endif
#include <unwind.h>
#include <utils/Log.h>
#include <utils/Errors.h>
#include <utils/CallStack.h>
#include <utils/threads.h>
/****************... | TOOL | 0.952783 | 6.975951 |
b5e4bc86-c87f-4767-b4ac-914e3fe3949e | AbdoWael2003/Graduation-Project-QAgent2.0- | FlowChartGeneration/CPPSamples/Sample356/sample_code356.cpp | #include <vector>
#include <algorithm>
#include <iostream>
std::pair<int, int> find_max(const std::vector<std::vector<std::string>>& test_list) {
int res = 0;
for (const auto& i : test_list) {
for (const auto& j : i) {
res = std::max(res, std::stoi(j));
}
}
return {res};
}
| TEST | 0.980992 | 5.97319 |
b676518d-e482-4942-91d9-fcff97771e23 | hjiang13/LLMs-in-IR | POJ-104/45/2658.cpp | #include <iostream>
using namespace std;
int set(char s[50],char w[50])
{
int n1,n2,i,j,sum;
char *p;
n1=strlen(s);
n2=strlen(w);
for (i=0; i<=n2-n1; i++)
{
if (s[0]==w[i])
{
sum=0;
p=&w[i];
for (j=0; j<n1; j++)
if (p[j]==s[j]) sum++;
if(sum==n1)
{
cout << "%d\n",i); i=n2-n1; }
}
}
}
main()
{
char s[50],w[50];
int... | ALGO | 0.999934 | 3.481378 |
c0a3f6c4-ce83-4623-8b19-aa7d2da016ce | ishandutta2007/codeforces | dorost/normal/543/C.cpp | /* * In the name of GOD */
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
const int N = 20, INF = 1000 * 1000 * 1000;
int dp[(1 << N)];
int a[N][N];
string s[N];
vector <pair <int, int>> c;
int32_t main() {
ios::sync_with_stdio(false);... | ALGO | 0.999868 | 3.690824 |
54d9d0f3-7f41-4e96-bef8-da805fad634c | bbruceyuan/algorithms-and-oj | code4interview/c++/面试题51. 数组中的逆序对.cpp | #include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <iostream>
#include <sstream>
#include <unordered_map>
#include<cmath>
#include <set>
using namespace std;
class Solution {
public:
int reversePairs(vector<int>& nums) {
int count{0};
merge_merge(nu... | ALGO | 0.999964 | 5.282112 |
7e740211-34d3-444e-bcbc-9b123934a1b5 | Aman18111625/LeetCode-Solutions | 188-best-time-to-buy-and-sell-stock-iv/188-best-time-to-buy-and-sell-stock-iv.cpp | class Solution {
public:
int maxProfit(int k, vector<int>& prices) {
int n=prices.size();
vector<vector<int>>after(2,vector<int>(k+1,0));
vector<vector<int>>curr(2,vector<int>(k+1,0));
for(int ind=n-1;ind>=0;ind--){
for(int buy=0;buy<=1;buy++){
for(int cap=1;cap<=k;cap++){//for cap=0 already 0
... | ALGO | 0.999798 | 5.840867 |
47a23cf6-8879-4b83-8126-1f663597f81f | ishandutta2007/codeforces | marckess/normal/1493/F.cpp | #include <bits/stdc++.h>
//#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
using namespace std;
typedef long ... | ALGO | 0.99998 | 3.92135 |
2563588b-2c7a-4d88-af76-1e8bedd6ef63 | lenon461/algorithm-study | 58. Length of Last Word/[lenon461]58. Length of Last Word.cpp | class Solution {
public:
int lengthOfLastWord(string s) {
int prev = 0;
int result = 0;
for(int i = 0; i < s.size(); i++){
if(s[i] == ' ') {
if(result != 0) prev = result;
result = 0;
}
else {
re... | ALGO | 0.999704 | 5.439919 |
e3b12d80-0de7-4085-ac03-9e37f8f9370b | akingse/learn_cpp | ProjectCAL/calculateMeshTopology.cpp | #include "pch.h"
using namespace std;
using namespace Eigen;
using namespace games;
using namespace clash;
// interconversion
HeMesh::HeMesh(const ModelMesh& mesh)
{
const std::vector<Eigen::Vector3d>& vbo = mesh.vbo_;
const std::vector<Eigen::Vector3i>& ibo = mesh.ibo_;
m_vertexes.resize(vbo.size());
for (int i =... | ALGO | 0.996985 | 3.80704 |
d266ba22-3cc6-4f82-8046-60c3f890448e | SurajjBhardwaj/linkedlist-from-scrach | circular_linkedlist.cpp | #include <iostream>
using namespace std;
struct Node
{
int data;
struct Node *next;
} *head = NULL;
void create(int A[], int n)
{
head = new Node;
struct Node *p = NULL, *t;
head->data = A[0];
head->next = head;
p = head;
for (int i = 1; i < n; i++)
{
t = new Node;
... | ALGO | 0.999856 | 4.617024 |
f1013d5c-5ae7-4fad-a3f7-a7441ee5a8a9 | Sazid99246/problem-solving | Codechef/SPCP1.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int w, h;
cin >> w >> h;
string result = w >= 60 && h <= 130 ? "YES" : "NO";
cout << result;
return 0;
}
| ALGO | 0.988711 | 3.348088 |
e32f774e-ddb3-4f30-956e-48d6ea9fc140 | lalalalife/algorithm | graph_1/graph_1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int n, m;
int parent[100001];
int findParent(int x)
{
if (parent[x] == x)
return x;
return parent[x] = findParent(parent[x]);
}
void unionParent(int a, int b)
{
a = findParent(a);
b = findPar... | ALGO | 0.999977 | 5.281792 |
9a75c905-addd-4729-aa97-71b72bfcdcf4 | RedBellPepperoni/SaltnPepperOpenGl | SaltnPepperEngine/Externals/msdf-atlas-gen/include/TightAtlasPacker.cpp |
#include "TightAtlasPacker.h"
#include <vector>
#include "Rectangle.h"
#include "rectangle-packing.h"
#include "size-selectors.h"
namespace msdf_atlas {
int TightAtlasPacker::tryPack(GlyphGeometry *glyphs, int count, DimensionsConstraint dimensionsConstraint, int &width, int &height, int padding, double scale, doub... | TOOL | 0.983989 | 7.05093 |
eaaaee84-4b0a-4f3f-b55b-0adac9b8335c | JN513/codigosc- | contest2.cpp/3.cpp | #include <bits/stdc++.h>
#define ll long long int
#define nl endl
#define NMAX 50005
using namespace std;
vector <int> grafo[NMAX];
int n, m, v[NMAX], r;
void dfs(int x){
v[x] = 1;
for(int a: grafo[x]){
if(v[a] == 0){
dfs(a);
}
}
}
int main(void){
cin >> n >> m;
fo... | ALGO | 0.999447 | 5.30605 |
c56e7bdf-58a7-4fe7-9f65-7bf3b0ca50b7 | sammool/Baekjoon-algorithm | Two_Pointer/13144.cpp | #include <iostream>
using namespace std;
int main()
{
int arr[100009];
bool vis[100009];
int n;
cin >> n;
for(int i=0; i<n; i++)
cin >> arr[i];
int en = 0;
long result = 0;
for(int st=0; st<n; st++)
{
while(en < n)
{
if(vis[arr[e... | ALGO | 0.999932 | 3.811236 |
0fbf70a0-5a4d-41d5-9939-c0b3992dbae6 | GustavoSousaPassos/beecrowd | cpp/bc1984.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int d = 0;
long long num;
string nCo, res;
cin >> num;
nCo = to_string(num);
int tam = nCo.size();
res.resize(tam);
for(int i = tam-1; i >= 0; i--)
{
res[d] = nCo[i];
d++;
}
cout << res << endl;
}
| ALGO | 0.999965 | 5.111796 |
b8cf4021-7325-4a1e-a213-4285e1f53802 | limingyao/leetcode | 260.cpp | // Single Number III
class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
int res = 0;
for(int i=0;i<nums.size();++i){
res ^= nums[i];
}
int index = find_first_one(res);
int num = (1<<index);
int num1 = 0;
int num2 = 0;
f... | ALGO | 0.999988 | 5.268763 |
7dc17d6f-84c7-4385-bc3b-aa4346d0d6c2 | hqin-2020/mfrSuiteElacovTest | src/cppCore/eigen/doc/special_examples/Tutorial_sparse_example_details.cpp | #include <Eigen/Sparse>
#include <vector>
#include <QImage>
typedef Eigen::SparseMatrix<double> SpMat; // declares a column-major sparse matrix type of double
typedef Eigen::Triplet<double> T;
void insertCoefficient(int id, int i, int j, double w, std::vector<T>& coeffs,
Eigen::VectorXd& b, con... | ALGO | 0.998772 | 5.391142 |
af39dc0f-8b61-43b9-a36c-ea4051881971 | lxb11/Algorithm | codingInterviews/construct.cpp | #include<iostream>
using namespace std;
typedef struct binarytree_node
{
int data;
binarytree_node *parent;
binarytree_node *left;
binarytree_node *right;
}binarytree_node;
binarytree_node* construct_core(int *start_preorder, int *end_preorder,
int *start_inorder, int *end_inorder)
{
//ǰеĵһǸڵ
int rootdata = st... | ALGO | 0.999987 | 5.0399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.