uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
32cb1011-4a9d-4842-a219-d71fc5e7bcce | Seidy-u/Atcorder | abc301/b.cpp | #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <math.h>
#include <climits>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
for(int i=0... | ALGO | 0.999992 | 3.614663 |
16086cb4-7ad8-45a2-a801-693636f446aa | ishandutta2007/codeforces | pavel.savchenkov/normal/949/C.cpp | #include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fst... | ALGO | 0.999997 | 3.382201 |
8d4fb8de-fe04-4792-9746-a6c55111e0c9 | ishandutta2007/codeforces | hongzy/normal/1334/F.cpp | #include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll;
const int N = 5e5 + 10;
const ll INF = 1e18;
int n, m, a[N], b[N], c[N], pre[N];
ll sum, dp[N], x[N], y[N];
ll bit[N];
void bitadd(int u, ll v) {
for(; u <= n; u += u & (-u)) {
bit[u] += v;
}
}
ll bitqry(int u) {
ll ans = 0;
for(; ... | ALGO | 0.999992 | 3.621078 |
4a1ea91f-c1d2-4466-9863-c47f3966d2b9 | dhuamanilu/programacion | 279/279B.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map <ll,ll> mll;
typedef vector <pair<ll,ll>> vpll;
#define FOR(i, a, b) for (long long i=a; i<(b); i++)
#define FOR1(i, a, b) for (long long i=a... | ALGO | 0.999981 | 5.056512 |
1827163a-a87c-45c2-beb1-a87859479d59 | DineshSirvicodes/Linked-Lists-Solutions | Intersection-of-two-LL-finding-common-Y-LL.cpp | // Brute sol - TC - O(N1*logN) + O(N2*logn) or O(N1*1) + O(N2*1)
//SC - O(N1) or we could stored O(N2) second ll
//using hashing to store the remembering of the node , if found again it is the common point, not found means the ll are not having anything in common
class Solution {
public:
ListNode *getIntersectionNo... | ALGO | 0.999912 | 5.661207 |
ec5f645e-9fe3-4fb3-8371-a10e1f1da05d | satishrdd/comp-coding | spoj/COINS-15790927-src.cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int x[1000000]={0};
long long int solve(long long int n)
{
if (n<12)
return n;
if (n<1000000)
{
if (x[n]!=0)
return x[n];
x[n] = solve(n/2)+solve(n/3)+solve(n/4)... | ALGO | 0.99988 | 3.980208 |
9ca4b08f-9b28-4e70-b956-f9bdce4aca1f | stg0123/baekjoonlearn | convexhull/baekjoon7420.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cmath>
#define PI 3.141592
using namespace std;
typedef long long ll;
struct vec{
int x,y;
};
vec piv;
ll ccw(vec& v1,vec& v2,vec& v3){
return 1LL*(v1.x*v2.y-v1.y*v2.x+v2.x*v3.y-v2.y*v3.x+v3.x*v1.y-v3.y*v1.x);
};
bool compare1... | ALGO | 0.999396 | 3.726095 |
b07a6f93-ba38-488b-9303-d1a233b6c73d | marsman1976/opencv-face_recog | dlib-master/examples/max_cost_assignment_ex.cpp | /*
This simple example shows how to call dlib's optimal linear assignment problem solver.
It is an implementation of the famous Hungarian algorithm and is quite fast, operating in
O(N^3) time.
*/
#include <dlib/optimization/max_cost_assignment.h>
#include <iostream>
using namespace std;
using namespace dlib;
i... | ALGO | 0.999657 | 6.981745 |
90dc98ce-a951-418a-89ec-448829064552 | sniro84/CPP-Exercises | test/histo_test.cpp | /************************************************
EXERCISE : Histo
Implmented by : Snir Holland
Reviewed by : Ido Isaacs
Date : 7/8/23
File : histo_test.c
*************************************************/
#include <iostream>
#include <unordered_map>
#include <queue>
int main()
{
std::un... | ALGO | 0.893351 | 5.053145 |
39187750-c56c-4a4c-9638-022593148fe7 | sosamsony/Leetscode-solutions | 1134-armstrong-number/1134-armstrong-number.cpp | class Solution {
public:
// To find the power of a^m
int findPower(int a, int m) {
if(m == 0) return 1;
else if(m % 2 == 0) return findPower(a, m / 2) * findPower(a, m / 2);
else if(m % 2 == 1) ... | ALGO | 0.999948 | 5.816017 |
005dcb0a-2d18-4094-b5a0-a2e98f815ab6 | HanHanZai/workbean | CPlusPlusThings/practical_exercises/10_day_practice/day8/STL/map_se.cpp | #include<iostream>
#include<string>
#include<map>
using namespace std;
int main(int argc, char const *argv[])
{
string name[]={"","",""};
double salary[]={1200,2000,1450};
map<string,double>sal;
map<string,double>::iterator p;
for(int i=0;i<3;i++){
sal.insert(make_pair(name[i],salary[i]));
... | TOOL | 0.976588 | 3.671454 |
d39a0ac4-2df0-4b38-a5db-b89ff9d6f3e2 | raincross7/code-similarity | codes/train_code/problem087/problem087_382.cpp | #include <cstdio>
using namespace std;
int main(){
int n;unsigned long ans=1;
scanf("%d", &n);
while(n!=1){ans*=n;--n;}
printf("%lu\n",ans);
return 0;
} | ALGO | 0.999998 | 4.343504 |
36897dc4-bccd-4aee-a589-7335194be2cd | TongjiSuperPower/sp_middleware | tools/swerve/swerve.cpp | #include "swerve.hpp"
#include "tools/math_tools/math_tools.hpp"
namespace sp
{
Swerve::Swerve(float wheel_radius, float half_length, float half_width, bool invert_pivot)
: r_(wheel_radius), l_(half_length), w_(half_width), sign_(invert_pivot ? -1.0f : 1.0f)
{
}
void Swerve::init(float yaw_lf, float yaw_lr, float ya... | TOOL | 0.940369 | 5.30125 |
704f46e4-a5da-4da7-8ed2-0105688bb150 | shridharGits/DSA | 30 Days of Code/3-unreachableNo.cpp | #include<bits/stdc++.h>
using namespace std;
int unreachable(int arr[], int n){
sort(arr, arr+n);
int unreachable_no = 1;
for (int i = 0; i < n; i++)
{
if(arr[i]<= unreachable_no){
unreachable_no += arr[i];
}
else{
break;
}
}
return unreac... | ALGO | 0.999913 | 3.831315 |
f226aee1-7097-4877-8380-d71c16f2caf6 | howtobuybitcoincrypto/leetcode-solutions | cpp/0463-island-perimeter.cpp | // Time complexity is O(M*N)
// Space complexity is O(1)
class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
int prem = 0;
for(int i = 0 ; i < m ; i++)
{
for(int j = 0 ; j < n ; j++)
{
... | ALGO | 0.999895 | 6.087574 |
035f15bd-fe95-4a23-b46a-7885db6eaa7e | MaitendoDS/graduaatsproef | UndaTrackerApp/testerapp/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.996925 | 6.76775 |
cf115f93-2e2d-4b95-b126-dae48ce0dde3 | mayank7jha1/March-22 | Lecture 4/continue.cpp | #include<bits/stdc++.h>
using namespace std;
// const int N = 1;
int main() {
// int n;
// cin >> n;
// int x;
// cin >> x;
int n, x;
cin >> n >> x;
for (int i = 1; i < n; i = i + 1) {
if (i == x) {
continue;
}
cout << "Mayank " << i << endl;
}
} | ALGO | 0.999938 | 3.544458 |
fd5cc967-c254-4b56-95bb-20e9a6c7fd5d | yuan-zhou/sage-archive-2023-02-06 | src/sage/rings/bernmm/bern_modp_util.cpp | #include <NTL/ZZ.h>
#include "bern_modp_util.h"
NTL_CLIENT;
namespace bernmm {
long PowerMod(long a, long ee, long n, double ninv)
{
long x, y;
unsigned long e;
if (ee < 0)
e = - ((unsigned long) ee);
else
e = ee;
x = 1;
y = a;
while (e) {
if (e & 1) x = MulMod(x, y, n, ninv... | ALGO | 0.999694 | 5.564995 |
56c2e96c-c604-4eb1-9ebc-1c95673e698d | helium9/DA-Lab | Assignment5/q2.cpp | #include <bits/stdc++.h>
using namespace std;
struct QueueEntry {
int vertex;
int distance;
};
int getMinDiceThrows(int moves[], int N) {
bool* visited = new bool[N]();
queue<QueueEntry> q;
visited[0] = true;
QueueEntry start = { 0, 0 };
q.push(start);
QueueEntry current;
while (!q.empty()) {
current = q.... | ALGO | 0.999815 | 5.044568 |
3f2e790a-c2ea-41da-bbcc-cc3d599280c7 | thunderstorm009/Cp | contest/A. Little Nikita/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--){
int n, m;
cin>>n>>m;
if(n<m){
cout<<"No"<<endl;
continue;
}
int ans = n-m;
if(ans%2==0){
cout<<"Yes\n";
}else{
cout<... | ALGO | 0.999917 | 4.214785 |
a983c8fc-950b-414f-8f84-ae5a68d06d2e | BestBlade/LeetCode_No.43_- | leetcode_no43_字符串相乘_w2.cpp | /* 旋转四角
*
* 执行用时:4 ms, 在所有 C++ 提交中击败了98.59%的用户
* 内存消耗:6.5 MB, 在所有 C++ 提交中击败了78.07%的用户
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
using namespace std;
string multiply(string num1, string num2)
{
if (num1.size() < num2.size())
{
return multiply(num2, num1)... | ALGO | 0.999758 | 5.397482 |
d11dd4b8-0a37-48c2-a590-8770816b5a3b | mosemb/HPC | C_Reprise/CPP/Lesson6/arrayscpp.cpp | #include <stdio.h>
#include <iostream>
int main(void){
int array[5];
printf("Please enter 10 numbers that are integers :\n");
for(int i=0; i<5; i++){
scanf("%d",&array[i]);
}
printf("\n The entered numbers are :\n");
for(int j=0; j<5; j++){
printf("%d \n",array[j]);
}
... | ALGO | 0.999126 | 3.362179 |
d781f975-8463-4028-8b13-2e07e4c14354 | vochi/core-intern-test | effect_sandbox/3rd/opencv/modules/dnn/src/onnx/onnx_graph_simplifier.cpp | #include "../precomp.hpp"
#include "../graph_simplifier.hpp"
#include "onnx_graph_simplifier.hpp"
#include <queue>
namespace cv { namespace dnn {
CV__DNN_INLINE_NS_BEGIN
// This wrapper can behave differently for fake input nodes and real graph nodes.
class ONNXNodeWrapper : public ImportNodeWrapper
{
public:
O... | TOOL | 0.895284 | 7.484519 |
369535b9-f24d-488c-93e3-6bc7a9f30d5b | 0xDigimon/solution-problems | c++/ProblemSolving/A_MahmoudandLongestUncommonSubsequence.cpp | #include<iostream>
using namespace std;
int main(){
string a,b;
cin >> a >> b ;
if(a ==b){
cout<<-1;
}
else {
cout << max(a.size(),b.size()) << endl;
}
return 0;
} | ALGO | 0.999828 | 3.671626 |
acd0e360-d8a9-476d-ba11-44edb7b14e8a | revng/llvm-project | libc/src/math/generic/cosf.cpp | #include "src/math/cosf.h"
#include "sincosf_utils.h"
#include "src/__support/FPUtil/BasicOperations.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/common.h... | ALGO | 0.998841 | 7.516635 |
674fc031-13c8-40a9-9445-7033d2b41766 | MazharRehan/OOP | Object Oriented Programming - Theory/Lec13 Templates STL/Codes/9_practice_template11.cpp | #include<iostream>
using namespace std;
template <typename T>
T mymax(T x, T y)
{
if (x > y)
{
return x;
}
else
{
return y;
}
}
int main()
{
cout << mymax<int>(3, 4) << endl;
cout << mymax<char>('g', 'h');
return 0;
}
| ALGO | 0.998162 | 3.935475 |
dbb60db1-fd29-4d76-9c6b-fe567c62a6d8 | madhvendrasingh007/LeetCode-GFG | 0043-multiply-strings/0043-multiply-strings.cpp | class Solution {
public:
string multiply(string num1, string num2) {
int n=num1.length(),m=num2.length();
vector<int> ans(n+m, 0);
if(num1=="0" || num2=="0") return "0";
for(int i=n-1; i>=0; i--){
for(int j=m-1; j>=0; j--){
int temp= (num1[i]-'0') * (num2... | ALGO | 0.999982 | 6.300776 |
06bc1d5f-157a-46fa-95e5-8c3262de1731 | aep/asgaard-aera | src/transform/gcx/ifexpression.cpp | /*! @file
* @brief Implementations of header file ifexpression.h.
* @details Implementations of constructors, destructor and functions of the corresponding header file ifexpression.h.
* @author Michael Schmidt
* @author Gunnar Jehl (multi-step paths/aggregate functions/optimizations)
* @version... | TOOL | 0.881025 | 6.676574 |
f48252a7-83b9-4ec5-aa4f-6971b3d7233e | sparkspay/sparks | src/sync.cpp | #if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <sync.h>
#include <logging.h>
#include <tinyformat.h>
#include <util/strencodings.h>
#include <util/threadnames.h>
#include <map>
#include <mutex>
#include <set>
#include <system_error>
#include <thread>
#include <type_traits>
#include <un... | TOOL | 0.93173 | 7.396735 |
af822a23-97eb-49de-a8e9-92fa4213056d | sylcrq/leetcode | implement_strstr.cpp | #include <string.h>
#include <stdio.h>
const char *strStr(const char *haystack, const char *needle)
{
if(!haystack || !needle) return haystack;
const char* ret = NULL;
int len_h = strlen(haystack);
int len_n = strlen(needle);
if(0 == len_n) return haystack;
if(len_h < len_n) return NULL;
... | ALGO | 0.999054 | 4.227237 |
acdb22c5-c1c6-4002-b008-dbe0841f6f52 | krazeekermit/sniffdogsniff | crawler/searchengine.cpp | #include "searchengine.h"
#include "crawlerutils.h"
#include "common/logging.h"
SearchEngine::SearchEngine(SearchEngineConfigs &configs_)
: configs(configs_)
{}
void SearchEngine::doSearch(std::vector<SearchEntry> &entries, const char *query)
{
logdebug << "do search - " << this->configs.name;
char searc... | TOOL | 0.910586 | 5.265523 |
d7a05bbd-8fb0-4262-859f-238c071eb898 | Destructor169/DSA-2 | subset sum memoized.cpp | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int tab[2000][2000];
// Returns true if there is a subset
// of set[] with sum equal to given sum
bool isSubsetSum(int set[], int n, int sum)
{
// Base Cases
if (sum == 0)
return true;
if (n == 0)
return false;
... | ALGO | 0.999696 | 5.582579 |
c21356e9-8833-4f5a-9ae6-15e8b1917960 | NagaNitishChowdary/RECURSION | COUNTING_SUBSEQUENCES_WITH_SUM_K.cpp | #include<bits/stdc++.h>
#define eb emplace_back
#define pb pop_back
#define ll long long int
#define nline "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);
using namespace std;
int subsequence(int ind,int s,int sum,int arr[],int n)
{
if(ind>=n){
if(s==sum) return 1;
else return 0;
... | ALGO | 0.999961 | 4.18009 |
fbc73c84-146e-4cc8-b020-8ffbe37f8a97 | horaas/flutter-curso-asegovia | band_names_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.997977 | 6.76775 |
ac26af04-8863-4dac-bb72-c42d135c9a0a | andymisu/AtCoderSolutions | AtCoder Beginner Contest 367/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int sleep,wake,shout;
cin>>sleep>>wake>>shout;
if(sleep < wake){
if(shout < wake && shout > sleep){
cout<<"No";
}else{
cout<<"Yes";
}
}else{
if(shout < sleep && shout > wake){
... | ALGO | 0.999939 | 3.069713 |
c1c042f5-61b9-4248-937d-e3fdf65ef5c9 | chungers/lab616 | third_party/cpp/boost_1_46_1/libs/graph/example/eccentricity.cpp | //[eccentricity_example
#include <iostream>
#include <iomanip>
#include <boost/graph/undirected_graph.hpp>
#include <boost/graph/exterior_property.hpp>
#include <boost/graph/floyd_warshall_shortest.hpp>
#include <boost/graph/eccentricity.hpp>
#include "helper.hpp"
using namespace std;
using namespace boost;
// The A... | ALGO | 0.999869 | 5.558161 |
edbcebc6-e683-499e-b1be-dfb422cc43a0 | maguima3/CarND-PathPlanner | src/Eigen-3.3/bench/sparse_setter.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.935109 | 4.152793 |
50431f4e-32ba-4b10-aeb6-3a0fe05d2e6a | jacarav0/Cf-probls | Cf-compprog/src/ProblemGenerator1980A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
int cnt[7]={};
for(int i=0;i<n;i++){
char c;cin>>c;
cnt[c-'A']++;
}
int ans=0;
for(int i=0;i<7;i++){
if(cnt[i]<m){ans+=m-cnt[i];}
}
cout<<ans<<"\n";
}
return 0;
}
| ALGO | 0.999816 | 4.249619 |
879ea09a-8cb8-4ac2-834b-127c0111ed40 | siba055/News24 | News24/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.998695 | 6.785645 |
ace8a514-6f83-4d15-bda2-54ad71da02ce | Harshitmishra001/Programming_Practice | Max-num-in-array.cpp | #include <iostream>
using namespace std;
int main(){
int n,i,k;
cout<<"Enter size of Array: \n";
cin>>n;
int *arr=new int(n);
for(i=0;i<n;i++){
cin>>arr[i];
}
k=0;
for(i=0;i<n-1;i++){
for(int j=1;j<n;j++){
if(arr[i]>arr[j]){
if(arr[i]>k){
... | ALGO | 0.999836 | 3.705239 |
3daf7af2-7ba3-4b85-a469-7226bc381746 | CGAL/cgal | Mesh_3/examples/Mesh_3/mesh_polyhedral_domain.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/Polyhedral_mesh_domain_3.h>
#include <CGAL/mak... | ALGO | 0.966162 | 6.610326 |
d39da8f4-f761-41d1-9e33-4a5fc141cf7e | H451B/problem_solving | A_2_-_3_Moves.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int x;
cin>>x;
while(x--){
int y;
cin>>y;
if(y==0||y==4||y==1){cout<<2<<endl;}
else if(y%3==1){cout<<y/3+1<<endl;}
else if(y%3==2){cout<<y/3+1<<endl;}
else{cout<<y/3<<endl;}
}
} | ALGO | 0.999741 | 3.341376 |
e04ee18c-91c1-4405-b756-6157956cb86e | UV26320/GeeksForGeeks | Sum of dependencies in a graph/Sum of dependencies in a graph.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution
{
public:
int sumOfDependencies(vector<int> adj[], int V)
{
// code here
int ans = 0;
for (int i = 0; i < V; ++i)
... | ALGO | 0.999909 | 6.238082 |
360007c4-020f-4cdd-bc6f-e823842190e5 | malcolmreynolds/GTSAM | gtsam/geometry/Cal3DS2.cpp | /**
* @file Cal3DS2.cpp
* @date Feb 28, 2010
* @author ydjian
*/
#include <gtsam/base/Vector.h>
#include <gtsam/base/Matrix.h>
#include <gtsam/geometry/Point2.h>
#include <gtsam/geometry/Point3.h>
#include <gtsam/geometry/Cal3DS2.h>
namespace gtsam {
/* ***********************************************************... | ALGO | 0.995741 | 7.349403 |
d4b290e1-0e29-4dea-b65f-263cf9ef91ec | 2018331109/BCS-ORBITAX | SSC-133/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod = 1e9 + 7;
const int md = 998244353;
const int INF = 1e18;
vector<int> adj[300009];
int dfs(int cur, int par)
{
int cnt=1;
for(auto it:adj[cur])
{
if(it!=par)
{
cnt+=dfs(it, cur);
}
... | ALGO | 0.999561 | 4.958264 |
7cc1e5d4-7ff8-479f-b01d-5b790f526f1a | AkshayRamakrishnann/oneAPI_With_SYCL | DirectProgramming/C++SYCL/Jupyter/oneapi-essentials-training/10_SYCL_Graphs_Scheduling_Data_management/lab/USM_implicit.cpp | #include <sycl/sycl.hpp>
using namespace sycl;
constexpr int N = 42;
int main() {
queue Q;
int *host_array = malloc_host<int>(N, Q);
int *shared_array = malloc_shared<int>(N, Q);
for (int i = 0; i < N; i++) {
// Initialize hostArray on host
host_array[i] = i;
}
// Submit the queue
Q.submit([&](... | ALGO | 0.987529 | 4.296317 |
18fffdc5-6487-4bed-ad15-8809e31cb5a6 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_8688_7.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 3 * 205;
int hh[maxn][2], tt[maxn][2], n[2], r;
char col[maxn][maxn];
int dis[maxn][maxn];
vector<pair<int, int> > vv;
int dfs(int h, int t) {
col[h][t] = 1;
int i, j, h1, t1;
for (j = 0; j < 2; j++)
for (i = 0; i < n[j]; i++) {
h1 = h;
... | ALGO | 0.999987 | 3.814641 |
d5ea87fd-55c1-42ce-bc8c-bc72ddcd0244 | samiul2102013/XPSC01 | week 14/day 2/A_green_gold_dog_array_and_permutation.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#ifdef LOKAL
#include "DEBUG_TEMPLATE.h"
#else
#define HERE
#define debug(args...)
#endif
const int N = 2e5 +5;
typedef pair<int,int> pii;
void TEST_CASES()
{
int n;cin>>n;
vector<int>v(n);
for(auto &i:v)ci... | ALGO | 0.999732 | 4.313931 |
373407c0-56d3-4191-b615-95ecc51d85b3 | shreeyakapoor190/leet-code | valid-parentheses/valid-parentheses.cpp | class Solution {
public:
bool isValid(string s) {
int l = s.size(), i;
stack<int> st;
for (i = 0; i < l; i++)
{
if (st.empty())
st.push(s[i]);
else
{
if ((s[i] == ')' && st.top() == '(') || (s[i] == '}' && st.top() =... | ALGO | 0.999741 | 6.405496 |
0d62f68a-1d07-44d7-b3a5-e20c149c8f96 | TT2TER/BITMY | cjia/xiangqianxing.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
const int maxE = 300050, maxN = 300050;
int head[maxN], cnt = 0;
struct node
{
int to, nxt, w;
};
int i;
int n, m;
int in[maxN] = {0};
node e[maxE]; //边集数组,边数一般要设置比maxn*maxn大的数,如果题目有要求除外
void add(int from, int to, int w... | ALGO | 0.999986 | 4.048655 |
4674ecc3-e1fc-4329-ae6a-669d0cfe8823 | dihelium/cpp-competitive | Intra Hostel Contests/Contest 5/Aracontest5A.cpp | /*
// Sample code to perform I/O:
cin >> name; // Reading input from STDIN
cout << "Hi, " << name << ".\n"; // Writing output to STDOUT
// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/
// Write your code here
#include<iostream... | ALGO | 0.997827 | 4.368539 |
c9ea384c-e51b-436b-af9d-fbce4e6c9c04 | diyajaiswal11/Competitive-Programming | Codeforces/1454B.cpp | #include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n"
#define MAX 1000000
#define mod 1000000007
#define ll long long int... | ALGO | 0.999874 | 3.671703 |
4b2ea4d6-1a2e-4d33-aaf8-acd3e733c691 | TsaiPinHsiang/leecode | medium/lt437/Path Sum.cpp | class Solution {
public:
int pathSum(TreeNode* root, long targetSum) {
if(root != NULL){
cal_sum(root, targetSum);
pathSum(root->left, targetSum);
pathSum(root->right, targetSum);
}
return ans;
}
void cal_sum(TreeNode* root, long sum){
if(... | ALGO | 0.999919 | 6.125432 |
d8f65012-3377-46cd-8f1d-4da378ef12f4 | Davide64-dev/FEUP_CPD_MatrixProduct | src/matrixproduct.cpp | #include <ctime>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <time.h>
#include <chrono>
#include <cstdlib>
#include <papi.h>
using namespace std;
using namespace std::chrono;
#define SYSTEMTIME clock_t
char *OnMult(int m_ar, int m_br, bool benchmark) {
SYSTEMTIME Time1, Time2;
char st[100]... | TOOL | 0.984763 | 3.785453 |
77fb33ec-6a67-4075-bb08-abe753e25e1e | 142spp/beakjun | 1966.cpp | #include <bits/stdc++.h>
using namespace std;
struct script{
int id;
int priority;
script(int i, int p){
this-> id = i;
this-> priority =p;
}
bool operator< (const script &s) const {
if(this->priority < s.priority) return true;
else return false;
}
};
priority_... | ALGO | 0.999954 | 3.837469 |
52fcb19b-cd62-4a60-9386-816d3ebc998d | DeltaHao/sword-to-offer | 48.cpp | /*不用加减乘除做加法
写一个函数,求两个整数之和, 要求在函数体内不能使用+,-,*, /四则运算符号
*/
#include<iostream>
using namespace std;
class Solution {
public:
int add(int num1, int num2){
int carry = 1;//进位值
int sum = 0;//不考虑进位的各位相加值
while(carry){//当有进位时
sum = num1 ^ num2;//不考虑进位的各位相加值等于各位异或
carry = ... | ALGO | 0.999928 | 4.356716 |
1de646ae-3dbc-4f17-8ebd-2761ca6b5484 | patrickchennn/datum-algorithm | linkedlist/singly/miscellaneous/MergeLL.cpp | /* C++ program to merge two sorted linked lists */
#include <bits/stdc++.h>
using namespace std;
/* Link list node */
class Node{
public:
int data;
Node* nextNode;
};
void InsertNodeFromTail(Node** head_ref, int new_data);
void printList(Node *node);
Node *mergeRecursive(Node *llA, Node *llB){
if(llA==NULL)
... | ALGO | 0.999884 | 5.900331 |
3ae7b85c-2bee-410f-a201-e6f78a6d2492 | Fresh-hongsi/BaekjoonCpp | 13458-시험감독.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
long long room = 0;
long long mainSight = 0;
long long subSight = 0;
vector<long long> member;
long long mainDirector = 0;
long long subDirec... | ALGO | 0.999741 | 3.315037 |
77f09eee-9e28-4c87-99a4-345a30fc471a | cleaton/android_build | tools/atree/files.cpp | #include "files.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
#include <fnmatch.h>
#include <string.h>
#include <stdlib.h>
static bool
is_comment_line(const char* p)
{
while (*p && isspace(*p)) {
p++;
}
... | TOOL | 0.950288 | 5.911925 |
91dedec2-7f2f-44fd-8e4e-9794a1d5f03d | mir183/CodeForces | 257Filling Shapes/m.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define endl '\n'
#define fasterio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
int main() {
fasterio;
// Your code here
// Al... | ALGO | 0.999943 | 4.864054 |
d1f6a67f-8429-45a6-b8e9-d649d8be5ce1 | GeonHyeongKim/2022-2-Algorithm-Study | src/taeeun/week14/갤러리.cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int dx[4] = { 1, -1, 0, 0 };
int dy[4] = { 0, 0, -1, 1 };
int m, n;
int cnt = 0;
void hasPicture(int x, int y, vector<vector<int>> &map, vector<vector<vector<bool>>> &visited) {
for (int i = 0; i < 4; i++) {
int nextX = x + dx[i];
in... | ALGO | 0.999846 | 4.222959 |
1ecef394-8768-4176-abef-8841332b9b4c | jaimemin/programmers | 연속된 수의 합.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(int num, int total) {
vector<int> answer;
for (int i = -1000; ; i++)
{
int sum = 0;
for (int j = 0; j < num; j++)
{
sum += i + j;
}
if (sum == total)
{
f... | ALGO | 0.999786 | 4.066247 |
8dc19d6f-660b-43a3-a8f5-466187bf2c00 | ishandutta2007/codeforces | andr0901/normal/1515/B.cpp | //#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
//vector string deque break continue
#define forn(i, s, f) for (int i = (int)s; i < (int)f; i++)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define fs first
#define sc second
#defi... | ALGO | 0.998427 | 4.924713 |
5297dc8f-daf0-418e-8c31-88448c7c3380 | MAR0897/CPP-I-projekt-fyzikalni-engine | src/physics.cpp | #include "../header/header.h"
//things for physics simulation and some constants
namespace physics {
int iterations = 50;
bool gravity = false;
const double RESTITUTION = 0.5;
const double STATIC_FRICTION = 0.6;
const double DYNAMIC_FRICTION = 0.45;
void step(const double& delta, const i... | ALGO | 0.907562 | 4.001689 |
991e89ca-5a6f-48d1-8758-86a2b7994d73 | Delia13-23/GUAPA | uva_uhunt/10474_WhereIsTheMarble.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<int> pos;vector<int> cas;
int main()
{
int N,casos,c,x;
int count = 1;
while(cin>>N>>casos and N != 0 and casos != 0)
{
pos.clear(); cas.clear();
for(int i = 0; i < N; i++)
{
cin>>c;
pos.push_ba... | ALGO | 0.9995 | 4.21724 |
fee59f86-b1d7-4cdd-abae-4776aaddcdbf | HungHyperX/Project1-Week1 | Week_1-List_all_numbers_from_1_to_n_and_its_squares.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++){
cout << i << " " << i * i << "\n";
}
return 0;
}
| ALGO | 0.991925 | 3.99121 |
d76fe72e-896c-435d-801a-4eaafc5b62af | Chep-Code-lo/LUYEN_CODE | NHAP_MON_LAP_TRINH_UTE_OJ/042.cpp | #include<iostream>
using namespace std;
long long n, pascal[50][50];
int main(){
cin >> n;
for(int i=0; i<n; ++i)
for(int j=0; j<=i; ++j){
if(j == 0 || j == i)
pascal[i][j] = 1;
else
pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];
}
f... | ALGO | 0.999987 | 3.840052 |
784c191a-107f-49b6-98b9-43c8dd17c295 | eagles-project/mam4xx | src/validation/nucleation/mer07_veh02_wang08_nuc_1box.cpp | #include <mam4xx/nucleation.hpp>
#include <validation.hpp>
#include <haero/constants.hpp>
#include <skywalker.hpp>
#include <iostream>
using namespace skywalker;
using namespace mam4;
void mer07_veh02_wang08_nuc_1box(Ensemble *ensemble) {
constexpr Real pi = Constants::pi;
// Figure out settings for binary/ter... | ALGO | 0.997295 | 5.788638 |
b44ab664-60b7-4d6c-9e9d-abe23334e634 | LumineDroid/platform_frameworks_av | media/module/codecs/amrnb/common/src/shr.cpp | /*
Filename: /audio/gsm_amr/c/src/shr.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the shr function. Sync'ed up with
the current template and fixed tabs.
Description: 1. Modified code by seperating var2=0 condi... | ALGO | 0.991746 | 6.573509 |
20b6151f-2794-48ff-918b-163ab10da707 | ishandutta2007/codeforces | hank55663/normal/1389/F.cpp | #include<bits/stdc++.h>
/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>... | ALGO | 0.999862 | 3.57993 |
363559b5-eb37-4eb2-b8cf-acd3ec5eb22b | ichichi-3180/freekick | iml_physics/shared/inc/BulletInverseDynamics/IDMath.cpp | #include "IDMath.hpp"
#include <cmath>
#include <limits>
namespace btInverseDynamics
{
static const idScalar kIsZero = 5 * std::numeric_limits<idScalar>::epsilon();
// requirements for axis length deviation from 1.0
// experimentally set from random euler angle rotation matrices
static const idScalar kAxisLengthEpsil... | TOOL | 0.995643 | 7.512608 |
1b444368-143a-4756-9d04-3f0ab40139bd | CodeWizardOve/Simple-C-problems | Small To Large - Assignment 6.cpp | //Small to large
#include <iostream>
using namespace std;
int main(){
int a;
int b;
int c;
cout << "enter number"<<endl;
cin>> a >> b >>c;
if( a<b && a<c && b>c ){
cout << a;
cout << c;
cout << b;
}
else if( a<b && a<c && b<c ) {
cout << a << b << c;
}
else if ( b<a && b<c && c>a ){... | ALGO | 0.999544 | 3.229389 |
1da09f85-2750-468f-8ea3-f0c96794bf2d | joopixel1/CSES | GFG/Arrays/arrays/medium/triple_sum_in_array.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout << "Starting..." << "\n";
ll n, k;
cin >> n >> k;
vector<ll> v(n);
for(size_t i=0; i<v.size(); i++) cin >> v[i];
sort(v.begin(),... | ALGO | 0.999949 | 3.653858 |
9f8fc78d-2dd5-450a-905a-0445ea89b039 | Vip2016-0/-SdeSheetChallenge_by_Striver | SDE_SHEET/Stack/Next_Greater_Element.cpp |
// Time Complexity :- O(n)
// Space Complexity :- O(n)
vector<int> nextGreater(vector<int> &arr, int n) {
vector<int> ans(n, -1);
stack<int> st;
for(int i = n - 1; i >= 0 ; i--){
if(st.empty()){
ans[i] = -1;
st.push(arr[i]);
}
else{
while(!s... | ALGO | 0.999929 | 5.237603 |
e6fbd007-8e71-447a-810c-99cba7e545f0 | hardieck/rccm-permutation-finder | version-2/src/calc_selective_adder_base.cpp | //
// Created by hardieck on 9/27/19.
//
#include "../inc/calc_selective_adder_base.h"
#include <iostream>
calc_selective_adder_base::calc_selective_adder_base(){}
calc_selective_adder_base::~calc_selective_adder_base(){}
void calc_selective_adder_base::init()
{
//DO NOT USE local spec value!!! use get_spec()! cau... | ALGO | 0.945604 | 5.773205 |
6f89c10a-f4dd-49a2-a9df-f564b5105e96 | pushkarNath007/DSA_GFG_1 | FUNCTIONS/sum_nd_product_of_factors_of_n.cpp | #include<bits/stdc++.h>
using namespace std;
void sum_and_productOf_factors(int n){
long int sum=0,product=1;
for(int i=1;i<=n;++i){
if(n%i==0){
sum+=i;
product*=i;
cout<<i<<" ";
}
}
cout<<" sum ="<<sum<<endl;
cout<<" "<<"product ="<<" "<<product<... | ALGO | 0.99901 | 5.695008 |
f09ae94d-8cf3-4901-bb79-ab8764ebd124 | Cope-Ali/cplus | submittedHomework/cs124_assign34.cpp | /***********************************************************************
* Program:
* Assignment 34, Pointer Arithmetic
* Brother Honeycutt, CS124
* Author:
* Ali Cope
* Summary:
* This program will count the number of times a user chosen letter
* appears in a user provided string using pointers... | ALGO | 0.997095 | 4.448515 |
e7f0e9ac-8a8d-4d21-a130-65cfd07d99c7 | ForedawnLin/TheBoatDoctorRobot | catkin_ws/src/hebiros/hebiros/include/hebi/Eigen/unsupported/test/polynomialsolver.cpp | #include "main.h"
#include <unsupported/Eigen/Polynomials>
#include <iostream>
#include <algorithm>
using namespace std;
namespace Eigen {
namespace internal {
template<int Size>
struct increment_if_fixed_size
{
enum {
ret = (Size == Dynamic) ? Dynamic : Size+1
};
};
}
}
template<int Deg, typename POLYNOMIAL... | TEST | 0.851921 | 6.298024 |
fee62f0d-9500-4b3a-9498-923a9b512d3b | himemeizhi/Code-Library | graph/Stable Marriage.cpp | //对于每个预备队列中的对象,及被匹配对象,先按照喜好程度排列匹配对象
while(!g.empty()) // 预备匹配队列
{
if(dfn[edge[g.front()].front()]==-1)
dfn[edge[g.front()].front()]=g.front(); // 如果目前还没尝试匹配过的对象没有被任何别的对象占据
else
{
for(it=edge[edge[g.front()].front()].begin();it!=edge[edge[g.front()].front()].end();++it)
if(*it==... | ALGO | 0.999923 | 3.231911 |
d54f146d-6521-4aed-8325-bd6d23d54b68 | Maha0220/PS | 11651.cpp | #include <iostream>
#include <cstdlib>
#include <algorithm>
#include <limits.h>
#include <cstring>
#include <vector>
#include <string>
#include <utility>//pair
using namespace std;
int N;
vector<pair<int,int>> V;
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
cin >> N;
for(int i=0;i<N;i+... | ALGO | 0.99983 | 4.020849 |
68a249a0-729e-4e23-a8d6-4e052b10c622 | Gamaliel-Marines/TC2037 | c++ codes/example06.cpp | #include <iostream>
#include <iomanip>
#include <cstring>
#include <unistd.h>
#include <pthread.h>
#include "utils.h"
using namespace std;
const int SIZE = 100000; //1e4
typedef struct {
int low, high;
int *A;
} Block;
Block* makeBlock(int s, int e, int* a) {
Block *n = new Block;
n->low = s;
n-... | ALGO | 0.999909 | 4.893126 |
2603c7c7-7c8d-402e-a7b8-8c24fb4f97fa | dennisyakovlev/compeitive-programming-notes | queries/number_in_square.cpp | /*
General idea is "find number of items which meet condition within a square on a 2d grid".
To solve, construct a grid and notice
(1,1) (1,2) (1,3) (1,4) ... (1,n)
(2,1) (2,2) (2,3) (2,4) ... (2,n)
(3,1) (3,2) (3,3) (3,4) ... (3,n)
(4,1) (4,2) (4,3) (4,4) ... (4,n)
... ..... | ALGO | 0.999847 | 4.663926 |
14425bfb-6d4d-4766-b0f4-e6da05b2a411 | GenerStudent/teamcayley | wind/wind.cpp | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
Wind::Wind()
{
int degree;
float speed;
bool gale;
}
Wind::initWind(wind a)
{
a.degree = rand() % 360 + 1;
a.speed = rand() % 10 + 1;
a.gale = false
}
Wind::triggerGale(wind a)
{
a.speed = 30;
a.gale = true;
}
Wind::upda... | TOOL | 0.850513 | 4.897895 |
03bbdcc8-8290-4204-9472-e9bcc557c637 | Agentsiddharth/car---rental-system | library_stl/set/1.cpp | #include<iostream>
#include<set>
using namespace std;
int main(){
set<int> s;
s.insert(10);
s.insert(20);
s.insert(5);
s.insert(5);
for(auto x:s){
cout<<x<<" ";
}
cout<<endl;
for(auto i=s.begin();i!=s.end();i++){
cout<<(*i)<<" ";
}
return 0;
} | ALGO | 0.981586 | 3.249881 |
a71e2732-d568-4efa-a5ad-e16878041e4d | gafeol/competitive-programming | ojs/cs/61/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define fst first
#define snd second
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define for_tests(t, tt) int t; scanf("%d", &t); for(int tt = 1; tt <= t; tt++)
#ifndef ONLINE_JUDGE
#define debug(args...) fprintf(st... | ALGO | 0.999478 | 3.002417 |
251529a2-07c7-4005-bb0e-5043ab4191ef | ksdkamesh99/Code-Monker | Codechef/CHFICRM.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
for(int i=0;i<t;i++){
int n;
cin>>n;
int arr[n];
for(int j=0;j<n;j++){
cin>>arr[j];
}
int ten=0;
int five=0;
int fiften=0;
int flag=1;
for(int j=0;j<n;j++){
... | ALGO | 0.99977 | 5.411771 |
2ee89bcd-2fa7-4415-9a0a-998e635c5c12 | abin02/100DaysOfCode | Test/39.splitFunction.cpp | #include <bits/stdc++.h>
using namespace std;
void tokenize(string s, string del = " ")
{
int start, end = -1 * del.size();
//do
//{
// start = end + del.size();
// end = s.find(del, start);
// cout << s.substr(start, end - start) << endl;
//} while (end != -1);
stringstream str... | TOOL | 0.919634 | 3.478074 |
a2fe73a8-9907-4002-842e-3edfaea9287a | spunkymj/LEETCODE | 2038-remove-colored-pieces-if-both-neighbors-are-the-same-color/2038-remove-colored-pieces-if-both-neighbors-are-the-same-color.cpp | class Solution {
public:
bool winnerOfGame(string colors) {
vector<vector<int>> cont(2);
int n=colors.size();
for(int i=0 ; i<n ; i++){
char curr=colors[i];
int j=i;
while(i<n && colors[i]==curr){
i++;
}
i--;
... | ALGO | 0.999564 | 6.065744 |
12d4093b-05de-430d-9a39-c957ea6dcb44 | ELkhalil/Webserv_Parsing | srcs/ParseConfigFile/LocationConfig.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* LocationConfig.cpp :+: :+: :+: ... | TOOL | 0.861786 | 5.957098 |
d9fba721-e291-43dd-b391-9c0b38cf7177 | Weiggen/wei_research_ws | src/state_estimation/src/EIF_related/SEIF_lidar_neighbors.cpp | #include "SEIF_lidar_neighbors.h"
Self_lidar_EIF::Self_lidar_EIF()
{
self_measurement_size = 3;
neighbor_num_curr = 0;
EIF_measurement_init(self_state_size, self_measurement_size, &self);
//////////////////////// Covariance Tuning ////////////////////////
R(0, 0) = 4e-4;
R(1, 1) = 2e-2;
R(2... | ALGO | 0.999127 | 4.604523 |
eaa25e43-4b97-4759-a142-67cb91cf825f | 569985011/Work-Space | C++/C++Primer5th/CppPrimer-master/ch10/ex10_30.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
int main()
{
std::istream_iterator<int> in_iter(std::cin), eof;
std::vector<int> vec;
while (in_iter != eof) vec.push_back(*in_iter++);
std::sort(vec.begin(), vec.end());
std::copy(vec.cbegin(), vec.cend(),
... | ALGO | 0.999905 | 5.088335 |
4451c9d5-f69e-4c55-b1fa-662376eb33f7 | mdmohidulislammi/Learning | Data structure/Module_13 stack/stack_using_linked_list.cpp | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int value;
Node* next;
Node * prev;
Node(int value)
{
this->value=value;
this->next=NULL;
this->prev=NULL;
}
};
class myStack
{
public:
Node* head=NULL;
Node* tail=NULL;
int sz=0;
v... | ALGO | 0.999918 | 4.328941 |
2764b4bd-7ccb-4fff-a37a-b640c10e4268 | ExploiTR/DSACPP | DSA_Topics/Practice/A2Z_Revise/practise_pattern.cpp | #include "../header.h"
void print_pattern1(int size)
{
cout << "Pattern 1" << endl;
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
cout << "* ";
}
cout << endl;
}
cout << endl;
}
void print_pattern2(int size)
{
cout << "Pattern 2" ... | ALGO | 0.999241 | 4.077726 |
b341d145-e5aa-458e-b657-e0e62348fd63 | AlexandreMercierAubin/AdaptiveRigidificationShells2023 | lib/distmesh/dsegment.cpp | #include "mex.h"
#include <cmath>
#define p(i,j) p[(i)+np*(j)]
#define pv(i,j) pv[(i)+nvs*(j)]
#define ds(i,j) ds[(i)+np*(j)]
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T dot2(T *a,T *b) { return a[0]*b[0]+a[1]*b[1]; }
template<class T> inline T length(T x,T y) { return sqrt(sqr(x)+s... | ALGO | 0.999346 | 5.004622 |
12f22b73-7d5b-4bc1-b2f4-439a5e727722 | bytendpixel/Leetcode-Solution | Substring with Concatenation of All Words.cpp | class Solution {
public:
vector<int> findSubstring(string s, vector<string>& words) {
unordered_map<string, int> cnt;
for (auto& w : words) {
++cnt[w];
}
int m = s.size(), n = words.size(), k = words[0].size();
vector<int> ans;
for (int i = 0; i < k; ++i) ... | ALGO | 0.999937 | 6.139954 |
63369281-5d7d-4872-8833-72b3a21f5836 | ishandutta2007/codeforces | emptysoulist/normal/1515/F.cpp | #include<bits/stdc++.h>
using namespace std ;
#define Next( i, x ) for( int i = head[x]; i; i = e[i].next )
#define rep( i, s, t ) for( int i = (s); i <= (t); ++ i )
#define drep( i, s, t ) for( int i = (t); i >= (s); -- i )
#define mp make_pair
#define int long long
#define pi pair<int, int>
#define pb push_back
#defi... | ALGO | 0.999996 | 3.869617 |
f42c2723-e46a-4c7b-b978-38e2359b9fd3 | maj42/top_cpp | top_c++/homework_36/homework_36.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
void main()
{
FILE* file;
FILE* newFile;
char fileName[] = "words.txt";
char newFileName[] = "newWords.txt";
if ((file = fopen(fileName, "r")) && (newFile = fopen(newFileName, "w"))) {
char word[20];
while (!feof(file)) {
fscanf(fil... | TOOL | 0.881598 | 3.181348 |
78c36ce9-b2ec-4611-8efe-3a98289f866e | rajdeepdatta2016/Data-Structure-and-Algorithm | Basic/Normal Code/GCD.cpp | #include<bits/stdc++.h>
using namespace std;
int findGCD(int a, int b) {
if(a == 0 || b == 0) return a+b;
else if(a == b) return a;
else if(a > b) return findGCD(a%b, b);
else return findGCD(a, b%a);
}
int main() {
int a, b;
cin >> a >> b;
int ans = findGCD(a, b);
cout << "GCD = " << a... | ALGO | 0.995199 | 5.431578 |
259214f6-abb5-4f93-9908-199acae3306c | gloriaf22/1C | Ejercicios de vectores/4.cpp | #include<iostream>
using namespace std;
void cargarVector(int a[]);
void mostrarVector(int a[]);
int mayor(int a[]);
int main(){
int a[5];
cout<<"Ingrese 5 valores"<<endl;
cargarVector(a);
mostrarVector(a);
cout<<endl;
cout<<mayor(a);
return 0;}
void cargarVector(int a[]){
for(int i=0;i... | ALGO | 0.984782 | 3.373371 |
21b1d37a-c5b3-49b4-8ddd-49115bf42916 | kt117/ProCom | atcoder/abc/101-200/181-190/181/d.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.999775 | 4.124569 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.