uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
bc7de792-675d-4c64-a05d-f96d6a0ce5bd | joshualass/CP | Solutions/Contests/Special/CollegeComps/UTPC/Dec23/E.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD = 1e9 + 7;
int dy [4] = {0,0,-1,1};
int dx [4] = {-1,1,-1,1};
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int r, c, q; cin >> r >> c >> q;
vector<vector<int>> baklavas(r,... | ALGO | 0.999978 | 4.088792 |
2e7b06ef-dc0a-43ed-9a5f-5c8ca22a246f | Jinu-Lee/Practice | acmicpc/1000/1339.cpp | #include <bits/stdc++.h>
using namespace std;
int n;
vector<string> v;
map<char, int> m1, m2;
vector<pair<int, char>> temp;
int main()
{
ios::sync_with_stdio(0), cin.tie(0);
cin >> n;
v.resize(n);
for (auto &i : v) {
cin >> i;
}
for (string s : v) {
int len = s.length();
... | ALGO | 0.999828 | 4.778773 |
1ab4842d-c643-4686-8d85-9dac8570aa85 | ishandutta2007/codeforces | generic_placeholder_name/normal/1139/E.cpp | #pragma GCC optimize("Ofast")
#pragma GCC optimization("unroll-loops, no-stack-protector")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gn... | ALGO | 0.999999 | 4.185122 |
a316febf-bfe9-4ba5-8a57-447f87d5adea | akij22/FdP-A--UniPr | Esercizi_per_esame/liste/main.cpp | #include <iostream>
using namespace std;
struct node {
int data;
node* next;
};
void addOnTail (node* &list, int dato) {
if (list == nullptr) {
node* new_node = new node;
new_node->data = dato;
new_node->next = list;
list = new_node;
return;
}
node* cursor... | ALGO | 0.996473 | 4.995703 |
a0fedcca-f30c-4d9f-a046-a5b10e416d24 | Ashutosh2128/DSA-Placement-Course-By-Love-Babbar | Lec-019. CPP STL/SetSTL.cpp | #include <iostream>
#include <set>
using namespace std;
int main() {
set<int> s;
s.insert(5);
s.insert(5);
s.insert(5);
s.insert(1);
s.insert(6);
s.insert(6);
s.insert(0);
s.insert(0);
s.insert(0);
for(auto i:s) {
cout << i << endl;
}cout << endl;
set<int>... | ALGO | 0.995666 | 3.670585 |
56d66b52-f233-4612-a4be-ba250c046b37 | azizur-rahaman/Problem-solving-with-c-plus-plus | codeforces/YouKnowWho_Ultimate_Guide/GCD.cpp | #include<iostream>
#include <string>
#include<bitset>
#include<algorithm>
using namespace std;
void solved(){
int a,b;
cin>>a>>b;
cout<<__gcd(a,b)<<endl;
}
int main(){
int t=1;
// cin>>t;
while (t--) solved();
} | ALGO | 0.999123 | 4.878775 |
ad3871f0-cfc1-4776-9890-318275f26394 | croko22/CCII-LAB | LAB (4)/3.cpp | #include <iostream>
using namespace std;
//KEVIN JOAQUIN CHAMBI TAPIA | CUI:20200556
//Ejercicio 3
int main(int argc, char const *argv[])
{
int arr[5][3],sum=0;
for(int i=0; i<5;i++){
cout<<"Fila:"<<i+1<<endl;
for(int j=0; j<3;j++){
cin>>arr[i][j];
}
}
cout<<"Del array: "<<endl;
for(int i=0; i<5;i... | ALGO | 0.997601 | 3.543517 |
e86e2bc6-4583-4258-8433-a1f294dfe686 | KevinHuang8/USACO | Contest 4/test2.cpp | /*
ID: Kevun1
LANG: C++11
TASK: name
*/
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <unordered_map>
#include <tuple>
#include <algorithm>
#include <cmath>
#include <utility>
#include <unordered_set>
#include <set>
#include <map>
#include <queue>
#include <sstr... | ALGO | 0.999143 | 3.361629 |
21c3ea0b-4187-4b00-9b3e-ed8179de90ff | valeaussie/GMRF_growing | GMRF_growing/GMRF_gold.cpp | #include <random>
#include <iostream>
#include <vector>
#include <fstream>
#include <map>
#include <algorithm>
#include <math.h>
#include "GMRF_header.h"
#include "numeric"
#include <Eigen/Dense>
Eigen::MatrixXd Q_AA(std::vector < double > A, Eigen::MatrixXd Prec_Q);
Eigen::MatrixXd Q_AB(std::vector < double > A, Eige... | ALGO | 0.999058 | 3.975184 |
a97cefbc-efbe-4403-a312-de7b3a188d35 | ravariu-eugen/HaliteC- | old/728-1000##05-10-2022##1652178496/MyBot.cpp | #include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <set>
#include <fstream>
#include <cmath>
#include "hlt.hpp"
#include "networking.hpp"
#include <queue>
#include <iomanip>
#define MAX_TURN 300
#define MAX_STRENGTH 255
#define POTENTIAL_WEIGHT 2.0
#define POTENTIAL_D... | ALGO | 0.998638 | 3.964069 |
75cc957e-08a4-4dfc-9378-c100c712e183 | MaximussumixaM/LeedCodeC- | Find_Minimum_in_Rotated_Sorted_Array/Find_Minimum_in_Rotated_Sorted_Array.cpp | //Предположим, что массив длины n, отсортированный в порядке возрастания, вращается от 1 до n раз.Например, массив numleft = [0, 1, 2, 4, 5, 6, 7] может стать следующим :
//[4, 5, 6, 7, 0, 1, 2] , если он был повернут 4 раза.
//[0, 1, 2, 4, 5, 6, 7], если он был повернут 7 раз.
//Обратите внимание, что поворот массива... | ALGO | 0.999995 | 5.436239 |
727f26e4-eb74-4b05-868f-da727026bdf5 | SAURABH200301/MyCppCodes | patternnn.cpp | #include<bits/stdc++.h>
using namespace std;
void printPatt(int n){
for(int i=0;i<=n;i++) cout<<'*';
//*****
cout<<endl;
int n1=n/2;
for(int i=1;i<n-1;i++){
for(int j=0;j<=n1-i;j++) cout<<"*";
for(int l=1;l<=2*i-1;l++) cout<<" ";
for(int k=0;k<=n1-i;k++) cout<<"*";
cout<<endl;
}
for(int i=... | ALGO | 0.999955 | 3.972453 |
25f4b66f-8675-482b-ad69-61039def01c0 | RISHYAVANDHAN/Peridynamics | CPP/cmake-build-debug/_deps/eigen-build/doc/snippets/compile_MatrixBase_applyOnTheRight.cpp | static bool eigen_did_assert = false;
#define eigen_assert(X) if(!eigen_did_assert && !(X)){ std::cout << "### Assertion raised in " << __FILE__ << ":" << __LINE__ << ":\n" #X << "\n### The following would happen without assertions:\n"; eigen_did_assert = true;}
#include <iostream>
#include <Eigen/Eigen>
#ifndef M_PI... | ALGO | 0.909428 | 3.295535 |
4b51d7c1-2d21-4d57-a383-7c130530b708 | adarshhbnair/Data-Structures-and-Algorithms | subtreeOfAnotherTree_BT.cpp | #include <iostream>
// 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), left(... | ALGO | 0.999873 | 7.56044 |
ca9f17d4-e769-4aa5-8ee4-1e67fc8e73db | ishandutta2007/codeforces | emilan/normal/1175/C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int &x : a) cin >> x;
int best = INT_MAX, ans;
for (int i = 0; i + k < n; i++) {
int d = a[i + k] - a[i];
if (d < best) {
best = d;
ans = (a[i +... | ALGO | 0.999929 | 5.000574 |
b156a305-b6fd-4b85-90db-dad069c82be0 | ishandutta2007/codeforces | latte0119/normal/778/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n... | ALGO | 0.999977 | 3.88682 |
15caf8df-76a9-4c83-864c-279405c13dd8 | neeshat-sh/CSE-106---DSA-1-Sessional | Offline/Offline 2 Stack/2205056/main_array_stack.cpp | #include "StackArray.h" // Include Array-based Stack implementation
#include <cstdio> // For FILE*, fopen, fscanf, fprintf
// Helper function to print the current stack
void printStack(Stack &stack, FILE *outputFile)
{
Stack tempStack;
fprintf(outputFile, "Current stack: ");
while (!stack.isEmpty())
... | ALGO | 0.923419 | 6.248188 |
d653ebb4-1fc2-460e-a9a2-dc0a7ebf48e8 | EulerDanseur/MyWorks | Basics of Programming/week 5/CompleteNum.cpp | #include<iostream>
using namespace std;
bool IsComplete(int num);
void PrintFactors(int num);
int main ()
{
int num;
cin >> num;
for(int i = 1; i <= num; i++)
{
if(IsComplete(i))
PrintFactors(i);
}
return 0;
}
bool IsComplete(int num)
{
int sum = 0;
for(int i = 1; ... | ALGO | 0.999408 | 4.693573 |
2c3fcd0c-e14d-448d-affa-e14b9b129f3d | ji1dev/algorithm | BOJ/16964.cpp | // 16964번_DFS 스페셜 저지
#include <iostream>
#include <vector>
#include <algorithm>
#define MAX 100001
#define F_IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
vector<int> g[MAX];
bool isDiff, visited[MAX];
int n, cnt, tr[MAX], seq[MAX];
void dfs(int v){
if(tr[cnt] != v){ // 주어진 방문 순서와 다른 ... | ALGO | 0.999955 | 4.479561 |
bcb406bd-c32e-4788-8052-2e2b27c14450 | sifat-hossain-niloy/LLMs-Performance-in-ICPC-Problems | Solution-Codes/2019/O1-Preview/H.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXN = 500005;
vector<int> adj[MAXN];
int status[MAXN]; // 0: unvisited, 1: visiting, 2: visited
int depth[MAXN];
int cycleSize[MAXN];
int successor[MAXN];
int n, k;
vector<int> cycleNodes;
void dfs(int u) {
status[u] = 1;... | ALGO | 0.999995 | 4.650816 |
fd201376-067b-4269-b7d3-5feb3a1c16ed | ashwanibackup/Cpp | StringPyramid/main.cpp | #include <iostream>
#include <string>
//i have added this line through ashwanibackup0
//as
using namespace std;
int main()
{
string format{};
cout << "Enter the pattern: ";
getline(cin, format);
int print_line{}, print_space{};
int space_limit = format.size() - 1;
int str_len = format.size();
int print... | ALGO | 0.940154 | 4.3384 |
eec1f12e-11be-4008-9aff-ecf32d15bff8 | ngthanhtrung23/CompetitiveProgramming | codeforces/549/D.cpp |
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define EACH(it,a) for(__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)
#define DEBUG(x) { cout << #x << " = "; cout << (x) << en... | ALGO | 0.999755 | 4.411167 |
0b6f9f11-d839-4df2-bc64-825591e00e2e | docongban/Zcode_CTDL-GT | Contest 3 tham lam/tich_lon_nhat.cpp | /*Code By BanDC*/
//VS Code
#include<bits/stdc++.h>
using namespace std;
int arr[10000];
void Init(int n)
{
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
}
void Handle(int n)
{
sort(arr,arr+n);
long long tich=1;
if(arr[n-1]<=0) tich=arr[0]*arr[1];
else if(arr[n-3]>0)
{
if(arr[0]*... | ALGO | 0.999983 | 4.068532 |
76d4709e-2d6c-4b47-a1a4-61be156a2806 | BaiChunhui-9803/ofec_code | instance/problem/continuous/single_objective/multi_modal/cec2015/F11_composition2015_C3.cpp | #include "F11_composition2015_C3.h"
#include "../../global/classical/rosenbrock.h"
#include "../../global/classical/rastrigin.h"
#include "../../global/classical/happy_cat.h"
#include "../../global/classical/scaffer_F6.h"
#include "../../global/classical/modified_schwefel.h"
namespace ofec {
namespace cec2015 {
F11... | ALGO | 0.997512 | 3.818981 |
7e72e5c8-31cc-4312-bdd2-ac5329e31458 | Rashi-Singh1/InterviewBit-Solutions | Two Pointers/RemoveDuplicatesFromSortedArray2.cpp | int Solution::removeDuplicates(vector<int> &A) {
if(A.size() < 3) return A.size();
int count = 1, trash = A[0], start = 1;
for(int i = 1; i < A.size(); i++){
if(A[i] == trash) {
count++;
if(count <= 2) {
A[start++] = A[i];
}
}
else{... | ALGO | 0.999914 | 5.57228 |
611e5816-df48-4a41-9286-4416ad04f654 | Moxoo/llm-server | third_party/MNN/tools/train/source/nn/Distributions.cpp | #include "Distributions.hpp"
#include <cmath>
namespace MNN {
namespace Express {
void Distributions::uniform(const int count, const float min, const float max, float *r, std::mt19937 gen) {
std::uniform_real_distribution<float> dis(min, max);
for (int i = 0; i < count; i++) {
r[i] = dis(gen);
}
}... | TOOL | 0.866364 | 4.361592 |
6809c6c4-d0f0-4d14-ad3d-cff412eec691 | naquee-rizwan/Other_Codes | linked_list.cpp | #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
struct node
{
ll val;
struct node *next;
};
struct node * initialize(ll value)
{
struct node * head = (struct node *) malloc(sizeof(struct node));
head->val=value;
head->next=NULL;
return head;
}
int main()
{
struct node * root = NULL;
cout<<"En... | ALGO | 0.999819 | 4.242552 |
31d7317f-164b-4252-be49-1e5009e2f17a | satyam071/DSA-with-C- | LeetCode/L7LeetCode.cpp | // // Reverse integerGiven a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.
// Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
// Example 1:
// Input: x ... | ALGO | 0.999695 | 4.345315 |
225e68b1-e159-49ec-ba8f-a4a636bb5805 | haomingchan0811/Leetcode | 328. Odd Even Linked List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
// O(N) time, O(1) space: 32.9%, ok
ListNode* oddEvenList(ListNode* head) {
if(!head) return head;
ListNode* odd... | ALGO | 0.999963 | 5.91785 |
384ebad9-e77d-48f5-bf17-67d4d4833d29 | Only-Shahbaz/CPP | Overloading.cpp | #include<iostream>
using namespace std;
int fun(int a, int b){
int c =a+b;
return c;
}
int fun(int a, int b, int c){
int d =a*b*c;
return d;
}
int main(){
cout<<fun(20,40, 10);
return 0;
}
| TOOL | 0.992997 | 3.941294 |
867d2f90-aca8-4202-b8fa-fc5f9a687046 | gauravdubey157/CPP-Codes | try81.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=1;i<=n;i++)
{
for(int j=n;j>i;j--)
{
cout<<" ";
}
if(i<n/2)
{
for(int k=0;k<2*i-1;k++)
{
cout<<"*";
}
}
cout<<endl;
... | ALGO | 0.999974 | 3.870449 |
2956430f-126c-4c5c-a4f0-8c6b593c2e30 | jakehsiao/Highway-path-planning | src/Eigen-3.3/bench/spbench/test_sparseLU.cpp | // Small bench routine for Eigen available in Eigen
// (C) Desire NUENTSA WAKAM, INRIA
#include <iostream>
#include <fstream>
#include <iomanip>
#include <unsupported/Eigen/SparseExtra>
#include <Eigen/SparseLU>
#include <bench/BenchTimer.h>
#ifdef EIGEN_METIS_SUPPORT
#include <Eigen/MetisSupport>
#endif
using namesp... | ALGO | 0.992548 | 4.273294 |
73491303-6cb7-4b21-b3f8-1644a4f6ff9d | raincross7/code-similarity | codes/train_code/problem405/problem405_482.cpp | #include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
int n;
cin>>n;
vector<int... | ALGO | 0.999979 | 3.280622 |
2e975a32-2bef-48f3-b217-9f1079cc6849 | codycarroll/tPACE_Python | src/eigen-3.4.0/bench/benchmarkX.cpp | // g++ -fopenmp -I .. -O3 -DNDEBUG -finline-limit=1000 benchmarkX.cpp -o b && time ./b
#include <iostream>
#include <Eigen/Core>
using namespace std;
using namespace Eigen;
#ifndef MATTYPE
#define MATTYPE MatrixXLd
#endif
#ifndef MATSIZE
#define MATSIZE 400
#endif
#ifndef REPEAT
#define REPEAT 100
#endif
int mai... | ALGO | 0.893694 | 3.371454 |
1d9b5f99-2179-4ad7-b47a-337e31d06626 | sufykhan/Codeforces | A_D_j_Vu.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long intl;
typedef vector<intl> vi;
typedef pair<intl,intl> pi;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define rep(i,a,n) for(intl i=a;i<n;i++)
void FASTIO(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
voi... | ALGO | 0.999696 | 3.75985 |
e9c6bff0-88c9-4b78-b469-425cff827afa | ndwannafly/ITMO-Algorithms-Data-Structures | H/main.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
#define NMAX 100005
int n, k;
int a[NMAX], s[NMAX];
void subtask_dp_n2(){
int dp[NMAX];
memset(dp, 0, sizeof(dp));
for(int i = 1; i <= n; i++){
for(int j = i; j >= 1; j--){
int free = (i - j + 1) / k;
... | ALGO | 0.99991 | 3.338224 |
43cab6a9-8f22-4ef7-a268-f24d6615cbcb | Rakshitpant22/Code_Kosh | Concepttt/mincoin.cpp | #include <iostream>
#include <vector>
#include <cstring>
using namespace std;
int main(){
int n,x;
cin>>n>>x;
vector<int>arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
// memset(dp,1e9,sizeof(dp)); memset can only change value to -1 0 only
vector<vector<int> >dp(n+1,vector<int>(x+1,1e9));
for(int i=0;i<=x;i++){... | ALGO | 0.999958 | 3.995353 |
65ff0b65-e0df-4334-b125-016f91c94ba0 | anuragdogra2192/Data_Structure_CPP | ForloopsAndBasics/Halfpyramid.cpp | #include<iostream>
using namespace std;
void printHalfPyramid(int nrows)
{
//r - row
//c - col
for(int r=0; r<nrows; r++)
{
for(int c = 0; c<r+1; c++)
{
cout<<"* ";
}
cout<<endl;
}
}
int main()
{
int n;
cin>>n;
printHalfPyramid(n);
retu... | ALGO | 0.999751 | 3.964377 |
ef9eb79c-eed2-4fef-98ec-e19e09ad8616 | ishandutta2007/codeforces | latte0119/normal/725/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v)... | ALGO | 0.999934 | 3.423813 |
1ea21519-722d-43da-9484-a87f7e81e047 | JyotinderSingh/Algorithms | LeetCode/linked-list-cycle-ii.cpp | // https://leetcode.com/problems/linked-list-cycle-ii/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution
{
public:
ListNode *detectCycle(ListNode *head)
{
if (!head || !head->next)... | ALGO | 0.999902 | 5.796088 |
7d2a57af-ed74-4f66-8a1b-574dc040322b | De-Seam/Raytracer | RayTracer/raytracer.cpp | #include "precomp.h"
#include "raytracer.h"
om::vec3 ReflectionDirection(om::vec3 direction, om::vec3 normal)
{
return direction - normal * om::dot(direction, normal) * 2;
}
om::vec3 RefractionDirection(om::vec3 intersectionPoint, om::vec3 normal, float eta)
{
eta = 2.0f - eta;
float N_dot_I = om::dot(normal, inte... | ALGO | 0.96879 | 4.814517 |
8f163d6b-5b7f-44bd-a58d-de4808561ccb | edmont87/albcoin | src/node/psbt.cpp | #include <amount.h>
#include <coins.h>
#include <consensus/tx_verify.h>
#include <node/psbt.h>
#include <policy/policy.h>
#include <policy/settings.h>
#include <tinyformat.h>
#include <numeric>
PSBTAnalysis AnalyzePSBT(PartiallySignedTransaction psbtx)
{
// Go through each input and build status
PSBTAnalysis ... | ALGO | 0.888151 | 6.027668 |
fe9d2279-54e6-496a-b0ba-a4c2628e3fbe | shadeel-han/ACM_Code | PKU/pku2155.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int cell[1001][1001];
int lowbit[1001];
int maxsize;
int getsum ( int x, int y )
{
int ans = 0;
for( int i=x; i>0; i-=lowbit[i] )
for( int j=y; j>0; j-=lowbit[j] )
ans += cell[i][j];
return ans;
}
void change ( int x, int y, int data )
{
f... | ALGO | 0.999889 | 3.466612 |
af205f60-c35d-446b-9b48-d2bb9349e183 | guru-divine/Codeforces_Code | 1359_c.cpp | //Author: DIVYA RAJ
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define nl "\n"
#define pb push_back
#define popb pop_back
#define F first
#define S second
#define sz(arr) arr.size()
#define vi vector<int>
#define vs vector<string>
#define pii pair<int, int>
#define mapi map<int, int>
#define un... | ALGO | 0.999552 | 4.388381 |
60915f41-3778-42ea-9a68-697b878b08b8 | Shaheenvp/cash_book_flutter | 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 |
774160ad-6785-4274-a2f4-31b5d6cc4c5f | min9813/algorithm_contest | contest/abc20200510/c.cpp | #include <iostream>
#include <functional>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <map>
#include <iomanip>
#include <unordered_set>
// #include <prettyprint.hpp>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;++i)
#define... | ALGO | 0.99954 | 3.740615 |
0fde937c-1656-476f-99ea-9d64ec981d79 | Yawn-Sean/Daily_CF_Problems | daily_problems/2024/09/0930/personal_submission/cf946d_tsreaper.cpp | #include <bits/stdc++.h>
#define MAXN 500
#define MAXM 500
#define INF ((int) 1e9)
using namespace std;
int n, m, K, ans;
char A[MAXN + 10][MAXM + 10];
int B[MAXN + 10][MAXM + 10], f[MAXN + 10][MAXM + 10], g[MAXM + 10];
int main() {
scanf("%d%d%d", &n, &m, &K);
for (int i = 1; i <= n; i++) scanf("%s", A[i] +... | ALGO | 0.999759 | 3.848711 |
76d842f3-cd95-49e6-8858-5c1508f8e2e6 | HADEER-ESS/Leet_Code-Daily-Challenge- | 2845. Count of interesting subarrays/countInterestingSubarrays.cpp | #include <vector>
#include <unordered_map>
#include <iostream>
using namespace std;
class Solution {
public:
long long countInterestingSubarrays(vector<int>& nums, int modulo, int k) {
long long ans=0;
int prefixSum = 0;
unordered_map<int,int>mp;
mp[0]=1;
for(auto num : num... | ALGO | 0.999901 | 5.175634 |
545def63-48a0-4605-bd14-1a798dfec8f8 | vandana-kumari25/gfg-potd-cpp | March-2024/31-03-2024.cpp | /*
Author : Vandana Kumari
Date : 31/03/2024
Problem : Closest Neighbour in BST
Problem Link : https://www.geeksforgeeks.org/problems/closest-neighbor-in-bst/1
*/
//{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
struct Node {
int key;
struct Node* left;
struct Node* right;
};
// Util... | ALGO | 0.999974 | 6.268299 |
5c1421e5-4775-4fd8-a3dd-c75a5f524743 | Bahoniarz/Struktury2 | PriorityQueueHeap.cpp | #include "PriorityQueueHeap.h"
#include <stdexcept>
void PriorityQueueHeap::heapifyUp(int index) {
while (index > 0) {
int parent = (index - 1) / 2;
if (heap[index].priority > heap[parent].priority) {
std::swap(heap[index], heap[parent]);
index = parent;
}
el... | ALGO | 0.996757 | 6.242278 |
652fdfad-813f-42df-bf32-47229f5d12db | ishandutta2007/codeforces | andr0901/normal/1092/A.cpp | #pragma GCC optmize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for (int i = s; i < f; i++)
#define pii pair <int, int>
#define fs first
#define sc second
#define pb push_bac... | ALGO | 0.999399 | 3.442338 |
1a8efc4d-e2b2-4a70-8f2d-54a80e3ae170 | bmaronka/responsive-multi-counter | 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 |
893e29db-58c5-4d2f-9b24-b4f123eb3066 | BatInGotham/VJudgeCode | UVA-133.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define maxn 25
int n, k, m, a[maxn];
int go(int p, int d, int t);
int main()
{
while(scanf("%d%d%d", &n, &k, &m) == 3 && n)
{
for(int i = 1; i <= n; i++)
{
a[i] = i;
}
... | ALGO | 0.99995 | 3.01536 |
1c1f4725-05bf-4d3e-ad6a-4c7457dac21e | karladiaz19/piktur | piktur/.bundle/gems/eventmachine-1.0.8/ext/em.cpp | // THIS ENTIRE FILE WILL EVENTUALLY BE FOR UNIX BUILDS ONLY.
//#ifdef OS_UNIX
#include "project.h"
/* The numer of max outstanding timers was once a const enum defined in em.h.
* Now we define it here so that users can change its value if necessary.
*/
static unsigned int MaxOutstandingTimers = 100000;
/* The numb... | TOOL | 0.873329 | 7.692401 |
80c96e91-2c75-429b-9dc3-16c033aec498 | Saimouli7424/Data-Structures-Algorithms-Learning-Journey | leetcodequestions/46.cpp | //Permutations(Medium)
//using recursion and backtracking
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> permute(vector<int>& nums)
{
vector<vector<int>> result;
permutation(nums, result, 0);
return result;
... | ALGO | 0.999998 | 7.550025 |
edda60cf-3ad8-4285-a425-5b2ee8a4c414 | Simoxii48/CPP | 05- Algorithms & Problem Solving Level 2/29- Problem #29 (Prof Solution)/29- Problem #29 (Prof Solution).cpp | #include <iostream>
#include <cstdlib>
using namespace std;
enum enPrimeNotPrime { Prime = 1, NotPrime = 2 };
int randomNumber(int from, int to) {
return rand() % (to - from + 1) + from;
}
void fillArrayWithRandomNumbers(int arr[100], int& length) {
cout << "Please enter the array number of elements to fill ... | ALGO | 0.999562 | 3.865228 |
534f65bf-0b62-45f3-a9dc-94c77230fd12 | akshaybarya/Cpp___ | 51.cpp | // Array Challange 8
// Sub Array Challange 3
//Maximum Sum Sub Array by Kadane's Algorithm approach O(n)
#include<iostream>
using namespace std ;
int main()
{
int n ;
cin>>n;
int arr[n];
for(int i = 0 ; i<n ; i++){
cin>>arr[i];
}
// int start = 0 ;
int maxSum = -1 ;
int cur... | ALGO | 0.999958 | 4.197972 |
796db1ec-57d3-41c3-842c-0df8e3f7b2d7 | akamya997/PracticeCode | 201910_practice/singapore/g.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
#ifndef ONLINE_JUDGE
#define dbg(x...) do{cout << "\033[32;1m" << #x << "->" ; err(x);} while(0)
void err(){cout << "\033[39;0m" << endl;}
template<template<typename...> class T,typename t,typename... A>
void err(T<t> a,A... ... | ALGO | 0.999829 | 3.479061 |
3bc076d6-0aed-40b7-88b3-a41b95513858 | amihashemi/cs294project | Code/src/bchlai/FieldData.cpp | // Final project for CS 294-73 at Berkeley
// Amirreza Hashemi and Júlio Caineta
// 2017
#include "FieldData.H"
#include "DeltaVelocity.H"
FieldData::FieldData()
{
};
FieldData::FieldData(std::shared_ptr< FFT1D > a_fft1dptr, int a_ghosts)
{
m_ghosts = a_ghosts;
m_fft1dPtr = a_fft1dptr;
m_M = a_fft1dptr->getM()... | ALGO | 0.888898 | 4.466248 |
5d1c7673-3ea8-4e2f-8a04-6139566e27b6 | adityank11/DSA | strings/inclusionstring.cpp | // class Solution { Leetcode
// private:
// bool check(int a[26],int b[26])
// {
// for(int i=0;i<26;i++)
// {
// if(a[i]!=b[i]) return false;
// }
// return true;
// }
// public:
// bool checkInclusion(string s1, string s2) {
// //store freq for string s1
// int coun... | ALGO | 0.999885 | 5.480123 |
8157437f-42a0-404b-8ff4-2347335f24cc | Sumit1608/CodingNinjas_CompetitiveProgramming_Solutions | Lecture 12 DP-1/22 Adjacent Bit Counts.cpp | #include<bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
//time comp => O(101 * 101 *2*t)
//int32_t main(){
int main(){
//fill all the outputs with the numbers ending with 0 and 1 separately so that answer can be directly accessed
int dp[101][101][2];
for (int i = 0; i <= 100; i++)
... | ALGO | 0.999864 | 4.748066 |
64d81c50-a309-436f-8b55-a06b7fa3f1a1 | 1092772959/My-ACM-code | 2018夏/8.13/1008.cpp | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
#define maxn 100005
typedef long long LL;
struct Edge{
int to,next,id;
}edge[maxn<<1];
int n,a[maxn],head[maxn],dep[maxn<<1],cnt,pos[maxn],dfs_seq[maxn<<1],dfn,f[maxn<<1][20];
int L[maxn],R[maxn],dfs_clo... | ALGO | 0.999861 | 3.978961 |
2f2d397a-c2ac-4c27-9340-926cc87b9bb2 | thermotools/lammps_mie_fh | src/ML-IAP/mliap_model_quadratic.cpp | // clang-format off
/* ----------------------------------------------------------------------
Contributing author: Aidan Thompson (SNL)
------------------------------------------------------------------------- */
#include "mliap_model_quadratic.h"
#include "mliap_data.h"
#include "error.h"
#include <cmath>
using... | ALGO | 0.967211 | 5.996705 |
ba99f315-38ab-4af7-8934-1cb9737aa48a | Aswinraj040/customizable_fitness_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.998733 | 6.76775 |
fa9428d8-8d50-4349-af3d-d04dc326c17a | Ferfelipe30/VideoJuego-Naufragio-Gal-ctico- | Parcial_3Corte/Ejercicio2.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
struct Nodo{
string dato;
Nodo *siguiente;
};
void agregarPila(Nodo *&, string);
void sacarPila(Nodo *&, string &);
int main(){
Nodo *pila = NULL;
string num;
int m;
cout<<"Cuantos caracteres deseas introduccir: "<<endl;
cin>>... | ALGO | 0.924974 | 3.708296 |
a7ec9467-0b4e-4963-8d71-7865336c6a23 | baigalmaa-baatar/cpp_module | Module_08/ex01/Span.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Span.cpp :+: :+: :+: ... | TOOL | 0.907448 | 4.737893 |
b2001bec-4210-4368-ad0b-ed2641161293 | Jumulisa/Student-Score-Prediction-API | student_score_predictor/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.998417 | 6.76775 |
66a6eb6a-1c1d-40d5-b66a-dbd1df190e3d | Exr0nProjects/learn_cpp | problems/uva/pid/x11059/main_11059.cpp | /*
ID: spoytie2
TASK: 11059
LANG: C++14
*/
/*
* Problem 11059 (onlinejudge/pid/11059)
* Create time: Sun 26 Jan 2020 @ 14:22 (PST)
* Accept time: [!meta:end!]
*
* This is wrong answer somehow??
*/
#include <iostream>
#include <cstdio>
#include <tuple>
#include <vector>
#include <string>
#include <cstring>
#inc... | ALGO | 0.999502 | 4.805593 |
4d844fc2-c432-476d-8a26-c3a98f0c9716 | ESHAN-tech/C-Pinnacle | begineer/checkPerfect.cpp | #include <iostream>
using namespace std;
// checking weather the number is perfect or not
// perfect :- [6 = 1+2+3] , means to factor sum of the given number
void checkPerfect(int n){
int ans = n;
int sum = 0 ;
for(int i = 0 ; i < n ; i++){
if(n % i == 0){
sum += i ;
}
}
... | ALGO | 0.999524 | 4.112578 |
2d51c8f6-0842-41de-9bfe-47c8e3f5f96e | tasumath/algorithms-data-struction | Code-Sum02/code2.3.cpp | #include<iostream>
using namespace std;
int main(){
int N;
cin>>N;
for(int i=2;i<=N;i=i+2)
cout<<i<<endl;
} | ALGO | 0.997269 | 3.371797 |
3052f60d-ffbf-478f-bba4-e28e3cf84d09 | StavrosChryselis/hackerrank | Greedy/Cutting Boards.cpp | /*
****************************************************************
****************************************************************
-> Coded by Stavros Chryselis
-> Visit my github for more solved problems over multiple sites
-> https://github.com/StavrosChryselis
-> Feel free to email me at <EMAIL>
****... | ALGO | 0.99991 | 3.948263 |
26960c37-cf4b-47c0-9ce3-f40c3799a3c7 | HITS-MCM/gromacs-ramd | src/gromacs/gmxpreprocess/insert_molecules.cpp | #include "gmxpre.h"
#include "insert_molecules.h"
#include <algorithm>
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "gromacs/commandline/cmdlineoptionsmodule.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/filetypes.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs... | ALGO | 0.957246 | 4.860428 |
f592d829-459c-47ee-bb2f-44af160b48a9 | fernunex/CompetitiveProgramming | CodeForces/others/stacks.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(){
//Declaration
stack<string> books;
//Insertion
books.push("C++");
books.push("Java");
books.push("Python");
books.push("Ruby");
while(!books.empty()){
cout << books.top() << endl;
books.pop();// Remov... | ALGO | 0.974299 | 4.585943 |
ab45f38f-29ee-4ff6-b514-ae70cc699926 | Orcuslc/Learning | LeetCode/698. Partition to K Equal Sum Subsets.cpp | class Solution {
public:
bool canPartitionKSubsets(vector<int>& nums, int k) {
int sum = 0;
for(int i: nums) sum += i;
if(sum % k != 0) return false;
sum /= k;
sort(nums.begin(), nums.end(), cmp);
vector<int> vis(nums.size(), 0);
return dfs(nums, vis, 0, sum,... | ALGO | 0.999978 | 5.800354 |
9137b630-4dae-4000-84f2-20eba83fc548 | lixinsu/primary_code | poj1008.cpp | #include<iostream>
#include<string.h>
#include<vector>
using namespace std;
char haab_mon[19][10] = {"pop", "no", "zip", "zotz", "tzec",
"xul", "yoxkin","mol", "chen", "yax",
"zac", "ceh", "mac", "kankin", "muan",
"pax", "koyab", "cumhu","uayet"};
char tz_day[20][10] = {"imix", "ik", "akbal", "kan", "... | ALGO | 0.999455 | 3.77557 |
3b17fe7a-dd39-449b-93cc-5ff7f9641f8b | MariaChrysafis/CompetitiveProgramming | LeetCode/2059.cpp | class Solution {
public:
int minimumOperations(vector<int>& nums, int start, int goal) {
vector<long long> dp(1001);
for (int i = 0; i < dp.size(); i++) {
dp[i] = (int)1e9;
}
set<long long> s;
for (long long j: nums) {
s.insert(j);
}
nu... | ALGO | 0.999964 | 5.375739 |
79173721-1c80-4a2f-bd32-1f24c0b76bfc | chuanzzx/Leetcode | 206 Reverse Linked List.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* reverseList(ListNode* head) {
ListNode *p = 0;
while (head != 0) {
ListNode *t = head;
... | ALGO | 0.999986 | 5.547506 |
d9211d98-0f71-41c4-9825-ed56553667ca | edsonlnunes/formacao_flutter_fase_7 | ios_map_class/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.997842 | 6.785645 |
79b761d3-8a79-4148-9b6b-74694f7b6077 | guilhermekameoka/UFU | IPC/1041.cpp | // 1041
#include <stdio.h>
int main (){
int x, y;
scanf("%f %f", &x, &y);
if (x==0 && y==0){
printf("Origem\n");
}else if (x==0 && y!=0){
printf("Eixo Y\n");
}else if (x!=0 && y==0){
printf("Eixo X\n");
}else if (x>0 && y>0){
printf("Q1\n");
}else if (x>0... | ALGO | 0.99987 | 3.633597 |
69227460-1ddc-43bf-a5e7-ea956689d29f | Manuel-Coggiola-Molinari/TP-2-Cadena-de-caracteres | Punto 7.cpp | #include <stdio.h>
#include <string.h>
char cadena1[200], cadena2[200];
int frecuencia1[26] = {0}, frecuencia2[26] = {0}, i, sonAnagramas = 1;
main() {
printf("Ingrese la primera cadena (no coloque mayusculas): ");
fgets(cadena1, sizeof(cadena1), stdin);
printf("Ingrese la segunda cadena (no coloque ma... | ALGO | 0.999451 | 3.706613 |
cc8dc5e4-7bc0-4bc1-b529-86e30cc9e184 | MustangYM/ShelbyObfuscator | llvm/tools/llvm-cov/CodeCoverage.cpp | #include "CoverageExporterJson.h"
#include "CoverageExporterLcov.h"
#include "CoverageFilters.h"
#include "CoverageReport.h"
#include "CoverageSummaryInfo.h"
#include "CoverageViewOptions.h"
#include "RenderingSupport.h"
#include "SourceCoverageView.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringRef.h"
#... | TOOL | 0.870439 | 7.906036 |
046d617d-b124-44bc-ade4-415479aba709 | ithsarasak/Programming | Compettitive programming/ComO/o49/Apr/o49_apr_light.cpp | #include<bits/stdc++.h>
using namespace std;
long long query[100100];
long long l, n;
long long seg[400100], lz[400100];
vector<int> coor;
void build( int l, int r, int now )
{
if( l == r ){
seg[now] = coor[l+1] - coor[l];
return ;
}
int mid = ( l + r ) / 2;
build( l, mid, now * 2 );
... | ALGO | 0.999968 | 3.05784 |
40d7f0f5-27b8-431f-8c6a-f12891b000d8 | peidong/frog_website_all | llvm-2.9/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp | using namespace llvm;
STATISTIC(NumEdgesInserted, "The # of edges inserted.");
namespace {
class OptimalEdgeProfiler : public ModulePass {
bool runOnModule(Module &M);
public:
static char ID; // Pass identification, replacement for typeid
OptimalEdgeProfiler() : ModulePass(ID) {
initializeOptima... | TOOL | 0.862562 | 7.362119 |
a8991d24-76f0-4787-a9a3-b3a79503f9a1 | AndyLawQAQ0109/Leetcode_Problems | Leetcode_46.cpp | class Solution {
public:
vector<vector<int>> permute(vector<int>& nums) {
int len = nums.size();
vector<vector<int>> ans = vector<vector<int>>();
if(len == 1){
vector<int> ele;
ele.push_back(nums[0]);
ans.push_back(ele);
return ans;
}
... | ALGO | 0.999995 | 6.199803 |
70e2a442-706c-4cc0-a823-a7e75af4a502 | annieshenca/C-Cpp_Programming | LCA - Sparse Table.cpp | /*
Lowest Common Ancestor Problem
Option #3: Sparse Table
Time Complexity: O(nlogn).
Steps:
1. From u, go all the way up to the root and record all vertices along the way.
2. From v, same thing go up to root, but stop if we encounter a common vertex for the first time.
https://www.hackerrank.com/topi... | ALGO | 0.998758 | 4.683347 |
e37724e1-a019-4ce3-8c0d-a950e5a6cf89 | ssavi-ict/UVa-Online-Judge | UVa - 10976 - Factors Again.cpp | #include<bits/stdc++.h>
using namespace std;
vector<int>up;
vector<int>down;
int main()
{
int n, tot;
while(scanf("%d",&n)==1)
{
up.clear();
down.clear();
tot = 0;
for(int i = n+1; i<=2*n; i++)
{
int top = i*n;
int bot = i-n;
if(to... | ALGO | 0.999502 | 3.426187 |
d92d7204-4dc4-4d37-b5f7-2ae640c357e9 | Rishi-11-2/CP | A_Channel.cpp | #include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
void solve();
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.setf(ios::fixed);
cout.precision(10);
srand(time(NULL));
int t;
cin >> t;
while (t--)
{
solve();
}
}
voi... | ALGO | 0.999986 | 3.882533 |
118e52db-72ab-452c-ba3f-abbf455d93b5 | Mccrae15/Unreal-engine- | Engine/Source/Runtime/SignalProcessing/Private/MelScale.cpp | #include "DSP/MelScale.h"
#include "CoreMinimal.h"
#include "DSP/FloatArrayMath.h"
namespace
{
// Fill an array with a triangle. Slopes do not need to match.
void FillArrayWithTriangle(const float InLowerIndex, const float InCenterIndex, const float InUpperIndex, int32& OutOffsetIndex, TArray<float>& OutArray)
{
... | ALGO | 0.972274 | 6.50529 |
3fdbd13c-69a2-45c2-a44b-86120146544f | ebisenttt/atcoder | abc187/d/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define INF 1e9
typedef long long ll;
... | ALGO | 0.999528 | 3.806247 |
c5444847-08eb-4aad-9380-49180568beca | hayden-williams/ECE4122FinalProject | AntPile.cpp | // AntPile.cpp
// 4122_final_project
#include <string>
#include <iostream>
#include <cmath>
#include "AntPile.hpp"
using namespace std;
/*AntPile::AntPile() {
x = 0; // give ant pile randomly generated x coord from main
y = 0; // give ant pile randomly generated y coord from main
searchRadius = 0.0; // ... | TOOL | 0.9708 | 3.981262 |
8cbe2731-4d0b-40ba-9efa-a8a9b638f230 | ThrunGroup/maptree | maptree/src/search/befs_map_search.cpp | #include <cassert>
#include <chrono>
#include <forward_list>
#include <queue>
#include <set>
#include "search/befs_map_search.h"
constexpr int BestFirstSearchMAPSearch::INF_EXPANSIONS;
constexpr int BestFirstSearchMAPSearch::INF_TIME_LIMIT;
Solution BestFirstSearchMAPSearch::search() {
bool hasExpansionLimit = e... | ALGO | 0.999991 | 7.852634 |
c184dfb5-a21a-40c7-9bea-9f5d642b0b31 | CodeChivalry/TLE_2 | Week-12/binary_search_iterative.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<"enter size";
cin>>n;
vector<int> arr(n);
for(int i=0;i<n;i++){
cin>>arr[i];
}
int target;
cout<<"enter target";
cin>>target;
int si=0;
int ei=n-1;
while(si<=ei){
int mid=si+(ei-si)/2;
... | ALGO | 0.999812 | 5.652637 |
ee4a3b1e-2a88-4721-87ff-3bc499275c70 | kandika-Rohan/leetcode-practicing | Difficulty: Easy/Count pairs with given sum/count-pairs-with-given-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int countPairs(vector<int> &arr, int target) {
// Code here
unordered_map<int,int>map;
int count=0;
for(auto it:arr){
int v... | ALGO | 0.999309 | 6.206701 |
d39ac3e2-8a98-43bf-9363-5d418c6332a8 | kohinigeee/abc | 219/219-D.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#define MAXV 1000
using namespace std;
using vvi = vector<vector<int>>;
using vvvi = vector<vvi>;
int disi(int x, int y ) {
return max(x-y, 0);
}
int main()
{
int n,x,y;
vector<int> a,b;
cin >> n;
cin >> x >> y;
for ( int i = 0; i < n; ++i ) {
... | ALGO | 0.999953 | 3.838704 |
2b9c5be8-a4ff-423b-8f0c-1882687ce12a | nilesh-tiwari244/DSA-code-practice | linked_list_reverse.cpp | #include<iostream>
#include<vector>
using namespace std;
class node{
public:
int data;
node* next;
node(int a)
{data=a;
next=NULL;
}
void display(node* head){
node* i=head;
while(i!=NULL)
{cout<<i->data<<" ";
i=i->next;
}
return;
}
... | ALGO | 0.999919 | 4.505343 |
8b6ada93-ebd9-44a8-9fa2-defae606f8f1 | zxok365/mandrake | contest/2015-08-02-ZOJ-Monthly-July-2015/B.cpp | #include<cstdio>
using namespace std;
int main()
{
int n;
while(scanf("%d", &n) == 1)
{
if(n == 0) puts("fail");
else puts("win");
}
return 0;
}
| ALGO | 0.999324 | 3.067501 |
d9b0e6a8-307f-4d1c-96d5-8a0bc1b3c0e4 | tyler-jurczyk-2020/cuda_gpu | Project/project/third_party/eigen/doc/examples/class_FixedVectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived, 2>
firstTwo(MatrixBase<Derived>& v)
{
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
}
template<typename Derived>
const Eigen::VectorBlock<const Derived, 2>
firstTwo(c... | TOOL | 0.933805 | 5.200637 |
36afc148-8864-4778-8b95-a088474c0888 | Radam7nthyZ/ejercicio_7 | 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 |
6b3b6ebd-7d99-43c4-82b4-5eb16d929918 | kubapoke/LeetCode | Easy/Two-Sum.cpp | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
int i = 0, j = nums.size() - 1;
vector<pair<int, int>> indexed_nums;
for(int k = 0; k < nums.size(); k++)
indexed_nums.push_back(make_pair(nums[k], k));
sort(indexed_nums.begin(), indexed_nums... | ALGO | 0.9999 | 6.254112 |
4bfe953f-4528-46b0-b697-34390c3ac09a | Zengrane/ardupilot | libraries/AP_JSON/AP_JSON.cpp | /*
ArduPilot JSON parser, based on picojson.h cloned from:
https://github.com/kazuho/picojson
*/
#pragma GCC optimize("Os")
#define ALLOW_DOUBLE_MATH_FUNCTIONS
#include "AP_JSON.h"
#include <AP_Filesystem/AP_Filesystem.h>
#include <AP_Math/AP_Math.h>
#include <stdio.h>
/*
load JSON file, returning a value ... | TOOL | 0.884048 | 3.237433 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.