uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
2db9ddf9-c305-4e06-aa23-cce3ff427de9 | vanessadcamara/Programacao-competitiva | aritmética-modular/abc.cpp | #include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
int main(){
string s;
while(cin >> s){
long long ans = 0;
long long exp = 1;
for(int i = s.size()-1, j = 0; i >= 0; i--, j++){
long long aux = ((s[i] - 'A') * (exp))%MOD;
ans= ((ans%MOD) + (aux%M... | ALGO | 0.999971 | 4.207283 |
0e47ec84-7b47-4936-b5b2-4aab91cfcfe1 | SYSU-RoboticsLab/FAEL | 3rdparty/fly_sim/rotors_fly/rotors_control/src/attitude_controller.cpp | #include "rotors_control/attitude_controller.h"
AttitudeController::AttitudeController()
: gravity_(9.81),
mass_(1.56779) {
}
AttitudeController::~AttitudeController() {
}
std::shared_ptr<ControllerBase> AttitudeController::Clone() {
std::shared_ptr<ControllerBase> controller(new AttitudeController);
... | ALGO | 0.946671 | 6.523511 |
2c2c708d-e942-41aa-b724-7ca68e222e3a | ishant9805/DSA-LearnAndPractice | codingNinja/3. Arrays/2. Medium/superiorElements.cpp | #include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
// vector<int> superiorElements(vector<int>&a) {
// // Write your code here.
// set<int> res;
// int sz = a.size();
// for (int i = 0; i < sz; i++)
// {
// bool isSup = true;
// for (int j = i... | ALGO | 0.999888 | 4.621 |
8f7676f2-5e7e-4f89-9141-cc6485fa0100 | abhishekjachak21/CoderAbhishek | comapanySpecific/TCS_Problems/Striver TCS Sheet/05]. Problems_on_String/16_Maximum_occurring_character_in_a_string.cpp | /*
Maximum occurring character in a string
Maximum occurring character in a string
Problem Statement: Given a string, return the character that occurs the maximum number of times in the string. If the maximum occurrence of two or more characters is the same, return any one of them.
Examples:
Example 1:
Input: str =... | ALGO | 0.99993 | 5.600353 |
3972892e-2e0a-46cc-8610-12a0703bbce4 | Shubhada249/DSA | Tree/Bottom View of Binary Tree.cpp | //https://practice.geeksforgeeks.org/problems/bottom-view-of-binary-tree/1
//TC:O(n log n) //SC:O(n)
void fun(Node *root, map<int,int> &mp)
{
queue<pair<Node *,int>> q;
if(root)
q.push({root,0});
while(!q.empty())
{
int sz=q.size();
while(sz--)... | ALGO | 0.999964 | 5.597692 |
4a9978c3-0d16-46d7-9da6-108782cf1af3 | ChienYang-Li/os_autotest | os_autotest/app/ledcheck_b1/ledcheck_b1.cpp | #include "ledcheck_b1.h"
using namespace cv;
using namespace std;
Mat capture(int id ,int width ,int height)
{
cv::VideoCapture cap(id);
cap.set(cv::CAP_PROP_FRAME_WIDTH, width);
cap.set(cv::CAP_PROP_FRAME_HEIGHT, height);
// if (!cap.isOpened())
// return -1;
cv::Mat mat{};
cv::Mat gr... | TOOL | 0.962655 | 3.621367 |
23b81f35-d712-46c4-ad8e-6990fca762da | omarrzalm/BasiCpp | factorialF.cpp | #include <iostream>
using namespace std;
int FuncFactorial(int n);
int main() {
int fact;
FuncFactorial(fact);
return 0;
}
int FuncFactorial(int n) {
int i, fact=1;
for(i=1;i<=n;i++) {
fact = fact*i;
}
return fact;
}
| ALGO | 0.999248 | 4.324849 |
f850f688-dee4-4c23-a17e-23f27ef9d794 | coderatiiita/CSES | Dynamic Programming/Book_Shop.cpp | #pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#d... | ALGO | 0.999965 | 4.805079 |
cbd4521f-89fb-4edd-9016-44482e6bf9b0 | ReasonPsycho/MatGraf | BoundaryPlane.cpp | //
// Created by redkc on 24/01/2024.
//
#include "BoundaryPlane.h"
BoundaryPlane::BoundaryPlane(Vector3 p1, Vector3 p2, Vector3 p3, Vector3 edge1, Vector3 edge2)
: Plane(p1, p2, p3), edge1(edge1), edge2(edge2) {
v1 = p2 - p1;
v2 = p3 - p1;
n = v1.cross(v2);
if (edge1.x > edge2.x){
fl... | ALGO | 0.954249 | 6.491467 |
d1b69e7e-7bae-45ed-b2da-9ef1c02bf4ad | joaogsma/ES-Path-Tracer | ES-Path-Tracer/src/geometry/aab.cpp | #include <cmath>
#include "geometry/aab.h"
static const double epsilon = 10e-6;
bool operator==(const AAB &a, const AAB &b)
{
return std::abs(a.min_x - b.min_x) < epsilon && std::abs(a.max_x - b.max_x) < epsilon &&
std::abs(a.min_y - b.min_y) < epsilon && std::abs(a.max_y - b.max_y) < epsilon &&
s... | ALGO | 0.950523 | 5.834188 |
333ee860-91db-4887-bdb9-4b573cc5119f | WEGFan/Algorithm-Contest-Code | online-judge/CodeForces/CodeForces 859B.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin >> n;
int t = ceil(sqrt(n));
if (n > (t - 1) * t)
{
cout << 2 * 2 * t << endl;
}
else
{
cout << 2 * (t + t - 1) << endl;
}
return 0;
}
| ALGO | 0.999185 | 4.512077 |
dc3118cd-fee1-4b0d-a513-9bcfd12d40b4 | JiHyeok-Kim/SAF-STUDY | 2022-11/221108 - A형 대비 SWEA 문제 풀이/221108_스터디_조수완/4613_러시아 국기 같은 깃발.cpp | #include <iostream>
#include <cstring>
using namespace std;
int T, N, M, result;
char flag[51][51];
int dat[51][130];
void solve() {
cin >> T;
for (int t = 1; t <= T; t++) {
memset(dat, 0, sizeof(dat));
cin >> N >> M;
for (int y = 0; y < N; y++){
for (int x = 0; x < M; x++) {
cin >> flag[y][x]; dat[y][f... | ALGO | 0.999341 | 4.311338 |
0b6c6e49-16b3-4e8b-bce5-a1334485ae19 | drshn-k/LeetCode-Problems | 1326-minimum-number-of-taps-to-open-to-water-a-garden/1326-minimum-number-of-taps-to-open-to-water-a-garden.cpp | class Solution {
public:
int minTaps(int n, vector<int>& ranges) {
int mxx = 0;
int mnn = 0;
int open = 0;
while(mxx<n){
//check for tap that touhc zero;
for(int i=0;i<=n;i++){
int range_left = i-ranges[i];
int range_right = i+r... | ALGO | 0.999988 | 5.806877 |
86d4fb66-e32c-4b96-8a03-2d762f58dc0c | huangjiayu-zju/PAT-A | 0. GettingStart/2.A1046.cpp | #include<cstdio>
#include<algorithm>
using namespace std;
const int maxn = 100010;
int dis[maxn], A[maxn];//dis[i]表示1号结点按顺时针方向到达“i号结点但顺时针方向下一个结点”的距离,A[i]存放i号与i+1号顶点的距离
int main(){
int sum = 0, query, n, left, right;
scanf("%d", &n);
for (int i = 1; i <= n; i++)
{
scanf("%d", &A[i]);
sum... | ALGO | 0.999925 | 3.561911 |
cf75e106-a19a-4ad9-9fb2-4ff55ba8a72e | Its-Kuhin/VUPC_Hello_World-02-contest | VUPC_Hello_World 02-contest-prb-5.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t ;
long long int n ;
cin >> t ;
for(int i = 0 ; i < t ; i ++){
cin >> n;
int c1 = 0 , c2 = 0;
while(n%2==0){
c1 ++ ;
n /= 2;
}
while(n%3==0){
c2 ++ ;
n /= 3;
}
if(c2 >= c1 && n == 1)... | ALGO | 0.99987 | 4.110174 |
856ec2ea-1581-44d4-a045-17a1f34c9a0a | MiaoGaoUK/Leetcode | [700]search-in-a-binary-search-tree.cpp |
//leetcode submit region begin(Prohibit modification and deletion)
/**
* 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) {}... | ALGO | 0.999997 | 6.856743 |
89af2fa5-e0c7-4225-ae72-667d5a7eb78b | BrandoZhang/Inverse_Kinematics_with_Skinning | eigen/bench/benchCholesky.cpp |
// g++ -DNDEBUG -O3 -I.. benchLLT.cpp -o benchLLT && ./benchLLT
// options:
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/Cholesky>
#include <bench/BenchUtil.h>
using na... | TEST | 0.990622 | 5.938015 |
8d952241-55c0-45b0-85e8-af439fdf65c9 | andreadamiano/Algorithms-and-Data-Structures | algorithms/Graphs/graph.cpp | #include "graph.h"
#include "graph2.h"
#include <iostream>
int main ()
{
// Graph graph;
// //add nodes
// auto nodeA = graph.addNode("A");
// auto nodeB = graph.addNode("B");
// graph.addNode("C");
// graph.addNode("D");
// //add edges
// graph.addEdge("A", "B", 10);
// graph.... | ALGO | 0.934801 | 5.136916 |
77639ff7-0731-4140-b9ba-b1f4a0456f4d | 9731852393/c-leetcode-problems | 679. 24 Game.cpp | class Solution {
public:
bool judgePoint24(vector<int>& nums) {
unordered_set<string>res;
string ops = "+-*/";
dfs(nums, "", ops, res);
for (auto& x: res) {
auto v = getResult(x);
if (!v.empty() && abs(v.back() - 24) < 0.0001) {
return true;
... | ALGO | 0.998965 | 5.915175 |
75b791d5-6db1-459e-915e-2236d1e188b4 | Zyniuu/NeuralNetworkCPP | NeuralNetworkCPP/Activations/Sigmoid/Sigmoid.cpp | /**
* C++ neural network library
*
* Sigmoid.cpp
*/
#include "Sigmoid.hpp"
#include <cmath>
namespace nn
{
Matrix Sigmoid::forward(const Matrix &input)
{
double expLimit = 700; // To avoid overflow/underflow in exp
m_output = input.map([expLimit](double x) {
// Clip input valu... | ALGO | 0.997277 | 6.442672 |
30bba0fb-cb23-48da-9c75-b5ae89c9e841 | vcatafesta/qtcontribs | hbqt/qzxing/zxing/zxing/common/PerspectiveTransform.cpp | #include <zxing/common/PerspectiveTransform.h>
namespace zxing {
using namespace std;
PerspectiveTransform::PerspectiveTransform(float inA11, float inA21,
float inA31, float inA12,
float inA22, float inA32,
... | ALGO | 0.986709 | 5.958822 |
ee1d66a7-96d1-4c28-9198-5bb86ce240fc | Paul-Wortmann/Grume | source/physics/physics_resolution.cpp | /**
* Copyright (C) Paul Wortmann
* This file is part of "Grume"
*
* "Grume" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 2 only.
*
* "Grume" is distributed in the hope that it will be usefu... | ALGO | 0.998694 | 4.588244 |
f10be676-f5b5-4c52-84fe-727a696cfbe4 | GyanKumar62065/Leetcode | 525-contiguous-array/contiguous-array.cpp | class Solution {
public:
int findMaxLength(vector<int>& nums) {
int n=nums.size(), n1=0, n0=0, len=0;
vector<int> mp(2*n+1, INT_MAX);
mp[n]=-1;
for(int i=0; i<n; i++){
n1+=nums[i];
n0=(i+1)-n1;
len=max(len, i-mp[n1-n0+n]);
mp[n1-n0+n]=m... | ALGO | 0.999953 | 5.94459 |
076ebb91-1508-47ce-8a08-a829d07d477b | ltkk/cpp-tutorial | day24/ex1.cpp | #include <iostream>
#include <stdlib.h>
using namespace std;
#define MAXN 100
/*
Bài 155: Hãy tìm giá trị trong mảng các số thực xa giá trị x nhất
*/
int distance_calc(int a, int b){
return abs(a - b);
}
void matrix_input(int a[], int n){
for(int i = 0;i < n; ++i){
cout << "\nNhap a[" << i << "]... | ALGO | 0.999676 | 3.724226 |
21bcb351-5502-49a1-8a53-9b5eff22f88a | UnpureRationalist/myLeetcodeAnswer | hot100_2/208-实现 Trie (前缀树).cpp | #include <bits/stdc++.h>
using namespace std;
class Trie {
class TrieNode {
public:
TrieNode() = default;
explicit TrieNode(char c) : val_(c) {}
void setEnd() { isEnd_ = true; }
bool isEnd() const { return isEnd_; }
TrieNode *getChild(char c) { return children_[c]; }
TrieNode *insert(... | ALGO | 0.999921 | 5.85684 |
db27905e-07b9-4d8c-bbee-48a7916f9f2a | NREL/JModelica | ThirdParty/CasADi/CasADi/casadi/solvers/lp_to_qp.cpp | #include "lp_to_qp.hpp"
#include "casadi/core/sx/sx_tools.hpp"
#include "casadi/core/function/sx_function.hpp"
using namespace std;
namespace casadi {
extern "C"
int CASADI_LPSOLVER_QP_EXPORT
casadi_register_lpsolver_qp(LpSolverInternal::Plugin* plugin) {
plugin->creator = LpToQp::creator;
plugin->name... | TOOL | 0.914841 | 6.227779 |
bfbb5ff2-c9f6-4ac7-a119-020ff47a86d0 | brunohkbx/mu-server-ex | Source/GameServer/zzzpath.cpp | //=====================================================================================
//Project: MMTeam - Season II - Emulator
//Version: GameServer 2.00.05
//Information: ZZZPATH reworked fixing memory leaks
//=====================================================================================
#include "stdafx.h"
#... | ALGO | 0.980691 | 3.60089 |
2851e8d4-36e6-49a7-abb0-a6f047825c89 | kamrulhasanrony/URI-Online-Judge-Solutions | 2251.cpp | /* 2251 - Towers of Hanoi */
#include<stdio.h>
#include<math.h>
int main()
{
int n,ans,i=1;
while(scanf("%d",&n)!=EOF)
{
if(n==0)break;
else
{
ans = pow(2,n)-1;
printf("Teste %d\n%d\n\n",i,ans);
i++;
}
}
return 0;
}
| ALGO | 0.99841 | 3.898943 |
72104df7-1f71-4218-a03b-af94c585157d | Saber7X/DaiMaDaQuan | 递归实现组合型枚举4.cpp | #include<bits/stdc++.h>
using namespace std;
int n,m;
int res[100]={0};
int ans[100]={1};
void dfs(int u)
{
if(u>m)
{
for(int i=1;i<=m;i++)
{
cout<<ans[i]<<" ";
}
cout<<endl;
return;
}
for(int i=ans[u-1];i<=n;i++)
{
if(res[i]==0)
{
ans[u]=i;
res[i]=1;
dfs(u+1);
res[i]=0;
}
}
}
int ... | ALGO | 0.999954 | 3.26438 |
f5c88d75-6b7f-424b-8788-bc7b04c1015c | gun5046/algorithmStudy | 7576.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <utility>
using namespace std;
int arr[1000][1000];
vector<pair<int, int>>v;
int dx[4] = { 0, 1, -1, 0 };
int dy[4] = { 1, 0, 0,-1 };
bool visit[1000][1000];
int main() {
int m, n;
cin >> m >> n;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m;... | ALGO | 0.999687 | 4.24574 |
e57df79f-1e58-4dc3-a9dd-eea80947f667 | 4cnologi4/COJ | COJ/c++/DanMt-p2925-Accepted-s1007796.cpp | #include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
while(n--){
int a,b,veces=0;
cin>>a>>b;
if(b>=a){
cout<<(b-a)<<endl;
continue;
}
while(a>b){
a/=2;
veces++;
}
cout<<veces+(b-a)<<endl;
}
return 0;
} | ALGO | 0.99973 | 3.619475 |
07c1dd70-3a2a-44b4-89c1-2f3e0df34be4 | Palveet/Leetcode_solutions_analysis | arrays & hashing/1436 destination city.cpp | class Solution {
public:
string destCity(vector<vector<string>>& paths) {
unordered_map<string,string>mp;
for(int i=0;i<paths.size();i++){
mp[paths[i][0]]=paths[i][1];
}
for(const auto& pair:mp){
if(mp.find(pair.second)==mp.end()){
return pair.... | ALGO | 0.999862 | 6.023239 |
61fb6888-afe3-4558-9fd9-5b68856cdc42 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7644_9.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[4][1005][1005], a[1005][1005];
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++) scanf("%d", &a[i][j]);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
dp[0][i][j] = max(dp[0][i... | ALGO | 0.999946 | 3.476441 |
d0f3d19f-6c36-42fa-8423-4aa7e2c869cc | by-Bajrang/DSA-in-Cpp | Arayy/pascaltriangle/BRUTEprintTherow.cpp | #include<bits/stdc++.h>
using namespace std;
int fxnNCR(int r,int c)
{
int ans=1;
for(int i=0;i<c;i++)
{
ans=ans*(r-i);
ans=ans/(i+1);
}
return ans;
}
int main()
{
int row;
cout<<"enter a row";
cin>>row;
for(int c=1;c<=row;c++)
{
cout<<fxnNCR(row-1,c-1)<<... | ALGO | 0.999956 | 4.681712 |
595a32d5-4579-4e0d-a75a-3b2ebfaa7b4e | nikhilsharma-github/DSA-Solved-Problems | Sorting Algorithms/SortAnArrayWithThreeTypeOfElements.cpp | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << "=" << x << endl
void parray(int a[],int n){
for(int i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
cout<<endl;
}
void sortingAnArrayOfThreeTypeOfElements(int a[],int n){
int low=0,mid=0,high=n-1;
while(mid<=high){
... | ALGO | 0.999296 | 4.450966 |
e4c24f05-e9d3-4dcf-a887-50ba2f1ebb77 | hopefulp/sandbox | Archive_sand/MOF_plus/cmc_lammps/src/min_sd.cpp | #include <math.h>
#include <mpi.h>
#include "min_sd.h"
#include "atom.h"
#include "update.h"
#include "output.h"
#include "timer.h"
using namespace LAMMPS_NS;
// EPS_ENERGY = minimum normalization for energy tolerance
#define EPS_ENERGY 1.0e-8
/* ---------------------------------------------------------------------... | ALGO | 0.999987 | 5.632362 |
670b5ee7-fd14-44c8-82f1-1f6dc517eafc | mnhtng/C-plus-Algorithm | C++/Char and String/xauConCoThuTuTuDienLonNhat.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while( t-- ){
string s;
cin >> s;
char checkM = 'a', checkm = 'z';
for( char x : s ){
if( x > checkM )
checkM = x;
if( x < checkm )
checkm = x;
... | ALGO | 0.999763 | 4.010462 |
4f37286b-f672-49c9-83e7-024c2862ecc9 | kmjp/procon | codeforce/581-620/593/a2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZER... | ALGO | 0.999569 | 3.940695 |
5d378e88-80da-4e04-b89d-78f9f4bf5449 | TheUnicat/competitive-pwogramming | usaco/silver/2019/December/3_milk_visits.cpp | //
// Created by TheUnicat on 2024-08-03.
//
#include <fstream>
#include <vector>
#include <string>
#include <map>
using namespace std;
int n, m;
string farms;
vector<int> component_identities;
map<int, char> component_to_cow;
int current_component = 0;
vector<vector<int> > graph;
void dfs(int start, int prev, char ... | ALGO | 0.999938 | 5.284235 |
3b0c70b7-1de5-4185-aaac-a5d7087d3951 | SidEnpassant/Leetcode-Problems-Solutions | 3581-the-two-sneaky-numbers-of-digitville/3581-the-two-sneaky-numbers-of-digitville.cpp | class Solution {
public:
vector<int> getSneakyNumbers(vector<int>& nums) {
sort(nums.begin(),nums.end());
int n = nums.size();
vector<int> nums2;
for(int i = 0 ; i < n-1 ; i++){
if(nums[i] == nums[i+1]){
nums2.push_back(nums[i]);
}
}
... | ALGO | 0.999936 | 5.013041 |
43d287ce-5a78-436a-b9d2-cc27bd142b0c | thp/psmoveapi | src/tracker/psmove_tracker_hue_calibration.cpp | #include <algorithm>
#include "opencv2/core/core_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/highgui/highgui_c.h"
#include "psmove_tracker.h"
#include "psmove_tracker_opencv.h"
#include "psmove_tracker_hue_calibration.h"
#include "../psmove_private.h"
#include "../psmove_port.h"
#include "../psmov... | TOOL | 0.977118 | 6.739486 |
f97f62c4-2b1d-4382-9d63-a99002fb209f | Sameer-Pattnaik/leetcode | 0042-trapping-rain-water/0042-trapping-rain-water.cpp | class Solution {
public:
int trap(vector<int>& height) {
int n=height.size();
int leftMax[n];
int rightMax[n];
leftMax[0]=height[0];
for(int i=1;i<n;i++)
{
leftMax[i]=max(leftMax[i-1],height[i]);
}
rightMax[n-1]=height[n-1];
for(int i=n-2;i>=0;i--)
... | ALGO | 0.999994 | 6.696711 |
3731027f-87fa-4bf8-8d63-9916ca5e1229 | mertonmeng/leetcode | Hash Table & Graph Related/FourSum.cpp | #include "stdafx.h"
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
class FourSum {
public:
static vector<vector<int> > fourSum(vector<int> &num, int target) {
unordered_map<int, vector<pair<int, int>>> hashTable;
vector<vector<int>> result;
if(num.empty()){
... | ALGO | 0.999894 | 5.428722 |
c9b90815-6e9c-4e4b-8443-44016a60c10b | Gurpreet3131/competitiveProgramming | spoj/classical/ASCDFIB.cpp | #include <bits/stdc++.h>
using namespace std;
const int n = 1100001, mod = 1e5;
long long int fib[n] = {0};
int main()
{
int t; cin >> t;
fib[2] = 1;
for(int i = 3; i < n; i++)
{
fib[i] = fib[i - 1] + fib[i - 2];
if(fib[i] >= mod) fib[i] %= mod;
}
for(int tt = 1; tt <= t; tt++)
{
priority_queue<int, vector... | ALGO | 0.99951 | 3.858261 |
b7b4c580-67d0-4dcf-8a38-757229579f24 | yuforest/contests | abc_216/d/main.cpp | // ここは競プロではサボりがちです
#include <bits/stdc++.h>
using namespace std;
// デバッグ用マクロです。詳しくは https://naskya.net/post/0002/
#ifdef LOCAL
#include <debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif
// 節操ないですが、競プロでは便利です。
using ll = long ... | ALGO | 0.99999 | 4.870539 |
05415746-6bc3-468c-acb5-2d762a0bcb10 | archit2604/RRT | boost_1_61_0/libs/graph/test/metis_test.cpp | #include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/metis.hpp>
#include <fstream>
#ifdef BOOST_NO_EXCEPTIONS
void
boost::throw_exception(std::exception const& ex)
{
std::cout << ex.what() << std::endl;
abort();
}
#endif
using namespace boost;
/* An ... | ALGO | 0.997819 | 5.490002 |
e792848e-ced7-4ca9-8077-b72625f6b6c6 | aiubian-edge/Codechef---Problem-Solving | Volume 04/POPULATION.cpp | /******************************************************************************
Final Population
Problem
There were initially XX million people in a town, out of which YY million people left the town and ZZ million people immigrated to this town.
Determine the final population of town in millions.
Input Format
The f... | ALGO | 0.999519 | 4.943483 |
d93a2abb-e75a-4dcf-b0a5-15a33e7025d2 | znxuz/leetcode | cpp/furthestBuildingYouCanReach/solution.cpp | // https://leetcode.com/problems/furthest-building-you-can-reach/
#include "helper.h"
using namespace std;
using namespace util;
class Solution
{
public:
int furthestBuilding(vector<int>& heights, int bricks, int ladders)
{
return bi_search(heights, bricks, ladders);
}
private:
// time: O(nlog(n... | ALGO | 0.99998 | 6.607257 |
5a502891-4008-47f2-a015-778e6c0dd0f3 | Ankit18991/CPlusPluSS | overloading_assignment_Operators.cpp | /*
For Overloading +=,-=,*=,/=, we had to use it as:-
Overloading aa;
aa+=5;
So , for this we took object 'aa' as reference to call += overloading function. And Pass the Argument 5 to assign.
*/
#include<iostream>
#include<conio.h>
using namespace std;
int count = 0,counter = 0;
class Over... | TOOL | 0.892739 | 3.565746 |
d7920676-b4b4-4f95-9c24-030522a46766 | kamolhasan/competitive-programming | Codeforces/Codeforces Round #635 (Div. 2)/B.cpp | // B. Kana and Dragon Quest game solution
// Link: https://codeforces.com/contest/1337/problem/B
#include<bits/stdc++.h>
using namespace std;
int t, x, n, m;
int main()
{
cin >> t;
while (t--) {
cin >> x >> n >> m;
while ((x / 2) + 10 < x && n) {
x = (x / 2) + 10;
n--;
}
x -= (m * 10);
if (x <= 0) ... | ALGO | 0.999317 | 4.531354 |
273e0a1e-b383-49ad-b10a-4b22e5e73e0a | noureddinel/core-bitcoin-net-simulator | bitcoin/src/crypto/hmac_sha512.cpp | #include "crypto/hmac_sha512.h"
#include <string.h>
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
{
unsigned char rkey[128];
if (keylen <= 128) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 128 - keylen);
} else {
CSHA512().Write(key, keylen).Finalize(... | ALGO | 0.908329 | 5.686802 |
602f8527-e740-4918-9e8c-d5569731da09 | Harshvardhan6367/C-_DSA | 06_Function/04_Az.cpp | #include<iostream>
#include<cmath> // Include cmath for pow()
using namespace std;
int countDigit(int n){
int ans = 0;
while(n){
ans++;
n /= 10;
}
return ans;
}
void Armstrong(int num, int digit){
int x = num;
int ans = 0, rem;
while(num){
rem = num % 10;
n... | ALGO | 0.999956 | 4.755505 |
e598addc-5e35-4c07-a9e1-5317967009ed | C-2023-1-3/8209230902 | Experiment2/mytriangle.cpp | #include "mytriangle.h"
#include <cmath>
using namespace std;
bool is_valid(double side1, double side2, double side3) {
if (side1 + side2 > side3 && side1 + side3 > side2 && side2 + side3 > side1) {
return true;
}
else {
return false;
}
}
double area(double side1, double side2, double side3) {
double s = s =... | ALGO | 0.974972 | 4.716984 |
4f9afa09-ad86-4d86-adb4-117f08e6d469 | Syhawk/LeetCode | bulls_cows.cpp | //uri: https://leetcode.com/problems/bulls-and-cows/
/*
* 根据secret和guess给出猜中多少个bull和cow的提示。
* 首先判断bull猜中多少个,那么把secret[i] == guess[i]相等的数目相加;
* 剩下的不相等的guess存储道另一个字符串s中,并统计剩下的secret中的数字字符
* 数目放到num中;然后再次循环判断s中每存在一个数字字符且num中包含此字符的数目
* 不为空,那么就cow数目就增加一次。
* 空间复杂度:O(n).
* 时间复杂度:O(n).
* */
class Solution {
public:
... | ALGO | 0.999956 | 6.891096 |
58e5bb0b-ddf1-45c7-9d70-81d234e7b4eb | nonyx777/flowfield | src/interface/Engine.cpp | #include "../../include/interface/Engine.h"
//defining initializer functions
void Engine::initVariables(){
this->window = nullptr;
//assigning min and max spawning positions
this->min_x = 100.f;
this->max_x = 400.f;
this->min_y = 100.f;
this->max_y = 400.f;
auto seed = std::chrono::durati... | ALGO | 0.937201 | 4.918342 |
6cd108a5-0730-4f5e-88cd-103ebe73ffb8 | k99812/Cpp | BAEKJOON/2025-04-02 20303/2025-04-02 20303/20303.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#include<unordered_map>
using namespace std;
int n, m, k;
vector<int> candy, dp, parent;
int getParent(int num)
{
if (num == parent[num]) return num;
return parent[num] = getParent(parent[num]);
}
void unionParent(int a, int b)
{
int rootA = getParent(a), r... | ALGO | 0.999996 | 4.360966 |
2ef5737f-5baa-4dc6-b9d5-bf29c6654503 | Riyad0001/Phitron-Practice | Data Structer P2/print_ricersively.cpp | #include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int val;
Node *next;
Node(int val)
{
this->val = val;
this->next = NULL;
}
};
void print_ricersive(Node *n)
{
if (n == NULL)
return;
cout << n->val << " ";
print_ricersive(n->next);
}
void print_re... | ALGO | 0.999822 | 4.56542 |
840c346b-ab65-46d0-9e71-10c1338116d6 | siddanth-6365/leetcode-solutions | 77-combinations/combinations.cpp | class Solution {
public:
vector<vector<int>> combine(int n, int k) {
vector<vector<int>> res;
vector<int> temp;
helper(res, temp, n, k, 1);
return res;
}
void helper(vector<vector<int>>& res, vector<int>& temp, int n, int k,
int ind) {
if (temp.size() ... | ALGO | 0.999991 | 6.28297 |
afccbd96-68f9-4554-8b15-4c63cbbc2eee | OnePlus7-Dev/frameworks_av | media/libstagefright/codecs/amrnb/enc/src/hp_max.cpp | /*
------------------------------------------------------------------------------
Filename: /audio/gsm_amr/c/src/hp_max.c
Date: 02/01/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Replaced "int" and/or "char" with OSCL defined types.
Des... | ALGO | 0.999618 | 7.219464 |
136f7b23-ed70-4e51-a55f-e3c6b7818f8c | LucSam/mrtrix3-deep-atropos | cpp/core/dwi/tractography/GT/externalenergy.cpp | #include "dwi/tractography/GT/externalenergy.h"
#include "algo/loop.h"
#include "dwi/gradient.h"
#include "dwi/shells.h"
#include "math/SH.h"
#include "math/ZSH.h"
namespace MR::DWI::Tractography::GT {
ExternalEnergyComputer::ExternalEnergyComputer(Stats &stat, const Image<float> &dwimage, const Properties &props)
... | ALGO | 0.995967 | 5.233803 |
b57ae586-3405-4b51-b721-7a2fc3bfb731 | ishandutta2007/codeforces | lanpang/normal/1208/D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1e6+10;
const LL mod = 1e9+7;
int n , b[maxn];
LL a[maxn] , tr[maxn*4] , lz[maxn*4];
void build(int num , int l , int r)
{
if (l == r)
{
tr[num] = a[l];
return;
}
int mid = (l+r)/2;
build(num*2,l,mid);
build(num*2+1,mid+1,r... | ALGO | 0.999985 | 3.515045 |
3f6afcb1-3572-4d7f-9a35-7b550ba3f061 | SandeepanM2003/cpp_python_codes | C++/removeDuplicatesSortedLL.cpp | /* C++ Program to remove duplicates from a sorted linked list */
#include <bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node* next;
};
void removeDuplicates(Node* head)
{
Node* current = head;
Node* next_next;
if (current == NULL)
return;
while (current->next != NULL)
{
if (cu... | ALGO | 0.999857 | 5.509993 |
7d94d846-d8d9-4721-ac9a-4a52e6125d77 | LandoRomero/Lab_3 | main.cpp | #include <iostream>
#include <fstream>
#include <cstring>
#include <iomanip>
using namespace std;
const int MAX_EXPR_LENGTH = 60;
const int MAX_STACK_SIZE = 60;
struct Token {
char symbol[6];
};
class Stack {
Token items[MAX_STACK_SIZE];
int top;
public:
Stack() : top(-1) {}
bool push(const char*... | TOOL | 0.870112 | 5.969777 |
98db6869-e208-41d7-8edc-3c51bcd96a61 | kyriosaa/c-cpp-practice | classes/brocode_cpp/32_sizeof/sizeof.cpp | #include <iostream>
int main() {
// sizeof() = Determines the size in bytes of a: variable, data type, class, objects, etc.
double gpa = 3.2;
std::string name = "Bob";
bool isStudent = true;
char grade = 'F';
char grades[] = {'A', 'B', 'C', 'D', 'F'};
std::string students[] = {"Spong... | TOOL | 0.895326 | 4.485854 |
a9616631-bdcb-4f38-a651-683c088406a8 | Inventor77/Leetcode | 91-decode-ways/91-decode-ways.cpp | class Solution {
public:
int numDecodings(string s) {
int n=s.length();
if(s[0] == '0') return 0;
if(n==1) return 1;
vector<int> dp(n+1,0);
dp[0] = 1;
dp[1] = 1;
for(int i=2;i<=n;i++) {
int onedigit = s[i-1] -'0';
int twodigit ... | ALGO | 0.999798 | 6.218707 |
41ec16ee-c294-4df9-886c-527e6865f27f | kito-cheng/LLVM-SVE | lib/Transforms/Scalar/InferAddressSpaces.cpp |
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Sup... | TOOL | 0.921098 | 5.332123 |
1701aa42-9296-416f-bc9e-fef5ef895514 | RedBlazerFlame/reboot-materials | compprog-materials/veteran/9-number-theory/solutions/phi.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
vector<ll> phi(n + 1, 0ll);
for(ll i = 0; i <= n; i++) {
phi[i] = i;
}
phi[1] = 1;
for(ll i = 2ll; i <= n; i++) {
if(phi[i] == i) {
for(ll j = 1ll; i * j <= n; j++) {
... | ALGO | 0.999944 | 3.626672 |
6db8d265-8b8b-4c70-9a36-43b1a7888c72 | astha2101/DSA | tree/diagonalLevel.cpp | void fillMap(Node *root, int dist , map<int,vector<int>> &m)
{
if(root == NULL) return;
m[dist].push_back(root->data);
fillMap(root->left,dist+1,m);
fillMap(root->right,dist,m);
}
vector<int> diagonal(Node *root)
{
// your code here
vector<int> res;
map<int,vector<int>> m;
int dist =0;
f... | ALGO | 0.999953 | 4.629545 |
2bfe0ad4-e295-4b95-96f4-72f007d68873 | moh1t-do/upsolve | Powered_Parameters.cpp | #include <bits/stdc++.h>
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
using namespace std;
#define int long long
void solve()
{
int n;
cin >> n;
vector<int> vec(n);
for (auto &e : vec)
cin >> e;
// /INPUT
int mx = *max_element(vec.... | ALGO | 0.999947 | 5.42021 |
433b919e-7e00-48e7-88ce-45ba6cb68133 | ishandutta2007/codeforces | adam_gs/normal/1307/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl cout << '\n'
#define len(a) a.size()
#define cs(a) cout << "Case #" << a << ": "
#define lst(a) a[len(a)-1]
#define tests(a) cin >> a; while(a--)
int main() {
int t;
tests(t) {
int n, d;
cin >> n >> d;
int tab[n];
for (i... | ALGO | 0.999942 | 3.762042 |
172947c5-f6f5-4052-a53a-ee38bd71f1c4 | tonningp/cis202-examples-old | bigc3code/ch04/worked_example_1/ccnumber.cpp | #include <iostream>
#include <string>
using namespace std;
/**
This program removes spaces and dashes from a credit card number.
*/
int main()
{
string credit_card_number = "4123-5678-9012-3450";
int i = 0;
while (i < credit_card_number.length())
{
string ch = credit_card_number.substr(i, ... | TOOL | 0.975927 | 6.075635 |
6d40e618-a85a-49af-a4e0-f7d91d89d84d | BenWeber42/acm-lab | 09/remove_array_incorrect.cpp | #include <iostream>
#include <vector>
#include <numeric>
#include <limits>
#include <algorithm>
using namespace std;
int sum(const vector<int>& vec, int i1, int i2) {
if (i1 == 0) {
return vec[i2];
} else {
return vec[i2] - vec[i1 - 1];
}
}
int elem(const vector<int>& vec, int index) {
if (index == 0) {
re... | ALGO | 0.999966 | 3.610274 |
22f988da-2f7c-4d29-b8f3-d7d3434bc681 | AnshRehan04/oops | c++/sumoffirstcolumn.cpp | #include <iostream>
using namespace std;
int main(){
int arr[3][3];
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
cin>>arr[i][j];
}
}
int sum=0;
for (int i = 0; i < 3; i++)
{
sum+=arr[i][0];
}
cout<<sum;
} | ALGO | 0.999886 | 3.493301 |
f8b81313-5378-4647-9f8c-086d137aa93e | ammyjutt/progs | CPP_Online_Code/CPP_CODES_1/cb_141_2.cpp | //using namespace std;
//#include <iostream>
//#include <vector>
//#include <unordered_map>
//
//
//
//
//
//class Solution {
//public:
// vector<int> minBitwiseArray(vector<int>& nums) {
//
// int len_nums = nums.size();
//
// for (int i = 0; i < len_nums; i++)
// {
// ... | ALGO | 0.999924 | 5.09408 |
a677d29e-bd1e-41c2-a4d4-5868029f5c79 | DanielH11/URI | 2950.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main (){
cout << fixed;
cout << setprecision(2);
double n, x, y;
cin >> n >> x >> y;
cout << n/(x+y) << endl;
return 0;
} | ALGO | 0.998811 | 3.483754 |
d1f07e31-1ea1-4c6a-a873-f684f92fb0bc | GAURAV5925/DSA-Series | Pattern/pattern3.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
int row = 1;
while(row <= n) {
int col = 1;
while(col <= row) {
cout<< row;
col = col + 1;
}
cout<<endl;
row = row + 1;
}
return 0;
} | ALGO | 0.999891 | 3.944224 |
08323ae3-ac6f-4c55-8eb5-e37e531bbdbc | alanMLCV/windage | windageLib_oldrev/src/Tracker/PoseEstimation/FindHomography.cpp | /* ========================================================================
* PROJECT: windage Library
* ========================================================================
* This work is based on the original windage Library developed by
* Woonhyuk Baek
* Woontack Woo
* U-VR Lab, GIST of Gwangju in Ko... | ALGO | 0.999783 | 5.811478 |
636976af-d587-485b-b938-e742adee3257 | LihengGong/computer_graphics | OpenGL_2d/ext/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(2);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,
1;
//add v to each column of m
mat.colwise() += v;
std::cout << "Broadcasting result: " << std::endl;... | ALGO | 0.998967 | 4.136906 |
28666c86-3308-4ba2-92fa-9b44a040ed3d | madscorpio20/important-questions | 0011-container-with-most-water/0011-container-with-most-water.cpp | class Solution {
public:
int maxArea(vector<int>& height) {
int i = 0;
int j = height.size() - 1;
int maxi = 0;
while(i<j){
maxi = max(maxi, min(height[i],height[j]) * (j-i));
if(height[i] <= height[j]){
i++;
}else{
... | ALGO | 0.999964 | 6.655844 |
1fba0f3c-ff71-43cb-9553-a50cfcd67009 | Alpro-1C/TugasPraktikum-AdikAbimaulana | pertemuan 5/Tugas1.cpp | #include <iostream>
using namespace std;
void bilanganGanjil(int batas) {
int jumlah = 0;
cout << "\nBilangan Ganjil antara 1 dan " << batas << " adalah: ";
for (int i = 1; i <= batas; i += 2) {
cout << i << " ";
jumlah += i;
}
cout << "\nJumlah Bilangan Ganjil antara 1 dan " << bat... | ALGO | 0.998521 | 4.783632 |
20595f4f-26b5-4e38-b6e3-691f21c3fe27 | prabhanukash/Coding-Book | Binary_Search/max_pages_to_be_minimised.cpp | // Problem Link -
/* By Bhanu Prakash */
#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//using namespace __gnu_pbds;
#define pb push_back
#define mp make_pair
#define ll long long int
#define ff first
#define ss second
#de... | ALGO | 0.999993 | 4.256969 |
9b532fad-84cb-4f43-a27c-7c656e1cb20d | AnupRaj0210/patterns.cpp | trainglepattern1.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
cout<<"*";
}
cout<<endl;
}
} | ALGO | 0.999891 | 3.91003 |
15cb3496-621b-4461-bec9-4bf0dfebbd22 | sicongyu/Unreal-Lightmass-SH-based-GI | Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/src/src/nvimage/BlockDXT.cpp | #include <nvcore/Stream.h>
#include "ColorBlock.h"
#include "BlockDXT.h"
using namespace nv;
/*----------------------------------------------------------------------------
BlockDXT1
----------------------------------------------------------------------------*/
uint BlockDXT1::evaluatePalette(Color32 color_array[4]... | TOOL | 0.903747 | 4.333906 |
68f25d1d-39b8-4fa8-b110-c12611f75d5c | Sai2307l/LeetCode | 52-n-queens-ii/n-queens-ii.cpp | class Solution {
public:
long long res = 0;
bool xuoi[20] = {};
bool nguoc[20] = {};
bool col[9] = {};
void backtrack ( int pos , int en ){
if ( pos == en ){
res++;
return;
}
for ( int i = 0 ; i < en ; i ++ ){
if ( !col[i] && !xuoi[en+i-pos+1] && !nguoc[i... | ALGO | 0.999958 | 5.636655 |
78a42a97-27a5-48ba-99df-7f9ca32960d6 | aditya-agr/LeetCode-POTD | 1346. Check If N and Its Double Exist.cpp | class Solution {
public:
bool checkIfExist(vector<int>& arr) {
unordered_map<int, int> mp;
for(int num : arr){
if(mp.count(num*2))
return true;
if(num%2==0 && mp.count(num/2))
return true;
mp[num]++;
}
return false;
... | ALGO | 0.998272 | 5.798209 |
1e9e3303-9826-42f3-b102-33d37f9258ce | ibrahimgb/GCD-simulation-in-systemC | pgcd.cpp | #include "pgcd.h"
void pgcd::do_pgcd(){
gcd_tmp = 0; ready_tmp = 0;
X = 0; Y = 0;
//while(true) {
if(valid.read() == 1){ X = A.read(); Y = B.read(); }
else{
if(X > Y){ X = X - Y; }
else if(X < Y){ Y = Y - X;
}
else{
ready_tmp = X == 0 ? 0 : 1;
gcd_tmp = X == 0 ? gcd_tmp : X;
X = 0;
Y = 0;
}
}
GCD.write(gcd_tmp);
ready.... | ALGO | 0.99907 | 3.41736 |
12b22c66-2207-44a0-9db7-a8d067bec84f | alanrazop/TC1031-Portafolio_Final- | Act2.3/main.cpp | // =================================================================
//
// File: main.cpp
// Author: Alan Fernando Razo Peña
// Date: 12 de octubre de 2021
//
// =================================================================
#include <iostream>
#include <string>
#include <vector>
#include "list.h"
using namespace s... | ALGO | 0.939529 | 4.64145 |
7cb3f6a7-c300-4a50-b258-bc9e5e6b9fdf | EslamKhder/problem-solving-with-c- | sheets/Sheet #3 (Arrays)/S. Search In Matrix.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int row,column;
cin>>row>>column; // 2 2
int arr[row][column];
for(int i=0;i<row;i++){ // i = 0 1 i<2
for(int z=0;z<column;z++){ // z = 0 1
// i = 0 z = 0 0 0
// i = 0 z = 1 0 1
// i = 1 z = 0 1 0
// i = 1 z = 1 1 1
cin>>arr[i][... | ALGO | 0.997448 | 3.565606 |
94d570d9-ab2e-4f07-bc03-de259e602da2 | ishandutta2007/codeforces | natsugiri/normal/616/E.cpp | #include<cassert>
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cstring>
using namespace std;
typedef long long LL;
typedef vector<int> VI;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=... | ALGO | 0.999953 | 4.209991 |
61320bd9-03d3-4f4d-9c12-8502c983ce34 | arcrin/cpp_crash_course | object_natural/cp5/fig05_07.cpp | //
// Created by wbai on 4/5/2023.
// inline function that calculates the volume of a cube
//
#include <iostream>
using namespace std;
// Definition of inline function cube. Definition of function appears
// before function is called, so a function prototype is not required.
// First line of function definition also ... | TOOL | 0.862461 | 6.616371 |
9c40bf75-7aa8-4163-a379-748d105b86f4 | Arnulfo-hub/Labo-Funda | Laboratorio 4/ejercicio3.cpp | #include "iostream"
using namespace std;
int a;
int main(){
cout <<"Ingrese un numero:";
cin >>a;
if(a == 0){
cout <<"El numero es cero.";
}
else{
if(a > 0){
cout <<"El numero es positivo.";
}
else{
cou... | TOOL | 0.97423 | 3.05388 |
f1bd1efc-04b7-48af-9ee4-82aaff27513e | alect/Digital-Egg-Drop | EggDrop/libs/Box2D/Collision/b2BroadPhase.cpp | #include <Box2D/Collision/b2BroadPhase.h>
#include <cstring>
b2BroadPhase::b2BroadPhase()
{
m_proxyCount = 0;
m_pairCapacity = 16;
m_pairCount = 0;
m_pairBuffer = (b2Pair*)b2Alloc(m_pairCapacity * sizeof(b2Pair));
m_moveCapacity = 16;
m_moveCount = 0;
m_moveBuffer = (int32*)b2Alloc(m_moveCapacity * sizeof(int... | TOOL | 0.903391 | 6.944309 |
b8b781be-bab3-4220-b25d-74ada954410c | Sodynoizz/Competitive-Programming | codeforces/crackncode/blackslex.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::valu... | ALGO | 0.999823 | 3.316397 |
98fa9537-d6a4-4e72-97a6-7e37a89f0ea0 | omarKaushru/Numb-UV-Life-activites | Compiler Design/Test/prefix to infix.cpp | #include <string.h>
#include <ctype.h>
#include <conio.h>
#include <stdio.h>
char opnds[50][80],oprs[50];
int topr=-1,topd=-1;
void pushd(char *opnd)
{
strcpy(opnds[++topd],opnd);
}
char *popd()
{
return(opnds[topd--]);
}
void pushr(char opr)
{
oprs[++topr]=opr;
}
char popr()
{
return(oprs[topr--]);
}... | ALGO | 0.999601 | 3.457977 |
c2f4fe20-8adc-43d3-8a07-c0cad1079ba0 | Injamam321/leetcode_problem_solving | Shifting_Letters_II.cpp | // 2381. Shifting Letters II
// cpp Solution! problem-2381
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string shiftingLetters(string s, vector<vector<int>>& shifts)
{
int n = s.size();
vector<int> delta(n + 1, 0);
for (auto& shift : shifts) {
i... | ALGO | 0.999975 | 6.248371 |
5c57b6e5-86ee-4c79-98b0-58e0715b4683 | henilShah110/cppPractice | school questions/Topic nested For Loops(Patterns)/8.cpp | #include <iostream>
using namespace std ;
int main ()
{
int x=1;
for(int i=0;i<4;i++)
{
for(int j=0;j<3-i;j++)
cout<<" ";
for(int j=0;j<i+1;j++)
cout<<x;
x++;
cout<<endl;
}
return 0;
} | ALGO | 0.999868 | 3.25904 |
92ba87b5-964e-44e3-b857-38e561ba9040 | Ashis1811/LeetCode | 0322-coin-change/0322-coin-change.cpp |
//============================== Memorization Approach ======================================
// class Solution {
// public:
// int helper(int amount, vector<int>& coins, vector<int>& dp)
// {
// if(amount == 0) return 0;
// if(amount < 0) return 1e9;
// if(dp[amount] != -1) return dp[... | ALGO | 0.999954 | 6.009642 |
fd2c8424-8111-4f26-8e34-9fa3a817124e | cold-su/cold-su | code/2025/03/09/P1720 月落乌啼算钱(斐波那契数列).cpp | #include <bits/stdc++.h>
class Solution {
public:
Solution() {}
using i64 = long long;
void solve() {
int n;
std::cin >> n;
i64 f[2] {0, 1};
for (int i = 2; i <= n; i++) {
f[i % 2] = f[0] + f[1];
}
std::cout << f[n % 2] << ".00";
}
};
int main() {
std::ios::sync_with_stdio(0);
std::cin.tie(0);
... | ALGO | 0.999807 | 3.532435 |
e8a7d692-03ff-4dcf-9e07-384afaee2f06 | kyberszittya/SZE-Prog-Gyak | 2024/Gyak11/lista_sok.cpp | //
// Created by keret on 2024. 04. 21..
//
#include <iostream>
struct LancElem {
int value;
LancElem* next;
};
#define N 6000
LancElem* beszurElejere(LancElem* lanc, int value) {
/// Elso elem letrehozasa
LancElem *uj = new LancElem();
uj->value = value;
uj->next = lanc;
return uj;
}
L... | ALGO | 0.996442 | 4.236206 |
48b96dae-bb77-4cea-8a4d-841023be991b | realcapacitor/cpp_returns | 43PassByAddress.cpp | #include<iostream>
using namespace std;
void display(int *ptr){
cout<<*ptr<<endl;
*ptr = 24;
}
int main(){
int age = 10;
display(&age);
cout<<age;
return 0;
}
| TOOL | 0.977615 | 3.167075 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.