uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
7c5f2bda-fa93-4203-84ce-1165571c6b69 | mosabbeer/Problem_Solving | B_Middle_Class.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
int t;
cin >> t;
while (t--)
{
int n, x;
cin >> n >> x;
ll a[n + 1], sum = 0, count = 0, no = 0;
int i;
for (i = 0; i < n; i++)
cin >> a[i];
sort(a, a + n);
... | ALGO | 0.999909 | 3.775789 |
8a6542b4-611d-46b0-bc4f-b737ae600e6f | BitwiseAditya/Cpp_STL_CommonlyUsedAlgorithms | C and C++ Topic Specific Codes/HashingUsingMap.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
//pre-compute
unordered_map<int, int> hash;
for(int i=0;i<n;i++){
hash[arr[i]] += 1;
}
//iterating the map
/* for(auto it : hash){
... | ALGO | 0.999861 | 4.118632 |
678d91a5-d503-47ab-81d1-8010ea661ddf | TrifanBogdan24/Probleme-PBINFO | pbinfo/coduri-cpp/clasa-XI/dmin.cpp | // #1604 - DMin
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
ifstream f("dmin.in");
ofstream g("dmin.out");
int n, m, i, j, x, y, k, lg[105];
bool a[105][105], pus[105];
vector<int> v[105];
queue<int> q;
int dfs(int x, int y)
{
for (int i =... | ALGO | 0.999983 | 4.347727 |
5628fdff-ea9d-4b43-9a0e-eccf2c47c864 | miguelvh-coder/app_miercoles-main | 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 |
989623af-a7a6-48a1-824a-2a04a0382572 | YueZhang-studyuse/LMAPF-delay | src/MAPF-LNS2/src/SpaceTimeAStar.cpp | #include "SpaceTimeAStar.h"
void SpaceTimeAStar::updatePath(const LLNode* goal, vector<PathEntry> &path)
{
num_collisions = goal->num_of_conflicts;
const LLNode* curr = goal;
if (curr->is_goal)
curr = curr->parent;
path.reserve(curr->g_val + 1);
while (curr != nullptr)
{
path.emplace_back(cur... | ALGO | 0.999937 | 3.955741 |
cbacdec3-e2be-452d-a531-152ee7cacdb5 | ss5ssmi/OJ | codeforce/CF_1009A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,c[1000],a[1000];
cin>>n>>m;
for(int i=0;i<n;i++){
cin>>c[i];
}
for(int i=0;i<m;i++){
cin>>a[i];
}
int cnt=0;
for(int i=0,j=0;i<n && j<m;i++){
if(a[j]>=c[i]){
j++;
cnt++;
}
}
printf("%d\n",cnt);
return 0;
}
| ALGO | 0.999753 | 3.339864 |
997ed192-1364-4368-bf7c-1d5f764fc43b | RainyDay7/LeetCode | dfs/99recoverTree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// O(n) space complexity
class Solution {
public:
void recoverTree(TreeNode *root) {
vector<TreeNode*> list;
... | ALGO | 0.999993 | 6.405246 |
27308f7e-a0f0-4f23-a522-b6b415e4ba14 | WilliamMcAvoy77/Arowanacoin2 | src/rest.cpp | #include <attributes.h>
#include <chain.h>
#include <chainparams.h>
#include <core_io.h>
#include <httpserver.h>
#include <index/txindex.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <rpc/blockchain.h>
#include <rpc/protocol.h>
#include <rpc/server.h>
#include <streams.h>
#include <sync.... | WEB | 0.904319 | 3.720111 |
d85254c3-e967-4ff1-9747-5dc0a2ffe216 | Ali-Elshorpagi/GDSC-SW-Dev | Week 01/area.cpp | #include <iostream>
using namespace std;
/**
* main - a program that calculates the area of a circle given it radius
* Return: Always 0 (Success)
*/
int main()
{
double r, area;
// read the radius from user
cin >> r;
// calculates the area based on the equation
area = 3.14 * r * r;
// pr... | ALGO | 0.991473 | 4.130458 |
cf3fa00b-be0d-4e29-99f7-ed9221714654 | Frankie-2000-F/PAT_Advanced-Level | 1053/1053/源.cpp | #include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
using namespace std;
struct node{
int weight;
bool hasChild = false;
node* parent = NULL;
};
node nodes[100];
int n, m, s;
vector<vector<int>> paths;
void DFS(node a){
int sum = 0;
node node = a;
stack<int> weights;
vector<int> path;
wh... | ALGO | 0.999949 | 3.614234 |
000f36a6-dc13-450b-a08d-1e02b22c2825 | Oscar-Cabr/CompetitiveProgramming | Codeforces/800-900/746A - Decoding.cpp | /*
The following is an original solution to the problem: 746-A "Decoding" of Codeforces.
Rated difficulty: 900. Language: C++20 (GCC 13-64).
This solution isn't secured as "the most efficient one", but it is secured as an Accepted one under the given constraints.
Techniques / Topics involved: Adhoc, Imp... | ALGO | 0.999982 | 5.25227 |
7668ac99-424c-4f3d-b36c-ab90cca654cb | Prerna99-star/LeetCodeProblems | 1732. Find the Highest Altitude.cpp | class Solution {
public:
int largestAltitude(vector<int>& gain) {
int ans=0, sum=0;
for (int i=0; i<gain.size(); i++){
sum+=gain[i];
ans= max(sum,ans);
}
return ans;
}
};
| ALGO | 0.999792 | 5.909713 |
970dc969-94f5-40be-b70b-935149a61f13 | Evertume/PP1 | assignment_8/N.cpp | #include <iostream>
#include <set>
using namespace std;
int main(){
int n;
cin >> n;
set<int> s;
for(int i = 0; i < n; i++){
int x;
cin >> x;
s.insert(x);
}
int sum = 0;
for (set<int>::iterator it = s.begin(); it != s.end(); ++it)
{
if ((*it) % 2 != 0... | ALGO | 0.999419 | 4.001828 |
390f24b9-650c-471b-9e9b-79fc47e843a6 | bira37/problem-solving | Codeforces/Official Rounds/Educational Round 36/C.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define endl '\n'
#define mod(n) (n%1000000007)
#define pb push_back
#define ii pair<int,int>
#define vii vector< ii >
#define LL_MAX LLONG_MAX
#define LL_MIN LLONG_MIN
#define ff first
#define ss second
#define int ... | ALGO | 0.999922 | 5.205385 |
b7e08aee-eb95-49d1-8a5f-8e5226b79de0 | GarryMarkus/codes-documentation | c++ and dsa/redundantData/bit++.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int x;
string a;
cin >> x;
int t=0;
for(int i=0; i<x; i++){
cin >> a;
if(a=="++X") ++t;
if(a=="X++") t++;
if(a=="--X") --t;
if(a=="X--") t--;
}
cout << t;
return 0;
} | ALGO | 0.999648 | 3.857814 |
292441c5-aa72-44c8-b680-f6222c031f13 | vipink403/Leetcode | Combinations.cpp | //https://leetcode.com/problems/combinations/
//https://www.youtube.com/watch?v=fqrOsZdKegQ&list=PLzffTJx5aHaSJ4XaG55cI3Z0VrNOyLWpH&index=2&t=185s
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <algorithm>
using namespace std;
template<typename T>
void print(T& container)
{
for (au... | ALGO | 0.999915 | 5.580724 |
6785bbc5-a3e9-4918-82cb-f2a12a4b2e30 | ishandutta2007/codeforces | marckess/normal/655/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 < n; i++)
#define forr(i,a,b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb(x) push_back(x)
using namespace std;
typedef long l... | ALGO | 0.999964 | 3.862411 |
c5dc83eb-26d0-4e27-9f75-799546a4d286 | ishandutta2007/codeforces | piyushsethia1999/normal/837/E.cpp | #include <bits/stdc++.h>
#define pb emplace_back
#define fi first
#define se second
#define int long long
using namespace std;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) { uniform_int_distribution<int> uid(0, l - 1); return uid(rang); }
int32_t main() {
ios::sync_... | ALGO | 0.999979 | 4.179058 |
ee819271-10bd-439f-af13-cb96910fd2a6 | upbhushan/CP | E170/1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin>>t;
while(t--){
string s1,s2; cin>>s1>>s2;
int n=s1.length();
int m=s2.length();
int k= n > m ? m: n;
int cnt=0;
for(int i=0;i<k;i++){
if(s1[i]!=s2[i]){
break;
... | ALGO | 0.999953 | 4.697845 |
663d00cd-59a1-4e6f-bfdd-6daded11f8da | nikhilsinha822/CP | CP problems/C_Word_on_the_Paper.cpp | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pB pop_back()
#define mp make_pair
#define sc second
#define fr first
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cout.precision(15); cout << fixed;
ll t;
cin >> t;
whi... | ALGO | 0.998455 | 3.364628 |
7886738f-42bf-45b9-ab33-fdf676c6fdb0 | shreyansh2407/DSA-busted | C++/conditional2.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cout<<"Enter your number"<<endl;
cin>>n;
if(n>0){
cout<<"Number is positive"<<endl;
}
else if(n<0){
cout<<"Number is negative"<<endl;
}
else{
cout<<"Number is zero"<<endl;
}
return 0;
} | ALGO | 0.994105 | 3.503776 |
2aca5d5d-6d34-46f9-ba88-9dcb8e446f12 | vinayaksahu/cpp-java-dsa | C++/7.Recursion/checkPalidrome.cpp | #include <iostream>
using namespace std;
bool checkPalidrome(string &str, int s, int e) {
//base case
if (s > e)
return true;
if (str[s] != str[e])
return false;
else {
//Recursive call
return checkPalidrome(str, s+1, e-1);
}
}
int main() {
string str = "aaaa... | ALGO | 0.999862 | 4.607398 |
a1667f88-1403-46bf-ba93-627927a754d4 | timnirmal/Depth-First-Maze-Solver-with-Recursive-and-Backtrack- | Another_Method.cpp | #include <iostream>
#include<bits/stdc++.h>
#include <cstdio>
#include <string>
#include "windows.h"
#include "Another_Method.h"
using namespace std;
vector < pair<int, int> > path;//The dynamic array path is used to store the path
vector < pair<int, int> > stackk;//The dynamic array path is used to store the path
... | ALGO | 0.999639 | 3.043867 |
aab64abf-4325-4ab6-8541-f63071a484ac | krajat0110/Leetcode | 0198-house-robber/0198-house-robber.cpp | class Solution {
public:
int rob(vector<int>& nums) {
if(nums.size()==1)return nums[0];
vector<int>dp(nums.size());
dp[0]=nums[0];
dp[1]=max(nums[0],nums[1]);
for(int i=2;i<nums.size();i++){
dp[i]=max(dp[i-1],dp[i-2]+nums[i]);
}
return dp[nums.size... | ALGO | 0.999832 | 5.836743 |
c8e6b0fe-401e-4bdc-b639-b0fb74590aea | Jengdeuk/Algorithm | Baekjoon/97.Rank/0.Bronze/10162.cpp | #include <iostream>
using namespace std;
const int Button[3] = { 300, 60, 10 };
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
int T;
cin >> T;
int Cnt[3] = {};
for (int i = 0; i < 3; ++i)
{
if (T >= Button[i])
{
Cnt[i] = T / Button[i];
T -= Button[i] * Cnt[i];
}
... | ALGO | 0.999654 | 3.798269 |
4dce5085-beda-4a96-b0c8-3e401c56e37d | pjakhar7/compco | 352b.cpp | #include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>
#include <climits>
#include <string>
#include <unordered_map>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <tuple>
#include <stack>
#include <iomanip>
using namespace std;
#define vi vector<int>
#define vl vecto... | ALGO | 0.999911 | 3.610233 |
c9a4defb-ea26-40ac-b033-4d524b1fcf2c | ZihanYuanCN/C | NYOJ-38-布线问题/NYOJ-38-布线问题/main.cpp | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <stdlib.h>
#define MAXS 0x7fffffff
using namespace std;
const int MAXN=510;
bool vis[MAXN];
long long int lowc[MAXN];
int cost[MAXN][MAXN];
long long int Prim(long long int n)
{
long long int ans=0;
mems... | ALGO | 0.999605 | 3.863903 |
08d2e85f-a6c6-4123-91d3-fde44a533542 | yuruhi/library | DP/LIS.cpp | #pragma once
#include <vector>
#include <algorithm>
#include <limits>
template <class T> int LIS(const std::vector<T>& a) {
constexpr T INF = std::numeric_limits<T>::max();
std::vector<T> dp(a.size(), INF);
for (auto num : a) {
*std::lower_bound(dp.begin(), dp.end(), num) = num;
}
return std::lower_bound(dp.beg... | ALGO | 0.999821 | 4.942956 |
d4d4a953-d4e4-40be-89a8-7e0d69c32026 | Khanna14Aman/codes | cp/c++/binarysearch.cpp | #include<iostream>
using namespace std;
void binarysearch(int a[],int search, int low, int high)
{
while(low<=high)
{
int mid=(low+high)/2;
if(a[mid]==search)
{
cout<<"\nelement found at"<<mid;
return;
}
else if(a[mid]>search)
{
return (binarysearch(a,search,low,mid-1));
}
else if(a[mid]<sear... | ALGO | 0.999417 | 4.681574 |
ec88c7c5-c081-4c09-abf3-553272385532 | richelbilderbeek/TriangleCpp | trianglecppotri.cpp | #include "trianglecppotri.h"
ribi::tricpp::Otri::Otri()
: m_apex{},
m_area_bound{0.0},
m_attributes{},
m_dest{},
m_is_infected{false},
m_orient{0},
m_origin{},
m_subsegs{},
m_triangles{}
{
}
boost::shared_ptr<ribi::tricpp::Triangle> ribi::tricpp::Otri::operator[](const int index) no... | ALGO | 0.88636 | 3.00677 |
15350314-98d0-42a2-8b7d-20dd333df703 | IshaRawat7/DSA | mazepath.cpp | #include<iostream> // move in right and downward direction only
using namespace std;
int mazepath(int n,int start,int end){
if(start == n-1 && end == n-1){
return 1;
}
if(start>= n || end >=n){
return 0;
}
return( mazepath(n,start+1,end) + mazepath(n,start,end+1));
}
int main(){
cout<<mazepath(4,0,0)<<en... | ALGO | 0.999982 | 4.320206 |
e83fd61a-5b58-4be9-b693-e77b7fb334af | west-window/west-window | 250416/흥미로운 숫자 2/interesting-numbers-2.cpp | #include <iostream>
#include <string>
using namespace std;
bool isInteresting(int n) {
string str = to_string(n);
for (int i = 0; i < str.length(); i++) {
int cnt = 0;
for (int j = 0; j < str.length(); j++) {
if (j == i)
continue;
else if (cnt == 2)
... | ALGO | 0.999553 | 4.346861 |
7a895513-ac5d-4311-ae20-2b7dd9fb4fbc | OzzieIsaacs/winmerge-qt | ext/boost_1_70_0/libs/compute/perf/perf_bolt_accumulate.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <bolt/cl/copy.h>
#include <bolt/cl/device_vector.h>
#include <bolt/cl/reduce.h>
#include "perf.hpp"
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
bolt::cl::control ctrl = ... | ALGO | 0.932709 | 4.653358 |
74cf5555-2ce9-4867-bf5a-1b6b151f846a | Axect/Cpp | Tutorial/vectormatrix/matrix.cpp | #include <iostream>
#include <vector>
#include <time.h>
using namespace std;
vector<vector<int>> Matrix(int m, int n) {
vector<vector<int>> array(m, vector<int>(n, 0));
return array;
}
int main() {
clock_t begin, end;
begin = clock();
int a = 10;
int b = 10;
vector<vector<int>> A = Matr... | ALGO | 0.975365 | 3.281155 |
2e7a3081-01e5-4980-b63b-1c727285f898 | ThomassTon/Narrow-Passage-Detection-and-Control-Algorithm-for-Autonomous-Ground-Robots | vehicle_controller/src/daf_controller.cpp | #include <vehicle_controller/daf_controller.h>
Daf_Controller::Daf_Controller(ros::NodeHandle& nh_)
: Controller(nh_), nh_dr_params("~/daf_controller_params")
{
if (followPathServerIsActive()) {
move_base_lite_msgs::FollowPathResult result;
result.result.val = move_base_lite_msgs::ErrorCodes::PREEMPTED;
... | TOOL | 0.982295 | 5.747581 |
9fc62f05-7b43-4e63-af7e-49bd5bd743bb | arm/arm-toolchain | libcxx/test/std/algorithms/alg.sorting/alg.min.max/min_element.pass.cpp | // <algorithm>
// template<ForwardIterator Iter>
// requires LessThanComparable<Iter::value_type>
// Iter
// min_element(Iter first, Iter last);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
std::mt19937 randomness;
template <class Iter>
void
t... | TEST | 0.966478 | 6.420899 |
14d7ce88-4e4b-411a-b269-34b337d3f951 | NHN-Rex/TDMU_2022-2023 | HK1/Data-structure-and-algorithm/DSLKD/InsertElement.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
node *createNode(int x){
node *temp = new node;
temp->data = x;
temp->next = NULL;
return temp;
}
node *addElement(node *l, int x){
node *temp = createNode(x);
l->next = temp;
return temp;
}
void printL... | ALGO | 0.999965 | 3.550063 |
f000d01d-c3a5-4b35-8675-949ab971f539 | PyoSH/KOREATECH_CPS_contest_2022 | TASK/main_0103.cpp | #include "VArduino.h"
#define TERMINATE '\t'
#define R_LINE_SNS_PIN A0
#define L_LINE_SNS_PIN A1
#define UP_MOT_PIN 5
#define DN_MOT_PIN 6
#define UP_SNS_PIN 7
#define DN_SNS_PIN 8
#define R_POW_PIN 10
#define L_POW_PIN 11
#define R_DIR_PIN 12
#define L_DIR_PIN 13
String cmd, data, buff;
bool LineOn(1);
int STEP =... | TOOL | 0.880902 | 5.135589 |
a993a718-2902-49cf-be8c-108b4dc0725c | ns-niam/Algorithm-and-data-structures- | cpp-main/ADS/lab 1/d.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
stack<char> st;
for (int i = 0; i < s.size(); i++){
if (!st.empty() && st.top() == s[i]) st.pop();
else st.push(s[i]);
}
cout << (st.empty() ? "YES" : "NO");
return 0;
} | ALGO | 0.999991 | 4.695234 |
9a70751f-a617-405c-b874-173c7d04edc2 | AkashkumarChoudhary/coding | dsa/LinkedListArmy/delete/deleteStart.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int data ;
Node *next;
Node(int value)
{
data =value;
next = NULL;
}
};
Node *CreateLinkedList (int arr[] , int index , int size)
{
if(index == size)
return NULL;
Node *temp = new Node (arr[index]);
temp ->next = Crea... | ALGO | 0.999495 | 4.041004 |
da74887f-b80c-43e2-ba65-831209aeb878 | hkatkade/CompetitiveProgramming- | Hackerearth/will_she_accept_him.cpp | #include<bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define M 100001
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define w(t) ll t;cin>>t;while(t--)
#define sort(a) sort(a.begin(), a.end());
using namespace std;
vector<int> g[M];
int vis[M];
vector<int> par(2 * M, -1);
vector<int>... | ALGO | 0.999961 | 3.820311 |
cde5d799-1481-4806-8668-b6748c40bfd8 | iamjinalshah/CodeCollection | LeetCode/Search in Rotated Sorted Array.cpp | //leetcode problem no. 33
class Solution {
public:
int search(vector<int>& nums, int target) {
int left=0;
int mid=0;
int right=nums.size()-1;
while(left<=right)
{
mid=left+(right-left)/2;
if(nums[mid]==target)
return mid;
... | ALGO | 0.999922 | 5.813133 |
4a181e09-db9b-40ea-8d6a-7ace22566caa | liuzz10/high-performance-computing | chrono_timer/p2.cpp | // In this program, we compute a sum of initialized value in vector
// and use chrono_timer to know the the executing time of the sum loop
#include <iostream>
#include <chrono>
#include <unistd.h>
#include <stdlib.h>
#include <vector>
int main (int ac, char *av[]) {
if (ac > 1) {
unsigned long long sum = ... | ALGO | 0.92339 | 4.551131 |
fd223fc1-2593-484e-9ba2-beac2f7a8c91 | ChanceMaker/C_Practice | TestTrees.cpp | #include <iostream>
//Tree examples in c++
struct node{
int data;
struct node* left;
struct node* right;
};
struct node* newNode(int data){
struct node* new_node= (struct node*)malloc(sizeof(struct node));
new_node->data = data;
new_node->left = NULL;
new_node->right = NULL;
return new_node;
}
int main(){
st... | ALGO | 0.992721 | 3.080561 |
8a792ac5-de3c-47d1-b715-1469b5982922 | Maria-Miroshnikova/Homeworks_SPbU | Homework_1/1_1_ex/1_1_ex/1_1_ex.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int x;
scanf("%d", &x);
const int secondDegree = x * x;
int polynomial = (secondDegree + 1) * (secondDegree + x) + 1;
printf("%d", polynomial);
return 0;
} | ALGO | 0.998748 | 3.472493 |
b1cf15e0-d9b2-4b6f-b616-e11cf09d6d12 | ijmp320/Competitive-Programming | AOJ/Volume/0118.cpp | #include <stdio.h>
#include <vector>
using namespace std;
// Property Distribution 2015/02/05 AC
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0118
int h,w;
int bd[100][100];
int tgt;
int dirx[4]={0,1,0,-1};
int diry[4]={-1,0,1,0};
void dfs(int x,int y) {
bd[y][x]=-1;
for(int i=0;i<4;i++) {
int n... | ALGO | 0.999521 | 3.652048 |
32db4fc9-b4fe-49a6-a778-9dbb9536eacd | ishandutta2007/codeforces | thienu/normal/1221/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define u_map unordered_map
#define u_set unordered_set
#define u_multiset unordered_multiset
using ll = long long;
using vvi = vector<vector<int>>;
using vi = vector<int>;
using vvll = vector<vector<long long>>;
using vll = vector<long long>;
using vd = vector<double>;
... | ALGO | 0.999894 | 4.194851 |
4ca28d65-4f4a-4c6a-bb14-19dc4d66529f | IvanDzanija/competitive_programming | CSES/Dynamic/minimizing_coins.cpp | #include <iostream>
#include <set>
#include <vector>
#define INF 1e18
using ll = int64_t;
int main(void) {
int n, x;
std::vector<ll> coins;
std::cin >> n >> x;
for (int m = n; m > 0; --m) {
ll coin;
std::cin >> coin;
coins.push_back(coin);
}
std::vector<ll> cache(x + 1... | ALGO | 0.999988 | 4.154099 |
3bf1b771-8800-4af6-90a7-9e210565ee11 | cahhbwy/hihocoder | 1033_Alternating Sums/1033_Alternating Sums.cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <string>
#define PQ priority_queue
#define OO 2147483647
#define Max(a, b) ((FASTBUFFER = ((a) - (b)) >> 31), ((b) & FASTBUFFER ... | ALGO | 0.999962 | 3.603198 |
974dad3c-ac46-4385-9ca5-aa3a822cd3d7 | KazuakiTokunaga/competitive-programming | book/tessoku/b03.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define all(x) (x).begin(),(x).end()
int main() {
int N;
cin >> N;
vector<int> A(N);
rep(i, 0, N) cin >> A[i];
rep(i, 0... | ALGO | 0.999972 | 4.130523 |
6bf177b8-3321-4f59-b0e2-3b37a72438fd | ayushpareek179/CPP-course | Part_Eight/Patterns.cpp | //To draw patterns using nested for loops
#include <iostream>
#include <cmath>
using namespace std;
int digits(int m) //Helper function for general padding
{
int count = 0;
while(m != 0)
{
m = m/10;
count++;
}
return count;
}
void SumRectangle(int n)
{
int sum = 0, max = n*n, s... | ALGO | 0.999756 | 4.554492 |
93183d0a-4094-4e77-b0b0-927b9bdc80cb | shinamikan/Xusory | XusoryEngine/Header/Core/Math/Private/Vector4.cpp | #include "../Vector4.h"
namespace XusoryEngine
{
Float4::Float4(FLOAT x, FLOAT y, FLOAT z, FLOAT w) : x(x), y(y), z(z), w(w) { }
Vector4::Vector4() : m_vector(_mm_setzero_ps()) { }
Vector4::Vector4(FLOAT x, FLOAT y, FLOAT z, FLOAT w) : m_vector(_mm_setr_ps(x, y, z, w)) { }
Vector4::Vector4(FLOAT scalar) : m_vecto... | TOOL | 0.895933 | 5.268866 |
6ea8805a-d103-41ee-89f2-d226062bba00 | kumarayush20/DSA_Proficiency | 1300-critical-connections-in-a-network/critical-connections-in-a-network.cpp | class Solution {
private:
int timer = 1;
private:
void dfs(int node, int parent, vector<int> &vis, vector<int> adj[], int tin[], int low[], vector<vector<int>> &bridges){
vis[node] = 1;
tin[node] = low[node] = timer;
timer++;
for(auto it : adj[node]){
if(it == parent... | ALGO | 0.999944 | 5.973255 |
a6e2d789-3a15-4e07-a15e-92085da471c3 | ishandutta2007/codeforces | andreysergunin/normal/319/D.cpp | #include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <ctime>
using namespace std;
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
s... | ALGO | 0.999988 | 3.281414 |
4296e88d-0ec1-4c31-8cce-511e80a5cf91 | RiddhiBarhate/DSA-in-Cpp | coding ninjas/Nth Fibonacci Number.cpp | #include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
int n;
cin>>n;
//step1
vector<int> dp(n+1);
//step2
dp[0]=0;
dp[1]=1;
//step3
for (int i = 2; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
cout << dp[... | ALGO | 0.999979 | 4.493989 |
ed8eb148-993d-4cb9-b57c-44f8678e0884 | peterjumper/neetcode | neetcode-main ans/cpp/0215-kth-largest-element-in-an-array.cpp | /*
Given array and int k, return kth largest element in array
Ex. nums = [3,2,1,5,6,4], k = 2 -> 5
Quickselect, partition until pivot = k, left side all > k
Time: O(n) -> optimized from O(n log k) min heap solution
Space: O(1)
*/
// class Solution {
// public:
// int findKthLargest(vector<int... | ALGO | 0.999949 | 5.874829 |
6360333b-add1-4ec5-a5cd-e4c69ad741f5 | AdminAbhi/MyCodeLib | LeetCode/String/459. Repeated Substring Pattern.cpp | class Solution {
public:
bool repeatedSubstringPattern(string str) {
return (str + str).substr(1, str.size() * 2 - 2).find(str)!=-1;
}
}; | ALGO | 0.999816 | 6.060911 |
3aa504b1-85a1-4a30-a0a7-e7a8cd289dc8 | timmyjose-experiments/competitive-programming | lc/coreprep/implementation/practice_iterations/dp_iterations_5/staircase_optimal.cpp | #include <algorithm>
#include <cmath>
#include <iostream>
#include <limits>
#include <list>
#include <queue>
#include <random>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
int next_random(int low, int high) {
random_device rd;
mt19937 engine(rd());
u... | ALGO | 0.99998 | 4.821105 |
0af9cf89-601c-4884-beae-4e547140c2a4 | saladibhaskar/leetcode | 121-best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.cpp | class Solution {
public:
int maxProfit(vector<int>& p) {
int min= p[0];
//p.erase(p.begin());
int max=0;
for(auto i:p)
{
if(i<min)
{
min=i;
}else
{
if(i-min>max)
{
max=i-mi... | ALGO | 0.999341 | 5.472307 |
209a4fbe-6712-4fee-9adb-74a76209d2ee | ak47kavan/chatApp | 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 |
4cbf48df-021a-4ef6-94f1-7e90f2a31ce3 | TejaBhai1510/Data_Structures_with_Code | Parenthesis_Matching.cpp | #include <iostream>
#include <cstring>
using namespace std;
class Stack{
private:
int size;
int top;
char* S;
public:
Stack(int size);
~Stack();
void push(char x);
char pop();
char peek(int index);
int isFull();
int isEmpty();
void display();
char stackTop();
};
Stack... | ALGO | 0.999775 | 4.85842 |
0c49d880-38b1-4de7-a095-0411028e7b01 | ankur0999/DSA_sem_2 | binary_search_tree/Graph/graph.cpp | #include<iostream>
#include<vector>
using namespace std;
class bfsNode{
public:
int data;
char color;
int dist;
bfsNode* parent;
bfsNode(int d){
data = d;
color = 'w';
dist = INT_MAX;
parent = NULL;
}
};
class dfsNode{
public:
char color;
int... | ALGO | 0.999918 | 4.633811 |
a5b2ccb1-de5d-4a14-ae35-9078a208e7c4 | kurozael/codekiddy | depends/box2D/source/b2PulleyJoint.cpp | #include <Box2D/Dynamics/Joints/b2PulleyJoint.h>
#include <Box2D/Dynamics/b2Body.h>
#include <Box2D/Dynamics/b2TimeStep.h>
// Pulley:
// length1 = norm(p1 - s1)
// length2 = norm(p2 - s2)
// C0 = (length1 + ratio * length2)_initial
// C = C0 - (length1 + ratio * length2) >= 0
// u1 = (p1 - s1) / norm(p1 - s1)
// u2 = ... | ALGO | 0.990255 | 6.983602 |
a2dbac61-2afd-4da3-ae3b-e7e913898f16 | AnsonJIang-Pku/Programming-Design-and-Internship-2023-Cpp-Syntax | 2023 程序设计实习之运算符重载作业/(STAR) E:别叫,这个大整数已经很简化了!.cpp | //最大问题:字符串处理的有问题。
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
using namespace std;
const int MAX = 110;
class CHugeInt {
private:
char s[210];
public:
void rev(char *p)
{
if (p)
{
int i = 0,j = strlen(p) - 1;
while( i < j )
... | ALGO | 0.998079 | 3.13475 |
8284f065-527f-4331-a2b0-58a22d93f58d | raghavraj-27/dsa | 856-score-of-parentheses/856-score-of-parentheses.cpp | class Solution {
public:
int scoreOfParentheses(string s) {
stack<int> st;
int score = 0;
for(int i=0; i<s.size(); i++) {
if(s[i] == '(') {
st.push(score);
score = 0;
} else {
score = st.top() + max(2*score, 1);
... | ALGO | 0.999749 | 5.470165 |
abc4a51e-ecd6-4ed3-8bc5-4b33a5471cb7 | pat4life360/LEAP-Camera-Face-Tracker- | 3rdparty/carotene/src/gaussian_blur.cpp | #include "common.hpp"
#include "saturate_cast.hpp"
#include "separable_filter.hpp"
namespace CAROTENE_NS {
bool isGaussianBlur3x3Supported(const Size2D &size, BORDER_MODE border)
{
return isSupportedConfiguration() && size.width >= 8 &&
(border == BORDER_MODE_CONSTANT ||
border == BORDER_MODE_... | ALGO | 0.991544 | 6.777441 |
b7181182-5cad-4aba-88e8-04d0ee8d95f4 | gaolingshan/leetcode | Text Justification/Source.cpp | // Text Justification
// Author: flashhack
// Update: 2015-01-15
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
class Solution_old {
... | ALGO | 0.998677 | 4.19045 |
559c9c50-2922-47d1-9249-8fb0ad395812 | matheuspf/mlpp | Optimization/TrustRegion/CauchyPoint/CauchyPoint.cpp | #include "CauchyPoint.h"
struct Rosenbrock
{
double operator () (const Vec& x) const
{
double r = 0.0;
for(int i = 0; i < x.rows() - 1; ++i)
r += 100.0 * pow(x(i+1) - pow(x(i), 2), 2) + pow(x(i) - 1.0, 2);
return r;
}
};
int main ()
{
CauchyPoint cp;
Vec x = Vec::Constant(2, 1.2);
... | ALGO | 0.982607 | 3.522885 |
7cdaaddf-11c6-4bbf-af22-f76e35737fb2 | mayanksayan/CODECHEF | profit increament.cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
for(int i=0;i<t;i++){
int x,y;
cin>>x>>y;
cout<<(x/10)+y<<endl;
}
return 0;
}
| ALGO | 0.994554 | 3.848117 |
baaa3ad3-12d4-4906-b069-3d4b818c832a | liza1212/DSA-Practical-Fourth-Semester- | lab5/lab5_01.cpp | #include <iostream>
#include <cassert>
using std::cin;
using std::cout;
using std::endl;
struct node
{
int data;
node *next;
} *start = NULL;
class l_list
{
private:
public:
l_list(int num)
{
insert_beg(num);
}
node *create(int num)
{
node *ptr;
ptr = new node;
... | ALGO | 0.999272 | 3.759128 |
b72e03ed-708f-4428-b90a-2e480d8d559c | devangigithub/Question-Bank | 1 pdf/p12.cpp | #include<iostream>
using namespace std;
int main()
{
int p;
int r;
int t;
float i;
cout<<"Principal:";
cin>>p;
cout<<"Rate:";
cin>>r;
cout<<"Time:";
cin>>t;
i=(p*r*t)/100;
cout<<"Simple Intrest is:"<<i;
return 0;
}
| ALGO | 0.988496 | 3.561887 |
7e06678f-b58f-4577-b917-ce2a5928d00f | savbatovasadbek/Issues_in_Cpp | Berilgan textdagi berilgan so'zlar soni/main.cpp | #include <iostream>
#include <string>
using namespace std;
//int foo (string text, string word) {
// int lenText = text.length();
// int lenWord = word.length();
// int sum = 0;
//
// do {
// int joy = text.find(word);
// if (joy >= 0 && joy < lenText) {
// sum++;
// te... | ALGO | 0.996888 | 4.897004 |
56c168cb-6db8-4fbe-88d5-0b99bef7f139 | vfolunin/archives-solutions | UVa Online Judge/11670.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
bool can(vector<double> &particles, double distance, double time) {
double last = particles[0] + time;
for (int i = 1; i < particles.size(); i++) {
if (last + distance < parti... | ALGO | 0.999739 | 4.539328 |
31e75431-2876-4d86-8f14-cd8374f8c3a8 | Amarjeet264/DSA-problems | 1554-minimum-time-to-collect-all-apples-in-a-tree/minimum-time-to-collect-all-apples-in-a-tree.cpp | class Solution {
vector<bool>has;
void dfs(int node,vector<int>adj[],int par,vector<bool>&hasApp){
has[node]=hasApp[node];
for(auto it:adj[node]){
if(it!=par){
dfs(it,adj,node,hasApp);
has[node]=has[node]|has[it];
}
}
}
int ... | ALGO | 0.999837 | 5.340522 |
0e5806bb-3f03-4037-b93e-d160fdded486 | r-uehara0219/AOJ | ALDS1/002B_selectionSort.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define PB push_back
#define MP make_pair
#define MEMSET(v,... | ALGO | 0.999965 | 3.409506 |
0398ddaa-1dc4-43af-8bbd-5bc0d244aca2 | TajwarSaiyeed/problem-solving-codechef-leetcode-codechef | 11-01-2025/A. Raising Bacteria.cpp | /*
Author: Tajwar Saiyeed
Date: 2025-01-11 18:31:53
File: A. Raising Bacteria.cpp
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using pbds = tree<T, null_type, less<T>, rb_tree_... | ALGO | 0.999977 | 4.888897 |
b32d3b9d-c65f-4198-b2e5-3792a0cf4855 | MAyang38/Gem5-CXL | src/systemc/tests/systemc/datatypes/fx/shift/operator_shift_right.cpp | /*****************************************************************************
operator_shift_right.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/***************************************************************... | ALGO | 0.893633 | 3.528465 |
b9903931-4021-4ff3-a4a1-8eaad8be07f5 | oryxantelope/LeetCode | 007 Reverse Integer.cpp | /**
* Reverse digits of an integer.
*
* Example1: x = 123, return 321
* Example2: x = -123, return -321
*
* click to show spoilers.
*
* Have you thought about this?
* Here are some good questions to ask before coding. Bonus points for you if you have already thought through this!
*
* If the integer's las... | ALGO | 0.999818 | 5.703592 |
9f226cc4-58c3-464f-bd97-29bd9fcc206e | bkyileo/algorithm-practice | leetcode/alibaba.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
return 0;
}
vector<int> target;
bool dfs(BinTree* root,int i)
{
if(!root)return false;
if(i==target.size()&&!root->l&&!root->r)return true;
if(root->v==target[i])
{
if(dfs(root->l,i+1))return true;
if(dfs(root->r,i+1))return true;... | ALGO | 0.99996 | 4.62435 |
32bdff7e-4807-4526-9cc1-c1747a8c83e6 | Rohansaini1512/DSA | StriverA2Z/tree/Recover.cpp | /*You are given the root of a binary search tree (BST), where the values of exactly two nodes of the tree were swapped by mistake. Recover the tree without changing its structure.
Example 1:
Input: root = [1,3,null,null,2]
Output: [3,1,null,null,2]
Explanation: 3 cannot be a left child of 1 because 3 > 1. Swapping 1 ... | ALGO | 0.999999 | 6.654962 |
6b8d1f07-fa34-46f3-a898-defa7b38c5c8 | Cartallum/llvm-project | lldb/test/API/commands/log/basic/main.cpp | #include <cstdlib>
#include <string>
#include <fstream>
#include <iostream>
int
product (int x, int y)
{
int result = x * y;
return result;
}
int
sum (int a, int b)
{
int result = a + b;
return result;
}
int
strange_max (int m, int n)
{
if (m > n)
return m;
else if (n > m)
ret... | ALGO | 0.93521 | 4.377622 |
1a21018c-f356-4822-b547-024c95202d1f | csyyysc/LeetcodeLab | cpp/Neetcode/Blind75/1D-DP/WordBreak.cpp | #include <string>
#include <unordered_map>
#include <vector>
class SolutionDFS {
std::unordered_map<int, bool> memo;
public:
bool wordBreak(std::string s, std::vector<std::string> &wordDict) {
return dfs(0, s, wordDict);
}
bool dfs(int start, std::string s, std::vector<std::string> &wordDict) {
if (s... | ALGO | 0.998927 | 6.275917 |
fca946c5-7968-4441-8f85-1ced0f2a52c6 | danny60106/C- | 13.1 數數字練習.cpp | #include <stdio.h>
void countTo3(int);
int main () {
countTo3(1);
return 0;
}
void countTo3(int i) {
if (i <= 3) {
printf("%d\n",i); // o椬ܷ|ܦq3-1
countTo3(i+1); // {j (bۤv{Isۤv)
}
}
| ALGO | 0.999438 | 3.232822 |
05fff833-da29-4334-b2f7-efd31f4c3a33 | someshjoyguru/dsa-cp | contests/all_submissions/Bench_Press.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define f(i,a,b) for (ll (i)=(a); (i)<(b); (i)++)
#define vll vector<ll>
#define in(n) ll n; cin>>n;
#define sin(s) string (s); cin>>(s);
#define vin(v,n) vll (v)(n); f(i,0,n)cin>>(v)[i];... | ALGO | 0.999902 | 3.861071 |
2f588b7b-9e88-4ec6-80df-6e8a8f7df6b3 | hajimeIppo-cmd/cp-codes | Baekjoon OJ/10000-10999/10830.cpp | #include <iostream>
#include <vector>
#define ll long long
using namespace std;
const int MOD = 1e3;
int N;
vector<vector<int>> arr;
vector<vector<int>> f(ll x);
vector<vector<int>> matrixMul(vector<vector<int>>& a, vector<vector<int>>& b);
int main() {
cin.tie(NULL); cout.tie(NULL);
ios_base::sync_with_stdio(fal... | ALGO | 0.999902 | 3.541267 |
d5354a33-2c0a-4305-9e82-4e5b72feb286 | 0x11111111/VisualLab | dependencies/include/igl/faces_first.cpp | #include <vector>
#include <Eigen/Dense>
template <typename MatV, typename MatF, typename VecI>
IGL_INLINE void igl::faces_first(
const MatV & V,
const MatF & F,
MatV & RV,
MatF & RF,
VecI & IM)
{
assert(&V != &RV);
assert(&F != &RF);
using namespace std;
using namespace Eigen;
vector<bool> in_... | ALGO | 0.999525 | 5.283256 |
ffa8da74-6c84-4abb-80b2-4c6ea55182f4 | shogo314/moja | lower_bound_query/tests/validator.cpp | #include <bits/stdc++.h>
#include "constraints.hpp"
#include "testlib.h"
int main(int argc, char* argv[]) {
registerValidation(argc, argv);
int N = inf.readInt(MIN_N, MAX_N);
inf.readEoln();
for (int i = 0; i < N; i++) {
int A = inf.readInt(MIN_A, MAX_A);
if (i != N - 1) {
... | ALGO | 0.999384 | 4.970565 |
9630a506-2e0f-4b63-9991-82c474e6057f | qaisjp/inf-cg | cw3/pbrt-v3/src/core/quaternion.cpp | // core/quaternion.cpp*
#include "quaternion.h"
#include "transform.h"
namespace pbrt {
// Quaternion Method Definitions
Transform Quaternion::ToTransform() const {
Float xx = v.x * v.x, yy = v.y * v.y, zz = v.z * v.z;
Float xy = v.x * v.y, xz = v.x * v.z, yz = v.y * v.z;
Float wx = v.x * w, wy = v.y * w,... | ALGO | 0.998723 | 7.378891 |
ae7cece5-e25f-47e7-b4ad-c17f0feca533 | FelipeGabrielSilva/algoritmos-estruturas-de-dados-II | trabalhos/METODO_BISSECCAO.cpp | #include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
setlocale(LC_ALL, "Portuguese");
const double precisao = 0.000001;
// double a = 0, b = 3;
double a = 0, b = 10;
// funcao f(x) = sen(x) - cos(x)
auto f = [](double x)
{
// return sin(x) - c... | ALGO | 0.999942 | 4.742118 |
790560b7-2563-4fe6-ae19-f6d19ade89d8 | Kaizoku01/DSA | OctoberLeetCodeDaily/C++/Minimum Time to Make Rope Colorful.cpp | class Solution {
public:
int minCost(string colors, vector<int>& neededTime) {
int ans = 0;
int n = colors.size();
int i = 0;
while(i < n) {
int j = i;
while(j < n-1 && colors[j] == colors[j+1]) ++j;
int maxi = INT_MIN;
for(int k = i; k... | ALGO | 0.999808 | 6.171323 |
416c440d-1a21-4f6f-980e-0b0afbb5a62e | AbrahamRH/MetodosNumericos | driverProgram.cpp | /**
* @file driverProgram.cpp
* @brief Driver Program para los metodos numéricos
* @author AbrahamRH
* @version 1.7
* @date 2020-04-22
*/
#include "MetodosNumericos.hpp"
using namespace MetodosNumericos;
int main()
{
/* Integracion integral;
integral.reglaDelTrapecio(.5,3,10);
integral.reglasDeSimpson(.5,1.... | ALGO | 0.973639 | 3.872761 |
efb3e4cc-7a9c-41a9-ab37-f0a49b349445 | raquelfishes/AdventCalendar | events/2020/calendar/day08.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <regex>
#include <numeric>
#include "resources.h"
struct Instruction
{
std::string type;
int value;
bool visited = false;
Instruction(std::string t, std::string sign, std::strin... | ALGO | 0.99917 | 4.691265 |
cf1437dd-b21e-4083-934f-0b8f0a99dd93 | Ouchi-Shoutarou/Bublles_pop | GameTemplate/tkEngine/bulletPhysics/src/Bullet3OpenCL/NarrowphaseCollision/b3QuantizedBvh.cpp | #include "b3QuantizedBvh.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#define RAYAABB2
b3QuantizedBvh::b3QuantizedBvh() :
m_bulletVersion(B3_BULLET_VERSION),
m_useQuantization(false),
m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIENDLY)
//m_traversalMode(TRAVERSAL_STACKLESS)
//m_traversalMode... | ALGO | 0.997804 | 6.933947 |
5c79124a-c32a-4f88-8079-31a6809a92f4 | argyrosan/llvm-hy546 | libc/src/math/generic/ufromfpf.cpp | #include "src/math/ufromfpf.h"
#include "src/__support/FPUtil/NearestIntegerOperations.h"
#include "src/__support/common.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
LLVM_LIBC_FUNCTION(float, ufromfpf, (float x, int rnd, unsigned int width)) {
return fputil::fromfp</*IsSigned=*/false>... | TOOL | 0.895744 | 6.256254 |
23baa53f-ea55-405b-8f19-209d5e4f0d05 | Saisrinivas122/CSA5179--CRYPTOGRAPHY-AND-NETWORK-SECURITY- | coloumnar transposition.CNS.cpp | #include <stdio.h>
#include <string.h>
#define MAX_ROWS 100
#define MAX_COLS 100
void encryptColumnarTransposition(const char *plaintext, const char *key) {
int keyLength = strlen(key);
int textLength = strlen(plaintext);
int rows = textLength / keyLength;
if (textLength % keyLength != 0) {
rows... | ALGO | 0.999749 | 4.929818 |
40aa6d43-7998-4456-95f5-64c4b16be6e5 | SwatiLahane/All-Programs | PRogram327.cpp | #include<iostream>
using namespace std;
class Arithematic
{
public:
int No1;
int No2;
Arithematic(int A ,int B);
int Addition();
int Substraction();
};
/*
Return_value Class_Name :: Function_Name(Parametrs)
*/
Arithematic :: Arithematic(int A ,int B)
{
this->No1 = A... | TOOL | 0.935465 | 4.549808 |
fb0845f4-d662-4ec7-8774-0cc34b29af6e | albar965/littlenavmap | src/common/constants.cpp | #include "common/constants.h"
#include "atools.h"
#include "gui/helphandler.h"
#include "options/optiondata.h"
#include "settings/settings.h"
#include <QDir>
#include <QRegularExpression>
#include <QSettings>
#include <QDebug>
#include <QCoreApplication>
#include <QUrl>
#include <QStringBuilder>
namespace lnm {
sta... | CONFIG | 0.862924 | 6.665182 |
f80a6057-3384-4ee8-a379-483d66f768aa | rituraj0/Old-Codes | 2.5.cpp | #include<iostream>
#include<time.h>
#include<vector>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<assert.h>
//For different u hav to change here
#define tasks 5
#define pros 2
using namespace std;
bool allocated[tasks],iallocated[tasks];//Checks whether a task is allocated to an... | ALGO | 0.999881 | 3.183432 |
39ebf703-2d00-4e0c-b058-f5396dbff881 | aberer/exabayes | src/proposals/topo-proposers/ParsSprProposer.cpp | #include "ParsSprProposer.hpp"
#include "Randomness.hpp"
#include "TreeRandomizer.hpp"
#include "SprMove.hpp"
double ParsSprProposer::weightEps = 1e-100;
ParsSprProposer::ParsSprProposer(double parsWarp, int depth, Communicator& comm )
: _parsWarp{parsWarp}
, _depth{depth}
, _pEval{}
, _comm(comm)
, _comp... | ALGO | 0.999057 | 6.387505 |
51d7c8ab-415b-4ba0-bd15-14db38b319b2 | 3daddict/QIDI_XONE-ANET_V1.0 | Marlin/vector_3.cpp | #include <math.h>
#include "Marlin.h"
#if HAS_ABL
#include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, vector_3 right) {
return vector_3(left.y * right.z - left.z * right.y,
... | TOOL | 0.853673 | 6.762154 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.