uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b90268b8-a12a-46d9-b13f-d6b43bc37287 | JonathonMacleod/Distributed-Game-Architecture | libs/BOOST1.82.0/libs/fiber/src/numa/aix/topology.cpp | #include "boost/fiber/numa/topology.hpp"
extern "C" {
#include <errno.h>
#include <sys/rset.h>
#include <sys/types.h>
}
#include <system_error>
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
namespace {
void explore( int sdl, std::vector< boost::fibers::numa::node > & topo) {
rsethandle_t rset ... | TOOL | 0.866606 | 6.332241 |
ea3d2b23-54c6-42fb-b650-d3306bb26adb | sarvex/leetcode-nelua | solution/2500-2599/2517.Maximum Tastiness of Candy Basket/Solution.cpp | class Solution {
public:
int maximumTastiness(vector<int>& price, int k) {
sort(price.begin(), price.end());
int left = 0, right = 1e9;
auto check = [&](int x) {
int s = price[0];
int cnt = 1;
for (int i = 1; i < price.size(); ++i) {
if (pr... | ALGO | 0.999953 | 5.828823 |
a9801a03-6c2a-4ada-89ea-869f20367162 | venecoin/venegit | src/bitcoinrpc.cpp | #include "init.h"
#include "util.h"
#include "sync.h"
#include "ui_interface.h"
#include "base58.h"
#include "bitcoinrpc.h"
#include "db.h"
#undef printf
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost... | WEB | 0.962595 | 5.43618 |
0319be1e-31aa-4b34-a5ad-8ddfe1983ca5 | Hou-Xiaoxuan/AlgorithmCompetition | algorithm_contest_2020/CF/10_18_Round676_div2/D.cpp | #ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);cout.tie(0);
#define m_p make_pair
#define P pair<int,int>
#define x first
#define y second
typedef long long LL;
typedef unsigned long long ULL;
const int inf... | ALGO | 0.999922 | 3.529504 |
21f3e83f-76d5-463e-8bcf-1ca1e809f1c7 | ShailzaThakur7/Leetcode | 0540-single-element-in-a-sorted-array/0540-single-element-in-a-sorted-array.cpp | class Solution {
public:
int singleNonDuplicate(vector<int>& nums) {
int low=0,high=nums.size()-1;
while(low<high){
int mid=low+(high-low)/2;
if(mid%2==1){
mid--;
}
if(nums[mid]==nums[mid+1]){
low=mid+2;
... | ALGO | 0.999805 | 5.740953 |
1ab0b290-6ee8-4db8-96b1-e4ee53634f19 | Manjothub/Emotion_Detection_with_song_recomendation | opencv-master/modules/stitching/perf/perf_matchers.cpp | #include "perf_precomp.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/opencv_modules.hpp"
#include "opencv2/flann.hpp"
namespace opencv_test
{
using namespace perf;
typedef TestBaseWithParam<size_t> FeaturesFinderVec;
typedef TestBaseWithParam<string> match;
typedef tuple<string, int> matchVector_t;
typedef ... | TEST | 0.914879 | 6.857625 |
50080d24-b314-4d03-aa5f-33163e844374 | induction-axiom/computer-graphics-meshes | libigl/include/igl/rgb_to_hsv.cpp | template <typename R,typename H>
IGL_INLINE void igl::rgb_to_hsv(const R * rgb, H * hsv)
{
// http://en.literateprograms.org/RGB_to_HSV_color_space_conversion_%28C%29
R rgb_max = 0.0;
R rgb_min = 1.0;
rgb_max = (rgb[0]>rgb_max?rgb[0]:rgb_max);
rgb_max = (rgb[1]>rgb_max?rgb[1]:rgb_max);
rgb_max = (rgb[2]>rgb... | ALGO | 0.947126 | 5.897782 |
5ea20872-7d1d-41fc-8865-75826c3f9f22 | BIT-zhangxin/AlogrithmLearning | 做题/9.任务分配问题.cpp | //#include <cstdio>
//#include <cstring>
//#include <algorithm>
//using namespace std;
//
//#define INF 0x7fffffff
//#define T 2001
//
//int n, head[2005], q[2005], dis[2005], from[2005];
//int a[1005], mp[1001][1001], cnt, ans;
//
//bool inq[2005];
//
//struct data { int from, to, next, v, c; }e[100001];
//
//void ins... | ALGO | 0.999974 | 3.233927 |
616c3023-9d9e-4728-815d-06ea1f9c1271 | dipesh-m/Data-Structures-and-Algorithms | LeetCode Submissions/Sort List.cpp | //TOP - DOWN APPROACH
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
... | ALGO | 0.999991 | 5.395976 |
4d6386bb-ede5-4bd4-8dac-a6060f998de2 | Adityaagar2003/Leetcode | 3024-type-of-triangle/3024-type-of-triangle.cpp | class Solution
{
public:
string triangleType(vector<int> &nums)
{
sort(nums.begin(), nums.end());
if (nums[0] + nums[1] <= nums[2])
return "none";
if (nums[0] == nums[1] && nums[1] == nums[2])
return "equilateral";
else ... | ALGO | 0.999897 | 5.409556 |
98447901-2ad0-47a1-ade3-48e540491291 | suhongkim/3D-Mesh-Decimation | lib/nanogui/ext/eigen/lapack/eigenvalues.cpp | #include "lapack_common.h"
#include <Eigen/Eigenvalues>
// computes eigen values and vectors of a general N-by-N matrix A
EIGEN_LAPACK_FUNC(syev,(char *jobz, char *uplo, int* n, Scalar* a, int *lda, Scalar* w, Scalar* /*work*/, int* lwork, int *info))
{
// TODO exploit the work buffer
bool query_size = *lwork==-1;... | ALGO | 0.99655 | 4.671507 |
657c9976-8b0c-4205-a59b-b44c84a47ab6 | diyaayay/DSAprograms | Strings/StringKeySort.cpp | #include <stdio.h>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
string extractToken(string str,int key){
char *s=strtok((char*)str.c_str()," ");
while(key>1){
s=strtok(NULL," ");
key--;
}
return (string)s;
}
int... | ALGO | 0.999757 | 4.119534 |
22a01d9c-853f-4026-b7f5-440ea97a9b80 | kunaltelangi/DSA-LAB-SE | 1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int m = 10;
void insert(ll x,ll (&h)[m]){
int i = x%m;
while(h[i] != 0 && h[i] != -1)i = (i+1)%m;
h[i] = x;
return;
}
bool search(ll x,ll (&h)[m]){
int i = x%m;
int j = i;
while(h[i] != 0 && h[i] != x){
i... | ALGO | 0.999189 | 4.090553 |
1c3bc657-b820-4d3b-8de7-2af8b7d02dff | aditi2802/LeetCode | Number of Ways to Arrive at Destination - GFG/number-of-ways-to-arrive-at-destination.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int countPaths(int n, vector<vector<int>>& roads) {
// code here
vector<pair<long long, long long>> adj[n];
for(auto it : roads){
... | ALGO | 0.99994 | 6.225053 |
6df833e2-05d8-46ac-9304-75850a721bd9 | manikanta2901/ubuntu | .history/imp/cpp/DataStructures/singlyLinklist/usingSTL_20200622143656.cpp | #include<bits/stdc++.h>
using namespace std;
void showlist(list <int> g) {
list <int> :: iterator it;
for(it = g.begin(); it != g.end(); ++it)
cout << '\t' << *it;
cout << '\n';
}
int main(){
list<int> linklist;
list<int> :: iterator it;
int size;
cout << "Enter the size of ... | ALGO | 0.999085 | 3.767924 |
78880253-8b8c-41d2-8b0a-abb7777cd77d | sarvex/leetcode-chef | solution/1700-1799/1704.Determine if String Halves Are Alike/Solution.cpp | class Solution {
public:
bool halvesAreAlike(string s) {
unordered_set<char> vowels = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'};
int cnt = 0, n = s.size() / 2;
for (int i = 0; i < n; ++i) {
cnt += vowels.count(s[i]);
cnt -= vowels.count(s[i + n]);
}
... | ALGO | 0.999514 | 6.324204 |
66916310-e150-488d-a9f9-c9168eb1e0cc | salmon2/practiceCoding | 11. 숫자의 총 개수(small).cpp | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
//freopen("input.txt", "rt", stdin);
int num;
int count = 0;
int temp;
int res;
int dec = 1;
cin >> num;
temp = num;
while(temp>0)... | ALGO | 0.999742 | 4.102561 |
f36c93aa-1c68-40eb-bfe5-85aa1c3b344d | walkccc/LeetCode | solutions/2507. Smallest Value After Replacing With Sum of Prime Factors/2507.cpp | class Solution {
public:
int smallestValue(int n) {
int primeSum = getPrimeSum(n);
while (n != primeSum) {
n = primeSum;
primeSum = getPrimeSum(n);
}
return n;
}
private:
int getPrimeSum(int n) {
int primeSum = 0;
for (int i = 2; i <= n; ++i)
while (n % i == 0) {
... | ALGO | 0.999983 | 6.715719 |
6df9b40f-9a64-41a3-a798-b2154b968a11 | liuyangme/CppStereoMatching | CostAggregationMatching/src/CensusTransform.cpp | //////////////////////////////////////////////////////////////////////
//Name: CensusTransform.cpp
//Created date: 15-11-2011
//Modified date: 29-1-2012
//Author: Gorkem Saygili, Jianbin Fang and Jie Shen
//Discription: Census transform of image and haar distance
///////////////////////////////////////////////////////... | ALGO | 0.996615 | 4.120228 |
a0e8803a-e7de-430e-869e-cdbf43d7249e | Abhishekjha002/Competitive_programming | DP/l001_CutType.cpp | #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;
void display(vector<int> &arr)
{
for (int ele : arr)
cout << ele << " ";
cout << endl;
}
void display2D(vector<vector<int>> &arr)
{
for (vector<int> ar : arr)
display(ar);
cout << endl;
}
... | ALGO | 0.999666 | 3.746561 |
d54504c6-ecfd-41d4-bcbf-b1b839f9b96e | kimhj02/Algorithm_Backjoon | 1072.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
long long total_game_num, win_game_num;
cin >> total_game_num >> win_game_num;
int current_rate = (win_game_num * 100) / total_game_num;
// 승률이 99% 이상이면 더 이상 증가할 수 없음
if (current_rate >= 99) {
cou... | ALGO | 0.999924 | 3.817763 |
12bf1a32-878f-4d15-af80-16673a99d58b | pingfansong/CDLSR | CDLSR_NIR/SPAMS/prox/mex/mexProximalFlat.cpp | #include <mex.h>
#include <mexutils.h>
#include <fista.h>
// alpha = mexProximalFlat(alpha0,param)
using namespace FISTA;
template <typename T>
inline void callFunction(mxArray* plhs[], const mxArray*prhs[],
const int nlhs) {
if (!mexCheckType<T>(prhs[0]))
mexErrMsgTxt("type of argument 1 is not cons... | ALGO | 0.999482 | 5.963862 |
957b2536-0f64-4491-b797-7ef4b23f8195 | Resteban368/Password_Strength_Checker | 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.998784 | 6.761023 |
68c92a61-0626-40c9-8223-b68561d6ba26 | jungeun-dev/Programmers_Algorithm_study | Stack_Queue/다리를 지나는 트력_변효근.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int bridge_length, int weight, vector<int> truck_weights) {
int answer = 1;
vector<int> timer(truck_weights.size(), 0); // 각 트럭마다 지나는 시간을 잴 vector, truck개수 만큼 선언하며 모두 0으로 초기화함.
int bridge_weight = 0; // 현재 다리에 올라가 있는 트럭들의 무게 총 합을 저장할 변... | ALGO | 0.999961 | 5.738657 |
61b8a235-fa3e-4b81-8e36-3dfa486be1d4 | WangJ509/dsp_hw3 | src/mydisambig.cpp | #include <File.h>
#include <Ngram.h>
#include <Vocab.h>
#include <VocabMap.h>
#include <execinfo.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
#define MAXWORDPERLINE 200
#define MAXCANDIDATE 1000
typedef struct record {
... | ALGO | 0.986066 | 4.815275 |
b8b63e13-697c-4e1c-b6ea-01c2a60afd2d | ishandutta2007/codeforces | x_qaeq/normal/660/E.cpp | //{{{
#include<bits/stdc++.h>
using namespace std;typedef long long ll;
template<typename T>inline void read(T &x)
{
x=0;char c=getchar(),f=0;
for(;c<'0'||c>'9';c=getchar()) if(c=='-') f=1;
for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
if(f) x=-x;
}/*}}}*/
const int P=1e9+7;int n,m,res=0;
inline int ksm(... | ALGO | 0.999986 | 3.64724 |
91cddf0a-d352-46f5-855c-269d77d66d5c | DexAsHisH/DSA-practice | Advance/Combination_sum_leetcode_39.cpp | #include<bits/stdc++.h>
using namespace std;
void combinationSum(vector<int> arr,int index,int target,int size,vector<vector<int>> &ans,vector<int> &nums){
if(index == size){
if(target == 0){
ans.push_back(nums);
}
return;
}
if(arr[index] <= target){
nums.push_b... | ALGO | 0.999881 | 5.106208 |
c0d09d10-d1f2-4dda-9948-5d2e35d70eeb | MUMINUR-RASHID/WEEKLY-PRACTICE | WEEK-5/C_Thermostat.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;cin>>t;
while(t--)
{
int l,h,d;
cin>>l>>h>>d;
int a,b;
cin>>a>>b;
if(a==b) cout<<0<<endl;
else if(abs(a-b)>=d) cout<<1<<endl;
else if((h-max(a,b))>=d||(min(a,b)-l)>=d) cout<<2<<endl;
... | ALGO | 0.999727 | 3.688887 |
c53e9b9f-e39a-47e3-9d2c-5153dd47aa7a | MikeS96/hackerrang_cpp | Cpp_course/week3_arithmetic/prefix_posfix.cpp | /*Goal: Practice PreFix and PostFix
**
Prefix operators increment the value of the variable, then return the reference to the variable.
Postfix operators create a copy of the variable and increments the value of the variable. Then it returns a copy from BEFORE the increment.
*/
#include<iostream>
using namespace st... | ALGO | 0.963115 | 4.271092 |
52efd5da-6c3c-4f8e-b08d-5edbfc93fa60 | Hee-Jae/Algorithm | bts_study/1717.cpp | #include <iostream>
#include <vector>
using namespace std;
struct Unf{
vector<int> v;
Unf(int n):v(n+1){
for(int i=0; i<=n; i++){
v[i] = i;
}
}
int find(int n){
if(v[n] == n) return n;
return v[n] = find(v[n]);
} // linear 한 트리가 만들어질 수 있기 때문에 find 를 할 때마다 최신화 해주는거지.
void merge(int ... | ALGO | 0.99998 | 4.804233 |
9469c4ed-38dc-47d5-b69e-6c4fb9ffc9cc | ntxq/PS-Baekjoon | 2000~2999/2798.cpp | #include <iostream>
#include <vector>
int main() {
int size, limit;
std::cin >> size >> limit;
std::vector<int> deck;
for (int i = 0, card; i < size; ++i) {
std::cin >> card;
deck.push_back(card);
}
int max = 0;
for (unsigned i = 0; i < deck.size(); ++i)
for (unsig... | ALGO | 0.999918 | 4.652545 |
a96514e7-c3b4-4bef-9598-af637c3e6472 | kevinfenger/algorithm_practice | trees/dfs.cpp | #include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <list>
#include <queue>
using namespace std;
class Node {
public :
bool visited;
int value;
list<Node*> children;
Node (int v) {
value = v;
}
void addChild(Node * n) {
children.p... | ALGO | 0.999976 | 5.031595 |
bfce1141-41be-4b39-b6fa-135699d6f9a2 | Mahi3104/cse205-ds | assignments/11.09.2023/867.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
int m=matrix.size();
int n = matrix[0].size();
vector<vector<int>> transposed(n,vector<int>(m));
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
transposed[j][i]=matrix[i][... | ALGO | 0.999952 | 6.409356 |
3e2c413b-e8be-49c8-9427-2d1114e21786 | Nishant-Pall/C-practice | parameterized_constructor.cpp | #include<iostream>
using namespace std;
class xyz
{
int a,b;
public: xyz(int a1,int b1)
{a=a1;b=b1;}
int mul()
{cout<<a*b<<endl;
return 0;}
};
int main()
{
int i,j;
cout<<"Enter first number:"<<endl;
cin>>i;
cout<<"Enter second number:"<<endl;
cin>>j;
xyz C1(i,j);
cout<<"Multiplication is"<<endl;
C1.mul();
return 0;
}
| TOOL | 0.972345 | 3.413898 |
ecf6442b-69ce-4399-a054-66e9aa96e1de | shrimaliashish/MyLeetCodeSolutions | 0 - 1 Knapsack Problem - GFG/0-1-knapsack-problem.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution
{
public:
//Function to return max value that can be put in knapsack of capacity W.
vector<vector<int>>dp;
int solve(int i,int w, int wt[], int val[], int n){
if(i<0)
return 0;
... | ALGO | 0.999997 | 5.824874 |
a0f9f19e-bea5-4cbd-bcbc-847ff08b1f60 | prntcena/C-Data-Structures | 450/sort012.cpp | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
int arr[] = {0,2,1,1,0,0,1,2};
int n = sizeof(arr)/sizeof(arr[0]);
int c0 = 0;
int c1 = 0;
int c2 = 0;
cout<< c0<<'\n'<<c1<<'\n'<<c2<<endl;
for(int i=0;i<n;++i)
{
if(arr[i] == 0)
{
... | ALGO | 0.999951 | 3.499311 |
a35437a3-fea7-48ed-91ad-b7a99817fd1f | akhilgolepu/Iris-Flower-Classification-WebApp | ifc_venv/Lib/site-packages/sklearn/svm/src/liblinear/tron.cpp | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "tron.h"
#ifndef min
template <class T> static inline T min(T x,T y) { return (x<y)?x:y; }
#endif
#ifndef max
template <class T> static inline T max(T x,T y) { return (x>y)?x:y; }
#endif
static void default_print(const char *buf)
{... | ALGO | 0.999595 | 5.847107 |
0330f85e-f057-433a-9595-5841738879f7 | thetygerpotatto/myAoC23 | day7/main.cpp | #include <cstddef>
#include <fstream>
#include <iostream>
#include <iterator>
#include <map>
#include <string>
#include <vector>
using std::string;
using std::vector;
using std::map;
static map<char, int> cardValue;
static std::ifstream file;
enum HAND_TYPE{
HIGH_CARD = 1,
ONE_PAIR,
TWO_PAIRS,
THREE_... | ALGO | 0.998478 | 5.213428 |
e96063fc-dd8d-48a3-a576-ba30c05db6b3 | curiositas-books/bring-your-own-int | reference-impl/lib/math/BigUInt.cpp | #include "curiositas/math/BigUInt.hpp"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <ranges>
#include <sstream>
#include <string>
namespace curiositas::math {
bool BigUInt::operator==(BigUInt const &other) const noexcept {
return (*this <=> other) == std::strong_ordering::equal;
}
std::stro... | ALGO | 0.983483 | 7.291194 |
76f1e3bd-9d50-4846-be73-84de51bf49c7 | NusantaraProject-ROM/android_system_extras | simpleperf/runtest/two_functions.cpp | #include <stdlib.h>
constexpr int LOOP_COUNT = 100000000;
volatile int a[2];
void Function1() {
volatile int* p = a + atoi("0");
for (int i = 0; i < LOOP_COUNT; ++i) {
*p = i;
}
}
void Function2() {
volatile int* p = a + atoi("1");
for (int i = 0; i < LOOP_COUNT; ++i) {
*p = i;
}
}
int main() {
... | TOOL | 0.86391 | 4.694404 |
008efaa7-1078-4513-b68e-5ebbfbf5fc9a | Tabishcode/week6tasks | task6cp.cpp | #include <iostream>
using namespace std;
main()
{
string month;
int stays,charges1,charges2;
cout<<"enter month name:";
cin>>month;
cout<<"enter number of stays:";
cin>>stays;
if(month== "may" || month == "october" && stays >7 && stays <14)
{
charges1=((50*stays)-(50*stays*5)/100... | TOOL | 0.907946 | 3.95469 |
f9569d7f-0335-47ec-964a-df4519ad8776 | javasucks69/sharedrepo | augustChallange/zombies.cpp | #include<bits/stdc++.h>
#include "../vectorprint.cpp"
using namespace std;
int main(){
int t;
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
cin>>t;
while(t--){
long n;
cin>>n;
vector<long> arr,c;
unordered_multiset<long> h;
for(long i =0 ;i ... | ALGO | 0.999948 | 3.528867 |
3d92fc44-bcf6-4a54-9934-5aac36e35e66 | ankit13022/codeforces | 978A.cpp | #include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <bitset>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <unordered_set>
#include <map>
#include <unordered_map>
using namespace std;
#define ll long long
#define mp make_pair
#define um unor... | ALGO | 0.999822 | 4.703985 |
d3d446df-a5f9-4af8-bc0a-0b001499ecd6 | nayon-kumar/Codeforces-Solution | 112 - A. Petya and Strings.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int i, l, j, x=0;
string st1, st2;
cin >> ws;
getline(cin, st1);
cin >> ws;
getline(cin, st2);
l = st1.size();
for(j=0; j<l; j++){
st1[j] = tolower(st1[j]);
st2[j] = tolower(st2[j]);... | ALGO | 0.999918 | 3.452559 |
35ced56a-7e60-430b-a75d-ce1c9e9e1c76 | nguyenquanghuy111/BT-C | ss8_ex5.cpp | #include<stdio.h>
int main(){
//khai bao va gan gia tri cho ma tran
int arr[4][4] ={{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}};
int sum =0;
//tinh tong cac phan tu tren duong bien
//ktra cac phan thuoc duong bien
for(int i = 0; i < 4; i++){
for(int j = 0; j < 4; j++){
if(i ==0 || i == 4-1 || j == 0... | ALGO | 0.99992 | 3.068403 |
39199e4f-636e-417f-821a-d57e50c8f637 | mirtaba/ACMICPC-INOI_Archive | Olympiad Programs/Helli Programming Training/3A.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;
const int MAXN = 300, MAXX = 10000+10;
int N, X, coin[MAXN];
vector <int> ans, v;
bool dp[MAXX][MAXN];
int main()
{
ios::sync_with_stdio(0);
cin >> N >> X;
for (int i = 0 ; i < N ; i++)
cin >> coin[i];
for (int ... | ALGO | 0.999985 | 3.38266 |
184e6ede-a05f-46d4-819d-e43729936cf3 | Grdsznt/DMOJ-Solutions | DMOPC2016C1P5.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
/* TYPES */
#define ll long long
// #define pii pair<int, int>
// #define pll pair<long long, long long>
// #define vi vector<int>
// #define vll vector<long long>
// #define mii map<int, int>
// #define si set<int>
// #define sc set<char>
// /* INPUT... | ALGO | 0.999904 | 4.525779 |
83975884-2768-4cca-a621-3f45b25bfc10 | ishandutta2007/codeforces | fanache99/normal/1307/A.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cassert>
#include <map>
#include <numeric>
#include <cstring>
#include <set>
#include <ctime>
#include <queue>
#include <cmath>
#include <iomanip>
#include <iterator>
#include <bitset>
#include <unordered_map>
#incl... | ALGO | 0.99992 | 4.024466 |
0cd960b2-ff2d-4979-bf43-233c9a3fa83b | ishandutta2007/codeforces | hongzy/normal/1327/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ucin ios::sync_with_stdio(0), cin.tie(0)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned long long ull;
const int N = 1e5 + ... | ALGO | 0.999921 | 4.119488 |
0a69655c-4096-4676-8f25-cd3edca8ac50 | prasachin/DSA | strings/anagram.cpp | #include <bits/stdc++.h>
using namespace std;
/* TYPES */
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define vs vector<string>
#define vvll vector<vector<long long>>
#define vpi vector<pair<int, int>>
#define vpll vector<... | ALGO | 0.999988 | 4.356558 |
26399fd7-d228-45a5-9afe-7c12f0f9712b | mukul2259/frameworks_native | vulkan/libvulkan/api.cpp | // The API layer of the loader defines Vulkan API and manages layers. The
// entrypoints are generated and defined in api_dispatch.cpp. Most of them
// simply find the dispatch table and jump.
//
// There are a few of them requiring manual code for things such as layer
// discovery or chaining. They call into functi... | CONFIG | 0.930953 | 4.624862 |
472471c0-0604-4ec7-b8bf-d97203dbdea3 | BatarchiZ/AlgorithmsAndDataStructures | HW3/B.cpp | #include <iostream>
#include <vector>
struct Node {
Node() : index(0) {};
std::vector<Node *> vertices;
size_t index;
};
std::vector <Node> readInput() {
size_t n, e;
std::cin >> n >> e;
std::vector <Node> nodes(n);
for (size_t i = 0; i < n; ++i) {
nodes[i].index = i;
}
// w... | ALGO | 0.999986 | 4.781737 |
5b319e3c-e7e7-42f4-af86-f06c96fe7a7d | skv-1180/ICPC-Template | NumberTheory/Mint.cpp | const int MOD=1e9+7;
class Mint{
public:ll val;
static ll gcdExtended(ll a, ll b, ll *x, ll *y) { if (a == 0) { *x = 0, *y = 1; return b; } ll x1, y1; ll gcd = gcdExtended(b%a, a, &x1, &y1);*x = y1 - (b/a) * x1; *y = x1; return gcd; }
static ll mod_exp(ll a, ll b){ ll res=1; a=a%MOD; while(b>0){ if(b%2==1... | ALGO | 0.999663 | 4.401227 |
9bbe3e44-8850-4466-bde9-3670509a94af | theitdude87/zeena-help | 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 |
a9d89cef-7a54-49c2-bb38-1abbb9b3af24 | kshkss/ct | lib/fbp.cpp | #include <cstring>
#include <cstdio>
#include <cmath>
#include "device_ptr.h"
#include "misc.h"
#include "iradonT.h"
extern "C"{
void fbp(float *sino, float *ct, int width, int n_angles, float *angles, float center);
}
void fbp(float *sino, float *ct, int width, int n_angles, float *angles, float center)
{
float* ... | ALGO | 0.926208 | 3.963508 |
e6c997b7-4e01-4955-8143-a5bc839f40a9 | fuxy2010/RTMPServer | crtmpserver/sources/common/src/platform/linux/linuxplatform.cpp | #ifdef LINUX
#include "platform/linux/linuxplatform.h"
#include "common.h"
string alowedCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
static map<int, SignalFnc> _signalHandlers;
LinuxPlatform::LinuxPlatform() {
}
LinuxPlatform::~LinuxPlatform() {
}
string format(string fmt, ...) {... | TOOL | 0.928113 | 4.313137 |
bf9c6653-a266-4009-bdae-62244db503e6 | goingeast/data-structure-and-algorithms | 321-Create-Maximum-Number/solution.cpp | class Solution {
public:
vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
int m = nums1.size(), n = nums2.size();
vector<int> res;
for (int i = max(0, k - n); i <= min(k, m); ++i) {
res = max(res, mergeVector(maxVector(nums1, i), maxVector(nums2, k - i)));
... | ALGO | 0.999997 | 5.483195 |
73c20156-d0a3-426c-93d5-b2cf56f54ec5 | yzj-again/leetcode | 70.climbing-stairs.cpp | /*
* @lc app=leetcode id=70 lang=cpp
*
* [70] Climbing Stairs
*/
/*
1.dp[i]:爬到第i层,有dp[i]种方法
2.dp[i]=dp[i-1]+dp[i-2]
3.dp[1]=1;dp[2]=2;
4.从前向后
5.遍历数组
*/
// @lc code=start
class Solution
{
public:
int climbStairs(int n)
{
if (n <= 2)
return n;
vector<int> dp(n + 1);
dp[1] =... | ALGO | 0.999964 | 5.958743 |
8581185a-893d-462d-a67f-29adc85b5529 | Masud-Abdullah/Online-Judges | AtCoder/A_First_ABC.cpp | #include <bits/stdc++.h>
#define nl "\n"
#define nn (cout << "NO\n")
#define yy (cout << "YES\n")
#define ss " "
#define ll long long
#define ull unsigned long long
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a / gcd(a, b)) * b)
#define pii pair<int, int>
#define pll pair<long long, long long>
#define sz(v) (int)... | ALGO | 0.999881 | 4.018493 |
2d8f49c3-1a8a-4d6a-ae68-acf7f245b0e5 | dlrghks2090/Baekjoon_Programmers | 프로그래머스/lv1/72410. 신규 아이디 추천/신규 아이디 추천.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string new_id) {
string answer = "";
int id_size = new_id.size();
int an_size;
for (int i = 0; i < id_size; i++) {
if (new_id[i] >= 65 && new_id[i] <= 90) {
answer.push_back(new_id[i] + 32);
}
... | ALGO | 0.999705 | 6.067867 |
8c372414-a05f-4e53-a7c6-156294440889 | tynnp/CP-Practice | UPCODER/LTCB-50.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a[1000], k = 0;
cin >> n;
while (n) {
a[k] = n % 10;
n /= 10;
k++;
}
for (int i = 0; i < k; i++)
cout << a[i];
return 0;
} | ALGO | 0.99961 | 5.314842 |
8ddc2f76-57ca-4528-9899-4e72059c0365 | alexander707070/Problems | C/Контроли/wall/author/subtask_3.cpp | #include<bits/stdc++.h>
#define MAXN 100007
using namespace std;
struct event{
long long pos;
long long h;
int kind;
};
struct tower{
long long h;
long long len;
};
int n;
long long S,H,K,last,x,y,t,h,ans;
vector<event> v;
vector<tower> w;
bool cmp(event fr,event sc){
if(fr.pos!=sc.pos)retu... | ALGO | 0.998676 | 3.520925 |
4ca6d96d-e286-4f9c-b6b8-88c0b016c031 | JunHaoSu/Algorithm | For_course/Tennis_cycle_schedule.cpp | /*************************************************************************
> File Name: Tennis_cycle_schedule.cpp
> Author:
> Mail:
> Created Time: 2018年03月11日 星期日 13时19分05秒
网球循环赛,一个分治法填表的过程
************************************************************************/
#include<iostream>
using namespace std;
vo... | ALGO | 0.999408 | 3.094812 |
cb950f19-0467-4ac3-99b2-156e6b029f38 | luobuyu/Code-test-daily | other/tmpfile/串门.cpp | // #pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
#define lll long long
#define PII pair<int, int>
namespace FAST_IO
{
inline char nextChar()
{
static char buf[1000000], *p1 = buf, *p2 = buf;
return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ?... | ALGO | 0.999948 | 4.118226 |
3cef6a31-ae63-4b33-8d36-bc4da6f71584 | rdcentermrzhi/boost_1_60_0 | libs/msm/example/mpl_graph/breadth_first_search.cpp | #include <boost/msm/mpl_graph/breadth_first_search.hpp>
#include <boost/msm/mpl_graph/adjacency_list_graph.hpp>
#include <boost/msm/mpl_graph/incidence_list_graph.hpp>
#include <iostream>
namespace mpl_graph = boost::msm::mpl_graph;
namespace mpl = boost::mpl;
// vertices
struct A{}; struct B{}; struct C{}; struct D... | TEST | 0.957826 | 5.932122 |
a5b9a897-55f1-47da-8d1c-143f786c5ff6 | prozod/fundam-prog-a1s1 | assignment_03/7.cpp | #include <iostream>
int main() {
int a, suma = 0;
do {
std::cout << "Introduceti un numar (urmat de tasta Enter): ";
std::cin >> a;
if (a % 2 != 0 && a % 3 == 0) {
break;
} else if (a % 2 == 0) {
suma += a;
} else {
std::cout << "Ai introdus " << a << " care nu este divizibi... | ALGO | 0.983778 | 4.346347 |
c14b7c5a-6ec9-4829-bf30-c72cc27e8401 | waynezhangus/leetcode-solutions | C++/560-subarray-sum-equals-k.cpp | #include "header.h"
class Solution {
public:
int subarraySum(vector<int>& nums, int k) {
int res = 0, sum = 0;
unordered_map<int, int> map;
map[sum]++;
for (int num : nums) {
sum += num;
res += map[sum - k];
map[sum]++;
}
return re... | ALGO | 0.999944 | 6.06342 |
404ef52c-e2cf-4bc3-b324-6de82de6ace5 | Nogueirarenato/URI | Resolucoes_C/URI_1019 - (8420976) - Accepted.cpp | #include<stdio.h>
#include<math.h>
int main()
{ int n, minutos, segundos, horas;
scanf("%d",&n);
if(n<60) printf("0:0:%d\n",n);
if(n>=60 && n<3600)
{minutos=n/60;
segundos= n-(minutos*60);
printf("0:%d:%d\n",minutos,segundos);
}
if(n>=3600)
{horas=n/3600;
minutos=n-(horas*3600);
minutos=minut... | ALGO | 0.99174 | 3.323742 |
6b0e3d48-d031-4be6-adba-c95ac8094951 | Yusuf-sust/Problem_Solving | AL PRAGRAM/CPP/maximumsum.cpp | #include <bits/stdc++.h>
using namespace std;
int a[100], n;
int maximum()
{
int curmax = -1, max = -10000000, i;
for(i = 0; i < n; i++)
{
if(curmax < 0)
{
curmax = a[i];
}
else
curmax += a[i];
if(curmax > max)
max = curmax;
}
... | ALGO | 0.999803 | 3.567863 |
975b6da3-6e1f-47e5-a2af-f3966414aadc | tcmmichaelb139/Competitive-Programming | CSES/Sorting and Searching/2217 - Collecting Numbers II.cpp | #include "bits/stdc++.h"
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n, q;
cin >> n >> q;
vector<int> v(n), ind(n);
for (int i = 0; i < n; i++) {
cin >> v[i];
v[i]--;
ind[v[i]] = i;
}
int ans = 1;
for (int i = 1; i < n; i++)
... | ALGO | 0.999907 | 4.077677 |
f4e31117-f30b-4c7e-910c-a012dfb99121 | ssugam10/leetcode-solutions | 0234-palindrome-linked-list/0234-palindrome-linked-list.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* reverseList... | ALGO | 0.999803 | 5.83701 |
f5ce7546-8c93-466b-b2d1-f16a213f287d | oldw4ng/LeetCode | code/1030.matrix-cells-in-distance-order.cpp | /*
* @lc app=leetcode id=1030 lang=cpp
*
* [1030] Matrix Cells in Distance Order
*
* https://leetcode.com/problems/matrix-cells-in-distance-order/description/
*
* algorithms
* Easy (64.20%)
* Likes: 86
* Dislikes: 49
* Total Accepted: 11.4K
* Total Submissions: 17.8K
* Testcase Example: '1\n2\n0\n0'... | ALGO | 0.999869 | 5.774577 |
ee68f86c-3493-4f92-9961-40ddd446bf95 | fabricix/MPM-Geomechanics | src/Integration.cpp | #include "Integration.h"
void Integration::nodalMomentum(Mesh* mesh, double dt) {
// get mesh
vector<Node*>* nodes = mesh->getNodes();
// for each node
#pragma omp parallel for shared(nodes, dt)
for (int i = 0; i < static_cast<int>(nodes->size()); ++i) {
if (!nodes->at(i)->getActive()){ continue; }
// ... | ALGO | 0.997831 | 5.157354 |
723d6502-c106-4fef-88c3-5e2b94c2aebb | Akshay2224/Competitive-Programming-23-24 | celsiusToFarhenit.cpp | #include<iostream>
using namespace std;
int main(){
/* Read input as specified in the question.
* Print output as specified in the question.
*/
int start,end,gap;
cin>>start>>end>>gap;
int curr=start;
while(curr<=end)
{
int celsius = (curr-32)*(5.0/9);
cout<<curr<<" "<<celsius<<endl;
curr = curr... | ALGO | 0.998567 | 3.095951 |
23e599a1-e3b7-468f-9ea4-130cabc195ef | Abhinav-1409/OPCode | A_Codeforces_Checking.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define In \
for (ll i = 0; i < n; i++) \
cin >>
#define test \
ll t; \
cin >> t; \
while (t--)
#define Y cout << "YES" << endl;
#define N cout << "NO" << endl;
#define fast \
io... | ALGO | 0.997539 | 4.160501 |
85003e88-2018-46fa-b519-ce178ea5ea91 | score-p/scorep_cmake | examples/kokkos/fibonacci.cpp | #include <iostream>
#include <sys/types.h>
#include <vector>
#include <boost/program_options.hpp>
#include <Kokkos_Core.hpp>
namespace options = boost::program_options;
static unsigned long fibonacci(unsigned long element) {
unsigned long a = 0;
unsigned long b = 1;
while (element > 0) {
auto tmp ... | ALGO | 0.997326 | 5.873436 |
95f71d85-269c-465b-8178-bb7d670f8f04 | Abdalaziz2023/C-_Examples_and_DataStructure | C++revesion/C++problem solving/q8.cpp | #include<iostream>
using namespace std;
int main()
{
int score;
cout<<"Enter score: ";
cin>>score;
switch (score / 10)
{
case 9:cout<<"A";break;
case 8:cout<<"B";break;
case 7:cout<<"C";break;
case 6:cout<<"D";break;
case 5:cout<<"F";break;
case 4:cout<<"G";break;
case 3... | TOOL | 0.96808 | 3.391788 |
3b968e20-7bca-44f5-9c46-686412ba5788 | Najmuzzaman/Codechef | codechef148/b.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n=1,a,b;
string s;
cin>>n>>a>>b;
vector<int> v(n);
cin>>s;
int x=0, y=0;
bool possible=false;
for(int i=0;i<n;i++)
{
if (s[i] ... | ALGO | 0.99996 | 4.846809 |
e49b0697-1b1d-494d-bf0c-dc22fc9c072f | reinaldoossuna/cppdatastructures | Lesson4/Exercise19/main.cpp | #include <iostream>
#include "./merge_sort.h"
int main() {
std::vector<int> S1{ 45, 1, 3, 1, 2, 3, 45, 5, 1, 2, 44, 5, 7 };
std::cout << S1 << std::endl;
auto sorted_S1 = merge_sort<int>(S1);
std::cout << sorted_S1;
}
| ALGO | 0.999343 | 5.195151 |
df16babe-61ce-46c1-9ce3-4dd784b147e8 | righthand0521/LeetCode | src/85.cpp | #include <algorithm>
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Solution {
public:
int maximalRectangle(vector<vector<char>>& matrix) {
int retVal = 0;
int rowSize = matrix.size();
if (rowSize == 0) {
return retVal;
}
i... | ALGO | 0.999636 | 6.481459 |
11fe2875-403e-4f52-9d52-f7523edb67ad | 13750404/2025aaia | week01-1.cpp | /// weel01-1.cpp 要自己打好全部檔名, 後面要打.cpp
/// 在瘋狂程設(練習模式)寫好的程式碼, 全選, Ctrl-C
/// CodeBlocks File-NewEmpty 空白檔案, Ctrl-S存檔
#include <stdio.h> ///使用standard 標準的 input/output
int main()
{
int a, b; ///整數a, b
scanf("%d%d",&a, &b); ///讀入資料 小心 "%d%d" 後面[逗號]
/// 兩個%d%d & &
printf("%d",a+b); ///印出資料, 把答案印出來
}
| ALGO | 0.996579 | 3.227541 |
436959ef-9708-4336-aaa5-861348ceafa4 | Hassan-Irtaza/Projects-folder | Practice/swap.cpp | #include <iostream>
using namespace std;
void swap2(int &a, int &b)
{
int temp = a;
a = b;
b = temp;
}
int main()
{
int a, b;
cout << "Enter a num: ";
cin >> a;
cout << "Enter a num: ";
cin >> b;
cout << "Before Swap" << endl;
cout << "A = " << a << endl;
cout << "B = " << ... | ALGO | 0.999224 | 5.511922 |
9e3e9458-da0b-4935-973d-f9b165a71596 | michaelhuo/cpp | find_buy_sell_stock_prices.cpp | #include <cstdlib>
#include <climits>
#include <utility>
#include <tuple>
using namespace std;
tuple<int, int> find_buy_sell_stock_prices(int* array, int size) {
//TODO: Write - Your - Code
tuple<int, int> result(std::make_pair(-1, -1));
if (size < 2) {
return result;
}
vector<int> min_left(size, INT_MA... | ALGO | 0.999876 | 5.468743 |
cb1d2ce4-5532-4ed0-a863-fe68ac06b034 | frcepeda/Contest-Archive | Nexu/intro.cpp | #include <cstdio>
using namespace std;
int main(){
int f[30];
f[0] = 0; f[1] = 1;
for (int i = 2; i <= 26; i++)
f[i] = f[i-1] + f[i-2];
printf("%d\n", f[26]);
}
| ALGO | 0.998841 | 3.438714 |
c240160d-3085-4d86-921e-5fca1b488cad | sujingbo0217/NCUT | Data-structure/7_Maze.cpp | /**
* author: Jingbo Su
* created: 07/12/2021
**/
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
const int inf = 0x3f3f3f3f;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int n, m;
cin >> n >> m;
vector<v... | ALGO | 0.999991 | 5.831872 |
b4f4d984-2e59-475b-9aa1-1ae3edc8d191 | JellePiepenbrock/mlcvc5-LPAR | src/theory/quantifiers/term_tuple_enumerator_utils.cpp | #include "theory/quantifiers/term_tuple_enumerator_utils.h"
#include <iterator>
#include <ostream>
#include "base/check.h"
namespace cvc5::internal {
/** Tracing purposes, printing a masked vector of indices. */
// YAN: duplicated
//void traceMaskedVector(const char* trace,
// const char* name,... | TOOL | 0.887531 | 6.381728 |
4ac63352-6350-45e1-bc17-036411e603db | ttyen2k5/Thuat_toan_NITC_2024 | Buoi4_b4.1(thamlam).cpp | #include<bits/stdc++.h>
using namespace std;
void psoAiCap(int a, int b)
{
if(a==0 || b==0) return;
if(b%a==0)
{
cout << 1 << ' ' << b/a;
return;
}
int x= b/a +1;
cout << 1 << ' ' << x << endl;
psoAiCap(a*x-b, b*x);
}
int main()
{
int a, b;
cin >> a >> b;
psoAiCa... | ALGO | 0.999853 | 4.704047 |
c8db7bea-9e55-4909-9349-d9ee9cfa6b2e | kfullington/TestPricing | ql/math/integrals/discreteintegrals.cpp | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <ql/math/integrals/discreteintegrals.hpp>
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++11-extensions"
#endif
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulato... | ALGO | 0.998964 | 7.161805 |
630aaa53-a8bd-4dbd-be09-704cda5ab4c4 | luobuyu/Code-test-daily | leetcode/data_struct/907_2.cpp | // #pragma GCC optimize(2)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lll long long
#define PII pair<int, int>
namespace FAST_IO
{
static string buf_line;
static int _i;
static int _n;
static char _ch;
template <class T>
inline bool read(T &x)
{
T flag... | ALGO | 0.999984 | 4.622629 |
c40679fb-9d38-4f6f-8eaa-e87132a1e54b | BrunoReX/palemoon | netwerk/protocol/http/SpdyStream2.cpp | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
// HttpLog.h should generally be included first
#include "HttpLog.h"
#include "nsHttp.h"
#include "SpdySession2.h"
#include "SpdyStream2.h"
#include "nsAlgorithm.h"
#include "prnetdb.h"
#include "nsHttp... | WEB | 0.873546 | 6.525083 |
e3a5762a-160b-470b-8ab6-168890e26816 | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/CodeLlama/top0-100/maximum-performance-of-a-team-Solution.maxPerformance/177768_DoS.cpp | sparse_dump_region (struct tar_sparse_file *file, size_t i)
{
union block *blk;
off_t bytes_left = file->stat_info->sparse_map[i].numbytes;
if (!lseek_or_error (file, file->stat_info->sparse_map[i].offset))
return false;
while (bytes_left > 0)
{
size_t bufsize = (bytes_left > BLOCKSIZE) ? BLOCKS... | TOOL | 0.98845 | 6.127781 |
3cffbfbb-542d-4771-8cb1-b479e474841a | Lalith3470/LeetCode_Solutions | 59. Spiral Matrix II.cpp | class Solution {
public:
vector<vector<int>> generateMatrix(int n) {
vector<vector<int>>dp(n,vector<int>(n,0));
int cnt=1;
int top=0,bottom=n-1,left=0,right=n-1;
while(top<=bottom && left<=right){
for(int i=left;i<=right;i++){
dp[top][i]=cnt;
... | ALGO | 0.999932 | 5.748401 |
86f56336-c772-40bc-9e77-335f94e73a85 | cwza/leetcode | cpp/113. Path Sum II.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nu... | ALGO | 0.99997 | 5.510521 |
be701906-9226-4da0-b289-52223b272c66 | orlyomyim/lab-13 | lab13_1.cpp | #include<iostream>
#include <ctime>
using namespace std;
long long int fibonacci(long long int ) ;
int main(){
clock_t start = clock();
cout << "Result: " << fibonacci(50) << "\n";
clock_t end = clock();
double elapsed = double(end - start)/CLOCKS_PER_SEC;
cout << "Elapsed Time: " << elapsed << " s... | ALGO | 0.999271 | 4.574809 |
b2b54f6f-f015-4e59-bae5-717ea8f3b50d | aokblast/LeetCode_Problem_Solving | Eazy/1009_Complement_of_Base_10_Integer.cpp | //
//Runtime 0
//Memory Usage 5.9
class Solution {
public:
vector<int> constructArray(int n, int k) {
vector<int> res;
int l = 1, r = n;
while(l <= r)
res.push_back(k >= 1 ? (k-- % 2 ? l++ : r--) : l++);
return res;
}
}; | ALGO | 0.999987 | 5.086369 |
013636e4-d28f-4cd4-bc72-36558316b188 | iRoy7/algo-progs | dp_binominal_coefficient.cpp | #include <stdio.h>
#include <time.h>
#define MAXIS 100
int n, k;
int dt[MAXIS + 1][MAXIS+1];
inline int min(int a, int b) { return (a > b) ? b : a; }
static int
bin(int n, int k)
{
if (k == 0 || n == k) return 1;
else
return bin(n - 1, k - 1) + bin(n - 1, k);
}
static int
binDp(int n, int k)
{
if (k == 0 || n ... | ALGO | 0.999798 | 3.938672 |
88e50215-04ca-414f-b07e-9b53ea87d45f | saidul-07/ProblemSolving | CSES_FI/Searching and Sorting/1640 - Sum of Two Values.cpp | /********************************************************/
/********************************************************/
/** BISMILLAHIR RAHMANIR RAHIM **/
/** Read the name of Allah, who created you **/
/** ... | ALGO | 0.999967 | 3.915127 |
d92c3b26-fab5-492b-bed4-e252111c9ed2 | snmath-pi/DataStructures | 450DSASHEET/Matrix/CountRowwithMax1(ONlogM).cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
int rowWithMax1s(vector<vector<int> > arr, int n, int m) {
// code here
int mx = 0;
for(int i=0; i<n; i++) {
int cur = lower_bound(arr[i].begin(),... | ALGO | 0.99997 | 6.270334 |
3c7cd090-d4b5-46c1-8ec9-603a82a585c6 | touya-den/cpp_beginner | ex68.cpp | #include <iostream>
#include <string>
using namespace std;
string test(string s, int a){
string temp = "";
if(s.length() == 1) return s + s;
if(s.length() < a*2 ){
if(s.length() + 1 == a*2){
for(int i = s.length() - 1; i >= a - 1; i--){
temp = s[i] + temp;
}
... | ALGO | 0.999715 | 3.925795 |
68150d60-05b4-4de5-b8ae-c77fa33a88bd | sudiroeen/GMM-EM | main.cpp | #include "GMM_EM.hpp"
Mat gambar;
Mat gambarClone;
Point titikStart;
bool afterDownBeforeUp = false;
Rect rectROI;
static void onMouse(int event, int x, int y, int, void*){
int xrs, yrs, lx, ly;
if(afterDownBeforeUp){
gambar = gambarClone.clone();
xrs = min(titikStart.x, x);
yrs = min... | ALGO | 0.921557 | 5.373317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.