uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
b9e9f34d-0adc-4594-b063-cd8672a69724 | kenlig/oi-wiki-test | docs/string/code/suffix-bst/suffix-bst_2.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 8e5 + 5;
const double INF = 1e18;
void decode(char* s, int len, int mask) {
for (int i = 0; i < len; ++i) {
mask = (mask * 131 + i) % len;
swap(s[i], s[mask]);
}
}
int q, n, na;
char a[N], t[N];
// SuffixBST(SGT Ver)
// 顺序加入,查询时将询问串翻转
// 以i结束的... | ALGO | 0.999417 | 4.501437 |
34161744-410f-4f61-ae3b-d0b1ede32fc4 | uji-ros-pkg/uwsim_bullet | Extras/ConvexDecomposition/raytri.cpp | #include "float_math.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "raytri.h"
// http://codesuppository.blogspot.com
//
// mailto: <EMAIL>
//
// http://www.amillionpixels.us
//
/* a = b - c */
#define vector(a,b,c) \
(a)[0] = (b)[0] - (c)[0]; \
(a)[1] ... | ALGO | 0.996244 | 5.583248 |
2d8d4eb8-5da5-439f-9ceb-87c35717d288 | Mayank9mare/Operating-System-Labwork | lab_problem/q1.cpp | #include <bits/stdc++.h>
#define pb push_back
#define mk make_pair
#define ll long long
#define ss second
#define ff first
#define pll pair<ll,ll>
#define vll vector<ll>
#define mll map<ll,ll>
#define all(cont) cont.begin(), cont.end()
using namespace std;
int cmp(pair<int,pll> a,pair<int,pll> b){
if(a.first<b.fir... | ALGO | 0.999875 | 3.958367 |
b068cf32-73c9-4291-83c2-6377f8667e14 | lucianmot/codechef-problems | 273 - C++ - IPL Ticket Rush.cpp | // C++ - IPL Ticket Rush
// Rating - 273
// https://www.codechef.com/problems/IPLTRSH
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, m;
cin >> t;
while(t--) {
cin >> n >> m;
if(n > m) cout << n - m << "\n";
else cout << 0 << "\n";
}
return 0;
} | ALGO | 0.99988 | 4.459958 |
04530c79-43cc-49b9-96f1-1c3b8ef9c266 | arash16/prayers | UVA/vol-011/1196.cpp | /*
>>~~ UVa Online Judge ACM Problem Solution ~~<<
ID: 1196
Name: Tiling Up Blocks
Problem: https://onlinejudge.org/external/11/1196.pdf
Language: C++
Author: Arash Shakery
Email: <EMAIL>
*/
#include <stdio.h>
#include <algorithm>
#include <list>
using namespace std;
#define MAX 10005
int X[MAX], Y[MA... | ALGO | 0.999963 | 3.685432 |
0d63306a-9e3d-4d2a-8973-f29bdacdb633 | Shakib7784/Data_Structure_with_CPP | Module 43_ final_lab/new.cpp | #include <bits/stdc++.h>
using namespace std;
// Structure of tree node
struct Node {
int key;
struct Node *left, *right;
};
// Utility function to
// create a new node
Node* newNode(int key)
{
Node* temp = new Node;
temp->key = key;
temp->left = temp->right = NULL;
return (temp);
}
// Functio... | ALGO | 0.999976 | 4.936889 |
edb5b4c5-fc2f-4ca6-942e-574623d36ba1 | Aryan-chaudhry/Leetcode-POTD | 1029-vertical-order-traversal-of-a-binary-tree/vertical-order-traversal-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999996 | 6.347589 |
4073c8b0-8100-433f-a4e1-582d4817eee1 | alantany/cpprep | Map2.cpp | #include<string>
#include<map>
#include<vector>
#include<algorithm>
#include<iostream>
#include<fstream>
#include<set>
using namespace std;
typedef pair<string, size_t> PAIR;
bool sort_by_value(PAIR &v1, PAIR &v2) {
return v1.second > v2.second;
}
int main() {
set<string> exclude = { "The","the","But","but","And","a... | ALGO | 0.998233 | 4.411891 |
73830db7-b4a9-4e66-8dd7-57c7d0d490c8 | vivoinnovaonexgobyte/vivoinnovaonexgobyte | src/policy/fees.cpp | #include "policy/fees.h"
#include "policy/policy.h"
#include "amount.h"
#include "primitives/transaction.h"
#include "streams.h"
#include "txmempool.h"
#include "util.h"
void TxConfirmStats::Initialize(std::vector<double>& defaultBuckets,
unsigned int maxConfirms, double _decay, std::s... | ALGO | 0.947804 | 5.537006 |
59134683-ef06-43ec-b492-8d3fee214a4a | gunterzhang/cascade-boosting | CascadeBoosting3.2/CascadeBoosting/IntegralImage.cpp | #include "stdafx.h"
#include "IntegralImage.h"
IntegralImage::IntegralImage(void)
{
s = NULL;
pt_intg_0 = NULL;
pt_sq_intg_0 = NULL;
s1 = NULL;
s2 = NULL;
s1_temp = NULL;
s2_temp = NULL;
pt_intg_45 = NULL;
pt_sq_intg_45 = NULL;
}
IntegralImage::~IntegralImage(void)
{
cleanUp();
}
void IntegralImage::clean... | TOOL | 0.982559 | 4.391321 |
d4ce3b8b-b8f3-4882-af5a-b3532461dc1a | oxygen-hunter/Flashboom | data/big-vul-100/add_attention_code/Phi/top0-100/escape-the-spreading-fire-Solution2.maximumMinutes/177843_+Info.cpp | _PUBLIC_ size_t strlen_m_ext_handle(struct smb_iconv_handle *ic,
const char *s, charset_t src_charset, charset_t dst_charset)
{
size_t count = 0;
#ifdef DEVELOPER
switch (dst_charset) {
case CH_DOS:
case CH_UNIX:
smb_panic("cannot call strlen_m_ext() with a variable dest charset (must be UTF16* or UTF8)"... | ALGO | 0.991015 | 5.237037 |
5366bf3a-4028-4339-8e4e-11a3d28be19f | jhbaek04/mfem-4.6 | fem/tmop/tmop_pa_da3.cpp | #include "../tmop.hpp"
#include "tmop_pa.hpp"
#include "../../general/forall.hpp"
#include "../../linalg/kernels.hpp"
namespace mfem
{
MFEM_REGISTER_TMOP_KERNELS(void, DatcSize,
const int NE,
const int ncomp,
const int sizeidx,
... | TOOL | 0.979734 | 5.781902 |
6ec8030d-b75c-470d-9404-23cd3516c9dd | DuanYaQi/leetcode | DS_Tree/117+connect.cpp | /*
// Definition for a Node.
class Node {
public:
int val;
Node* left;
Node* right;
Node* next;
Node() : val(0), left(NULL), right(NULL), next(NULL) {}
Node(int _val) : val(_val), left(NULL), right(NULL), next(NULL) {}
Node(int _val, Node* _left, Node* _right, Node* _next)
: val(_... | ALGO | 0.999931 | 5.848226 |
7f143d33-92ec-4efe-9934-84df2299ede0 | greek-geek/Statistics-Programming | 4/QR.cpp | /*
#########################################################
## Stat 202A - Homework 4
## Author:
## Date :
## Description: This script implements QR decomposition,
## and linear regression based on QR.
#########################################################
#######################################################... | ALGO | 0.995627 | 4.749619 |
870178a4-7886-479b-a800-a7b37caa2b1a | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11157_5.cpp | #include <bits/stdc++.h>
using namespace std;
long long check(string &s, long long i, long long j, string &s1, string &s2,
string &s3) {
long long a = 0, b = 0, c = 0, p = 0;
for (long long first = i; first < j; first++) {
if (s[first] != s1[p]) a++;
if (s[first] != s2[p]) b++;
if (s[fir... | ALGO | 0.999658 | 4.89491 |
bf8625e4-4829-4cae-a948-84c0dcfc7c35 | anikChandraDeb/Competitive-Programming | Graph/14. Prime_Path_Spoj.cpp | /* Anik Deb -> CSE,DUET
Praying(Everything is depend on God):
Hare Krishna Hare Krishna
Krishna Krishna Hare Hare
Hare Rama Hare Rama
Rama Rama Hare Hare
*/
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
vector<int> prime;
void primeCal(){
for(int n=1000;n<=9999;n++){
... | ALGO | 0.999837 | 4.090452 |
4144fb9c-37f0-4f1d-9acd-15e9aa6b823c | TongDoan/-Document-C- | Giai PT bac 2.cpp | #include<stdio.h>
#include<math.h>
int main() {
int a, b, c, d;
printf("nhap a: "); scanf("%f", &a);
printf("nhap b: "); scanf("%f", &b);
printf("nhap c: "); scanf("%f", &c);
d = b*b - 4*a*c;
if(d<0){
printf(" pt vo no");
}
else if(d==0){
printf("phuong trinh cos no kep x= %f", -b/(2*a... | ALGO | 0.999369 | 3.370234 |
08d6b874-02e5-4aa8-8af6-cca8c07c3042 | krakensurf/mandelbulber | mandelbulber2/formula/definition/fractal_generalized_fold_box.cpp | /**
* Mandelbulber v2, a 3D fractal generator _%}}i*<. ______
* Copyright (C) 2020 Mandelbulber Team _>]|=||i=i<, / ____/ __ __
* \><||i|=>>%) / / __/ /___/ /_
* This file is part of Mandelbulber. )<=i=]=|=i<> / /__ /_ __/_ __/
* The project ... | ALGO | 0.998572 | 5.253413 |
342a21a4-330f-47c2-97c1-bc7004cca227 | KurodaKanbei/ACM | Template of other teams/Dreadnought/SCL-collection/template/shy/pinhengshu.cpp | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
struct {
int L,R,father,key,size;
} f[100001];
int root,n,Q;
inline void zig(int now){
int x=f[now].father,y=f[x].father;
if (y)
if (f[y].L==x) f[y].L=now;
else f[y].R=now;
f[now].father=y;
... | ALGO | 0.99998 | 4.01479 |
c238e8a3-4d0c-4ddf-b861-c6985d60b96e | zhangbo2008/cpp_algorithm | aoapc-bac2nd-master/ch5/UVa156.cpp | // UVa156 Ananagrams
// Rujia Liu
// 题意:输入一些单词,找出所有满足如下条件的单词:该单词不能通过字母重排得到输入文本中的另外一个单词
// 算法:把每个单词“标准化”,即全部转化为小写字母然后排序,然后放到map中进行统计
#include<iostream>
#include<string>
#include<cctype>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
map<string,int> cnt;
vector<string> words;
// 将单词s进行“标准化”
str... | ALGO | 0.999771 | 4.198416 |
9aa8de4e-2f48-45f6-9791-6e7f4c62842c | adhamkhaled312/ASUFE-CPC-LEVEL1-Training | Week 5 sheet/D-EasyQueue.cpp | //https://www.spoj.com/problems/QUEUEEZ/en/
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin>>t;
long long n,x;
queue<long long> q;
while(t--){
cin>>n;
if(n==1){
cin>>x;
q.push(x);
}
else if(n==2){
if(!q.empty()... | ALGO | 0.999481 | 4.429659 |
9e48c6e7-8072-42fb-867f-68d7a853e014 | mikerainey/taskparts | benchmark/parlay/lowdiameterdecomp.cpp | #include <iostream>
#include <string>
#include <parlay/primitives.h>
#include <parlay/sequence.h>
#include "low_diameter_decomposition.h"
#include "helper/graph_utils.h"
#include "common.hpp"
using vertex = int;
using utils = graph_utils<vertex>;
long n = 0;
parlay::sequence<parlay::sequence<vertex>> G, GT;
vertex ... | ALGO | 0.998896 | 6.659698 |
be13a64d-24fb-491d-b1a1-95bca0587cfa | tempest-shields/tempest-shields | src/storm/logic/FragmentChecker.cpp | #include "storm/logic/FragmentChecker.h"
#include "storm/logic/Formulas.h"
namespace storm {
namespace logic {
class InheritedInformation {
public:
InheritedInformation(FragmentSpecification const& fragmentSpecification) : fragmentSpecification(fragmentSpecification) {
... | TOOL | 0.919157 | 7.424782 |
3250b000-01d9-47f3-a6ff-ac3b4d1af2dc | ab-atiq/Phitron_course | Algorithm/week5/Exam/F-copy.cpp | #include <bits/stdc++.h>
using namespace std;
const int MaxNum = 100;
vector<int> G[MaxNum + 5];
bool V[MaxNum + 5] = {0};
int n, m;
void BFS(int u)
{
queue<int> q;
q.push(u);
V[u] = true;
while (!q.empty())
{
int f = q.front();
q.pop();
for (int node : G[f])
{
... | ALGO | 0.999996 | 4.689481 |
5feeae5e-6785-4b6f-8782-a72131648d1c | instr3/BZOJ-solution-legacy | A1296/1296粉刷匠.cpp | #include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
%:define each(i,n) (int i=1;i<=(n);++i)
%:define every(i,a,b) (int i=(a);i<=(b);++i)
int n,nm,nt;
#define tr(a,b) (b)=max((a),(b))
int ind[101][101];
int tdp[101][101][101];
int tdp2[10... | ALGO | 0.99914 | 3.10703 |
fa73e884-54c9-4dcd-9f71-f228d0866669 | KrishWadhwa24/LeetCode | Dynamic Programming/buy_sell_stock2.cpp | #include <bits/stdc++.h>
using namespace std;
/*
You are given an integer array prices where prices[i] is the price of a given stock on the ith day.
On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then immediately sell it ... | ALGO | 0.999977 | 6.793934 |
71666355-25b1-45f8-acfc-480d4024ef48 | cclinard84-zz/Cplusplus-1-Labs | Lab1.cpp | /*
* File: coalcalc.cpp
* Author: Matt Clinard
* Description: This application will estimate the amount of energy
* produced in kiloJoules per kilogram, produced by a particular
* batch of coal using the Dulong formula.
* Last date changed: September 4, 2015
*/
#include <iostream>
using namespace std;
int main()
{
... | TOOL | 0.918083 | 3.415818 |
0cf22f65-ab70-48f8-9518-0a9a9c130eb2 | jungh150/PS | baekjoon/10987.cpp | #include <iostream>
using namespace std;
void solve() {
string s;
cin >> s;
int cnt = 0;
for (char c: s) {
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') cnt++;
}
cout << cnt << '\n';
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
... | ALGO | 0.99863 | 5.141819 |
cdda0b8b-398b-4793-870b-9a4dd161153c | J-Gann/alltrans | benchmarks/benchmarks_source/8_level/p04030/s991588917.cpp | #include <bits/stdc++.h>
using namespace std;
#define INF 100005
#define MOD 1000000007
int main()
{
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
string a;
cin >> a;
string b;
for(int i=0;i<a.size();i++)
{
... | ALGO | 0.999979 | 4.357405 |
49f41e21-06a4-4bf9-8d57-3b0c81ac6760 | josephwehby/AdventOfCode2024 | Day04/solution_a.cpp | #include <iostream>
#include <vector>
bool validMove(std::vector<std::string>& word_search, int row, int col) {
if (row >= word_search.size() || row < 0 || col >= word_search[0].size() || col < 0) return false;
return true;
}
int findXMAS(std::vector<std::string>& word_search, int row, int col) {
int count = 0;... | ALGO | 0.999394 | 5.674416 |
d3f054a5-987b-4047-bbc5-f0ce78218e21 | Ri-Nai/CompetitionCode | OI/School_203/1500_2000/1533.cpp | #include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
#define FOR(i,a,b) for(register int i=a,i##_=b;i<=i##_;++i)
const int mod=5557;
char s[10];
int n,m,K,S[55][55],mark[256],ans[55],T;
void Add(int &x,int y)
{
y<mod||(y%=mod);
x+=y;
x>=0||(x+=mod);
x<mod||(x-=mod);
}
struct Matrix
{
int M[55][55];... | ALGO | 0.99997 | 3.958192 |
31eb9dd7-76b3-47c9-847d-e466a61fdf0c | Spartan-65/ACM_STEP | cdoj/2017 UESTC Training for Data Structures/A - An easy problem A(线段树)/main.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn=50005;
struct node{
int l,r,Max,Min;
}T[maxn<<2];
void build(int k,int l,int r)
{
T[k].l=l;
T[k].r=r;
T[k].Max=0,T[k].Min=0;
if(l==r) return ;
int mid=(l+r)/2;
build(2*k,l,mid);
build(2*k+1,mid+1,r);
}
void ins(int n,int d,int... | ALGO | 0.999968 | 4.342675 |
1240d33a-3249-49a5-af08-da447d11354f | im2sh/BaekjoonCode | 프로그래머스/lv2/42839. 소수 찾기/소수 찾기.cpp | #include <string>
#include <vector>
#include <string>
#include <map>
#include <iostream>
using namespace std;
int visited[7];
map<unsigned long long, int> M;
bool isPrime(string temp){
//cout << temp << "\n";
if(temp == "" || stoi(temp) < 2)
return false;
int tn = stoi(temp);
for(int i = 2... | ALGO | 0.999243 | 4.878626 |
d4bbebc0-5eee-472a-9d1d-abfd54c9ac60 | gulabchan/leetcode-c-challenges | 0880-decoded-string-at-index/0880-decoded-string-at-index.cpp | class Solution {
public:
string decodeAtIndex(string S, int K) {
long N = 0, i;
for (i = 0; N < K; ++i)
N = isdigit(S[i]) ? N * (S[i] - '0') : N + 1;
while (i--)
if (isdigit(S[i]))
N /= S[i] - '0', K %= N;
else if (K % N-- == 0)
... | ALGO | 0.999687 | 5.646376 |
d99962fe-1418-4a18-8963-28f4c45a6a15 | nehalagrawal20/Leetcode | Filling Bucket - GFG/filling-bucket.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int fillingBucket(int n) {
// code here
int m=100000000;
if(n==1)
return 1;
int x=1;
int y=1;
for(int i=1;i<n;i++)
{
int ... | ALGO | 0.999935 | 5.69815 |
bc62dad4-b388-4538-9d21-74cdb956b79e | Tahameed-633/Codeforces-solved-problem | C.Good Prefixes.cpp | #include <iostream>
using namespace std;
typedef long long ll;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
ll cntt = 0;
ll sum = 0;
ll arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
ll maxx = arr[0];
... | ALGO | 0.99985 | 4.670347 |
e92a52e4-8e82-4b74-84c0-a37c1a3dd659 | Lyihao2020/ML-DL | [3]Tools/C++/笔记/03.循环语句/problem19.cpp | // Acwing 726. 质数
/*
一个大于 1 的自然数,如果除了 1 和它自身外,不能被其他自然数整除则称该数为质数。
例如 7 就是一个质数,因为它只能被 1 和 7 整除。
现在,给定你 N 个大于 1 的自然数,请你依次判断这些数是否是质数。
输入格式
第一行包含整数 N,表示共有 N 个测试数据。
接下来 N 行,每行包含一个自然数 X。
输出格式
每个测试用例输出一个结果,每个结果占一行。
如果测试数据是质数,则输出 X is prime,其中 X 是测试数据。
如果测试数据不是质数,则输出 X is not prime,其中 X 是测试数据。
数据范围
1≤N≤100,
1<X≤107
输入样例... | ALGO | 0.999275 | 4.846157 |
88af242c-5375-4be9-8a27-30af5d4b7f5f | Rana718/DSA | C++/Tree/Heap_Tree_using_Linked.cpp | #include<iostream>
#include<queue>
class node{
public:
int value;
node *left;
node *right;
node *parent;
node(int val): value(val), left(nullptr), right(nullptr), parent(nullptr) {}
};
class MaxHeap{
private:
node *root;
node *lastinserted;
voi... | ALGO | 0.999564 | 4.393296 |
31fba5c3-849c-41b2-b996-a4f9cd127043 | Negationist/Negationst-Codeforces | Codeforces Practice/D. Digital string maximization better/main.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
using namespace std;
void solve(){
string s;
cin >> s;
int n = s.size();
vi a(n);
for(int i=0;i<n;i++){
... | ALGO | 0.999949 | 5.002394 |
e69b25ba-9a27-45a1-96c5-4a2cdd962937 | Polina-Eremeeva29/Labs_PSTU | Лабораторная работа №28/4/4/main.cpp | #include "Time.hpp"
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
typedef stack<Time>st;
typedef vector<Time>Vec;
st make_stack(int n)
{
st s;
Time m;
for (int i = 0; i < n; i++)
{
cin >> m;
s.push(m);
}
return s;
}
void print_stack(st s) {
whil... | ALGO | 0.999492 | 4.080288 |
83ab9b20-8eee-4131-87dc-4df232df5622 | jackboom2510/DSA-PTIT | assets/Kiem tra 05-07/4.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;
using vii = vector<pii>;
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
#define all(x) x.begin(), x.end()
#define mp make_pair
#defi... | ALGO | 0.999711 | 3.693108 |
1ced965c-9b19-4588-b4df-d0a41a9da167 | sheikh-haji/Coding_placement | tree/implementation/tree.cpp | #include<iostream>
#include<queue>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(){
data=0;
right=NULL;
left=NULL;
}
Node(int x){
left=NULL;
right=NULL;
data=x;
}
};
void preorder(Node* root){
if(root==NULL){
return;
}
cout<<root->data<<" ";
preorder(roo... | ALGO | 0.999855 | 4.188477 |
baa5f255-9e37-4191-9812-572d92cfde54 | ishandutta2007/codeforces | gazelle/normal/1185/A.cpp | #include<bits/stdc++.h>
#define FOR(i, n, m) for(int i = n; i < (int)m; i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define pb push_back
using namespace std;
using ll = std::int_fast64_t;
using P = pair<ll, ll>;
constexpr ll inf = 1000000000;
constexpr ll mod = 1000000007;
constexpr long doubl... | ALGO | 0.999926 | 3.859137 |
8ddf929c-18d7-4f10-a0b0-9ab0a5aa3214 | vinay030901/Algorithms | DataStructures/Array/8pascalTriangle.cpp | // create a pascal triangle
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n=5;
vector<vector<int> >arr(5);
for(int i=0;i<5;i++)
{
arr[i].resize(i+1);
arr[i][0]=arr[i][i]=1;
for(int j=1;j<i;j++)
arr[i][j]=arr[i-1][j-1]+arr[i-1][j];
}
for(int i=0;i<a... | ALGO | 0.999921 | 3.863513 |
862bc5d8-23e7-44c6-ac81-298daeb5e1e1 | wylited/solutions | codeforces/1900..1999/1950C.cpp | #include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
}
int t;
int main() {
cin >> t;
while (t--) {
solve();
}
}
| ALGO | 0.997852 | 3.398463 |
e0d49839-40d3-45b6-adec-fc84a9d1a0cb | Aokiji996/instant-ngp-kf | dependencies/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
using namespace std;
int main()
{
MatrixXf m(2,2);
m << 1,-2,
-3,4;
cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
<< " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
cout << "infty-norm(m... | ALGO | 0.999799 | 4.076589 |
4c355417-abd3-4cc0-9878-c10ed8acbc0a | jattu8602/B-11-Notes-code | COMPUTER PRACTICAL EXPERIMENTS/exp_8.cpp | /*
wap to illustrate varius arithmetic functions using functions like add(),
sub(),multi(),div()etc;
*/
#include<iostream>
using namespace std;
int multi(int,int);
int sum(int,int);
int sub(int,int);
int divi(int ,int);
int main(){
int a,b;
cout<<"enter two number:"<<endl;
cin>>a>>b;
cout<<"addition is... | ALGO | 0.887661 | 3.847198 |
8d304362-cd63-4262-a4a1-abad9a6951bf | MISTIKMAKS/pr5_4 | pr5_4/pr5_4.cpp | #include <iostream>
#include <cmath>
using namespace std;
double S0(const int K, const int N)
{
double s = 0;
for (int i = N; i <= K; i++)
s += sin(1. * i);
return s;
}
double S1(const int N, const int K, const int i)
{
if (i > K)
return 0;
else
return sqrt(i * i + K * K) / i + S1(K, N, i + 1);
}
double S2(c... | ALGO | 0.999687 | 3.275679 |
df8540f6-9ac4-4066-8c57-3c0d278f8a85 | ishandutta2007/codeforces | nfssdq/normal/107/B.cpp | /*********************************************************************\
|--\ --- /\ |-----------| ----- /-------| |
| \ | / \ | | / |
| \ | / \ | | | |
| \ | / \ ... | ALGO | 0.999712 | 3.388055 |
6075b725-261c-429d-881c-5a5cb8a84fb5 | saady789/DSA-Practice | Graphs/NumberOfIslands2.cpp | int findParent(int i,vector<int>&parent){
if(i==parent[i]) return i;
return parent[i] = findParent(parent[i],parent);
}
vector<int> numOfIslands(int n, int m, vector<vector<int>> &operators) {
// code here
int s = n*m;
vector<int> visited(s,0);
vector<int> parent(s);
vector<int> size(s,1);
... | ALGO | 0.999976 | 5.112539 |
b16ef95c-5baf-41d8-b14d-ad21c85aecfb | OmarHafez1/Competitive_Programming_Solutions | projecteuler.net/problem_686.cpp | #include <bits/stdc++.h>
using namespace std;
int calc(int p, int len) {
return pow(2, p-(int)(log10(2)*p-len+1)*log2(10));
}
int p(int x, int r) {
int ind = 0, cnt = 0;
while(cnt != r) {
ind++;
if(calc(ind, floor(log10(x))+1) == x) cnt++;
}
return ind;
}
int main() {
// 2^p /... | ALGO | 0.999528 | 4.599163 |
9a9de68e-5b26-4408-bc34-ce7d76796fc9 | lungsin/CP-Library | icpc-cheat-sheet/stress-tests/number-theory/ModSqrt.cpp | #include "../utilities/template.h"
ll modpow(ll a, ll e, ll mod) {
if (e == 0) return 1;
ll x = modpow(a * a % mod, e >> 1, mod);
return e & 1 ? x * a % mod : x;
}
#include "../../content/number-theory/ModSqrt.h"
int main() {
rep(p,2,10000) {
rep(i,2,p) if (p % i == 0) goto next;
rep(a,0,p) {
if (p != 2 &... | TEST | 0.942635 | 4.225995 |
28e8e12f-d8a3-4b6a-bf31-a0a054c461b6 | Dev-Rohiit/CPP_SAGE_B.Tech | Lecture 10/003MergeTwoSoredArray.cpp | #include<iostream>
using namespace std;
int main(){
int arr1[] = {10,30,50,70};
int arr2[] = {20,40,60};
int m = sizeof(arr1)/sizeof(int);
int n = sizeof(arr2)/sizeof(int);
int i = 0;
int j = 0;
int finaArray[20];
int final = 0;
while (i<m && j<n)
{
if (arr1[i]<arr2[j])
... | ALGO | 0.99988 | 3.728351 |
e9e674de-5493-4cde-8a31-e56be3e1198e | SsageParuders/Android_Native_Surface | my_android_opencv/3rdparty/openexr/IlmImf/ImfRgbaYca.cpp | //-----------------------------------------------------------------------------
//
// Conversion between RGBA and YCA data.
//
//-----------------------------------------------------------------------------
#include <ImfRgbaYca.h>
#include <assert.h>
#include <algorithm>
using namespace IMATH_NAMESPACE;
using namespa... | ALGO | 0.982302 | 7.339673 |
01ad7737-37dd-4265-ab14-222db1710015 | AbdullahAssi/DSA | Prac/Task1.cpp | #include <iostream>
#include <iostream>
using namespace std;
int main() {
int num;
cout << "Enter a number: ";
cin >> num;
cout << "You entered: " << num << endl;
// checking whether the number is even or odd
if (num % 2 == 0) {
cout << num << " is even" << endl;
} else {
c... | ALGO | 0.973418 | 4.082733 |
aefc44c0-7f14-4bbf-9625-2855b79de0ee | devanshmesson/Competitive-programming | Commonlounge/Basics Playlist/Drought.cpp | #include <iostream>
using namespace std;
int main()
{
int n,c,i,cnt=0,sum=0,k;
cin>>n>>c;
for(i=0;i<n;i++)
{
cin>>k;
cnt++;
sum=sum+k;
if(sum>=c){cout<<cnt;break;}
}
return 0;
}
| ALGO | 0.999897 | 3.25232 |
c3a24933-31be-4ada-8f62-5c15b09a4365 | Prodaturu/evaluations_june_to_aug_24 | to_push/sammy_cpp08/ex01/Span.cpp | #include "Span.hpp"
Span::Span(unsigned int N) : max_size(N) {}
Span::Span(const Span &other) : numbers(other.numbers), max_size(other.max_size) {}
Span &Span::operator=(const Span &other) {
if (this != &other) {
numbers = other.numbers;
max_size = other.max_size;
}
return *this;
}
Span:... | ALGO | 0.934475 | 5.46009 |
b3d25d37-aafc-4f6a-a1b3-ab729cf0d224 | IsabelPessoa/check_list_app_1 | 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 |
1e532029-71a6-4648-bdda-f61f526060a9 | V-vp/SPOJ | java_vs_cpp.cpp | #include<bits/stdc++.h>
using namespace std;
bool isjava(string str)
{
int len = str.length();
for(int i=0;i<len;i++)
{
if(str[i]=='_')
return false;
}
return true;
}
bool iscpp(string str)
{
int len = str.length();
if(str[len-1]=='_')
return false;
//cout<<str[len-1];
for(int i=0;i... | ALGO | 0.998721 | 3.767994 |
6a14ba25-bb57-4719-bc54-32937f8be9ca | Abhi-Tom-2004/CodeConverter | C-Plus-Plus-master/graph/connected_components.cpp | /**
*
* \file
* \brief [Graph Connected Components
* (Connected Components)]
* (https://en.wikipedia.org/wiki/Component_(graph_theory))
*
* \author [Ayaan Khan](http://github.com/ayaankhan98)
*
* \details
* A graph is a collection of nodes also called vertices and these vertices
* are connected by edges. A c... | ALGO | 0.999854 | 6.462903 |
66f69c6d-bbac-4cce-a95d-13dda5cd9e99 | lbsauer/problem-solutions | leetcode/0201-0400/0322-m/solution.cpp | // https://leetcode.com/problems/coin-change
// 2024/08/29
class Solution {
public:
int coinChange(vector<int>& coins, int amount) {
vector<int> count(amount + 1, INT_MAX);
count[0] = 0;
for (int i = 1; i <= amount; ++i) {
for (const int c : coins) {
if (c > i |... | ALGO | 0.999961 | 6.292667 |
0d14dc9c-bbf5-41ce-b619-ebb76de7127f | guihunkun/LeetCode | 970.cpp | class Solution
{
public:
vector<int> powerfulIntegers(int x, int y, int bound)
{
int a,b;
if(x == 1)
a = 1;
else
a = log(bound)/log(x);
if(y == 1)
b = 1;
else
b = log(bound)/log(y);
int num;
vector<int> re... | ALGO | 0.999492 | 4.756052 |
fdf72cfa-a4de-4506-bd44-0fc33408576c | Maaz-24503/maaz_leetcode | 518 Coin Change II/518coin-change-ii.cpp | class Solution {
public:
int change(int amount, vector<int>& coins) {
int n = coins.size();
vector<vector<int>> memo(n, vector<int>(amount+1, 0));
for(int i = 0; i<n; i++){
memo[i][0] = 1;
}
for(int i = 0; i<n; i++){
for(int j = 1; j<amount+1; j++){
... | ALGO | 0.999954 | 6.075188 |
ce2164d0-89f8-4641-885a-872097923728 | sufyan-soft/module_5_livetest | 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 |
5cb79239-1647-46f7-b4c5-85deaa99ddf2 | ishandutta2007/codeforces | wxhtzdy/normal/1163/B2.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <list>
#include <cassert>
#include <climits>
#include <bitset>
#include <chro... | ALGO | 0.999527 | 3.808562 |
e1c295c1-c2ca-420d-ba47-704dac08c493 | keyoflouis/book_algorithm | Decrease-and-Conquer/implementation/josephus.cpp | #include"header.h"
void josephus(list<int>& people, int g) {
auto i = people.begin();
while (people.size()!=1)
{
for (int j = 0; j < g; j++) {
if (i!=people.end()) {
i++;
}else if(i == people.end()){
i = people.begin();
}
}
i = people.erase(i);
if (i == people.end()) {
i = people.begin... | ALGO | 0.999891 | 3.885171 |
88a73551-d689-48cf-924c-31ca515f3fca | vrangr1/competitive-programming | contests/codechef/starters_rounds/starters_146a/test_ctc/brute_force.cpp | /***************************************************
* Author : Anav Prasad
* Nick : vrangr
* Created : Thu Aug 8 20:26:51 IST 2024
****************************************************/
#include <bits/stdc++.h>
#define debug(...) (void)42
#ifdef LOCAL
#undef debug
#include <algo/debug.hpp>
const bool ... | ALGO | 0.999997 | 4.343713 |
ca535b05-d4a1-4b85-8ceb-45871a771a75 | Eliano64/Tj-OSProject | hw2/simulate.cpp | #include <bits/stdc++.h>
using namespace std;
struct node
{
int space;
bool idle;
node *next, *pre;
node(int s,bool idle) : space(s), next(NULL), idle(idle), pre(NULL) {}
node(int s) : space(s), next(NULL), idle(false), pre(NULL) {}
node() : space(0), idle(false), next(NULL), pre(NULL) {}
};
n... | ALGO | 0.997882 | 4.232313 |
4e40b50a-17a0-49ab-a925-7fbd199871c6 | weikunhan/leetcode_cplusplus | 088_mergeSortedArray.cpp | //==============================================================================
// 88. Merge Sorted Array
// C++
// Tag: Array(2 Pointers)
//==============================================================================
// Summary:
// https://leetcode.com/problems/merge-sorted-array/#/description
class Solution {
pub... | ALGO | 0.999992 | 6.379293 |
fc203e04-b272-4d56-8f6d-ad5e157b5acc | huahbo/Turbulent_Channel_Flow1 | Residuals/Forcing_Term_Christos_Y.cpp | /*******************************************
* Author: Michail Georgiou
* Last Modified: Time-stamp: <2014-05-21 14:04:09 mike_georgiou>
*
*
Forcing_Term_Christos.cpp -- This function introduces a forcing term in
the Velocity Residuals. This case is adapted from the "Accurate
Projection Methods for the Incompress... | ALGO | 0.999729 | 3.884705 |
2649fad6-8398-4720-8434-4bd01e1a04be | TiwariAnil/SPOJDays | solutions/June1.cpp | //Data Structure includes
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<string>
//Other Includes
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<sstream>
//some common functionn... | ALGO | 0.999969 | 3.332122 |
3a501564-3d6b-4d8f-aaf6-3fa276ca85f8 | vtsozik/interviews | 2016/mongodb/bintreerecursionvsiteration.cpp | /*
* Dear Andreas,
*
* During the interview you posed an open problem about tree recursion and rather severe limits imposed
* by low amount of memory allocated for stack segment (when compared to the heap segment size). I believe I
* mentioned that any form of stack recursion can be replaced with "tail" recursio... | ALGO | 0.999062 | 7.265437 |
1fed3cb6-44f2-4028-958a-c0388084ba7a | ishandutta2007/codeforces | hollwoq_pelw/normal/1469/E.cpp | /*
// is short or still long ???
hollwo_pelw's template(short)
// Note : -Dhollwo_pelw_local
*/
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/trie_policy.hpp>
// #include <ext/rope>
using namespace std;
// using namespace __gnu_pbds;
// using namespace __gnu_cxx;
void FA... | ALGO | 0.999983 | 4.376872 |
96d9593a-ba63-4ab6-af31-68b5a90316a5 | nimendoza/noi-2023 | training/week-4/hackables/flip-b/nomuuu/207325608.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int t, n, onechain; cin >> t;
string k;
while (t--) {
cin >> n;
cin >> k;
// chains of one
onechain = 0;
vector<int> onechains;
// casework
if (n == 1) {
(k[0] == '1') ? cout << 1 ... | ALGO | 0.999957 | 4.166641 |
3ee678d3-31e9-472b-8007-c93a890abf29 | slimepiki/atcoder | abc029/b/main.cpp | using namespace std;
using ll = long long;
using ull = unsigned long long;
#include <bits/stdc++.h>
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T...);
}
#ifdef __LOCAL
#define debug(...) ... | ALGO | 0.985019 | 4.466005 |
00e09d53-fe73-4cfb-b167-96d91badb648 | DevHawon/CS310-Assignments | CS310_HW2.cpp | // CS310_HW2.cpp : 이 파일에는 'main' 함수가 포함됩니다. 거기서 프로그램 실행이 시작되고 종료됩니다.
// This program will test DoublyLinked list class
#include <iostream>
#include <string>
#include "Node.h"
#include "DoublyLinked.h"
using namespace std;
int main()
{
// deliverable 1: possible to declare any type of data
cout << "Deliverabl... | TEST | 0.923672 | 4.58145 |
3e42c08d-2a4c-46cf-aa1a-67617d828842 | geekyparth2004/CPP-practice-and-codes | c++/sets/basic.cpp | #include<iostream>
#include<unordered_set>
using namespace std;
int main()
{
unordered_set<int> s;
s.insert(1);
s.insert(2);
s.insert(3);
s.insert(4);
s.insert(1);
int target;
cin>>target;
if(s.find(target)!=s.end())
{
cout<<"true";
}
else cout<<"false";... | ALGO | 0.999718 | 3.643021 |
0dd5a35c-9b11-49a7-a25f-57ef4fb82ce5 | TioaChan/the_design_and_analysis_of_algorithms | code/ch8/IncSeq.cpp | #include <stdio.h>
#define MAX 100
#define max(x,y) ((x)>(y)?(x):(y))
//ʾ
int a[]={2,1,5,3,6,4,8,9,7};
int n=sizeof(a)/sizeof(a[0]);
//ʾ
int ans=0;
int dp[MAX];
void solve(int a[],int n)
{
int i,j;
for(i=0;i<n;i++)
{
dp[i]=1;
for(j=0;j<i;j++)
{
if (a[i]>a[j])
dp[i]=max(dp[i],dp[j]+1);
}
}
ans=dp[0];... | ALGO | 0.999933 | 3.602854 |
53a34d7c-208f-4ada-a184-cf870718fb48 | alokshakya/C_Plus_Plus_Programs | codevitaFire2.cpp | #include<bits/stdc++.h>
#define pii pair<int,int>
#define piib pair<pii,bool>
#define mp(x,y) make_pair(x,y)
#define node(x,y,vi) mp(mp(x,y),vi)
#define f first
#define s second
using namespace std;
char mat[20][20];
int n,m;
int dfs(stack<pii> start)
{
//cout<<"inside dfs"<<endl;
vector<pii> dir(8);
... | ALGO | 0.99967 | 3.451926 |
6fa716ad-9152-4090-aef6-6826b9352365 | anushka-cseatmnc/LeetCode-Practice-Problems | 0075-sort-colors/0075-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int low = 0, current = 0, high = nums.size() - 1;
while (current <= high) {
if (nums[current] == 0) {
swap(nums[low], nums[current]);
low++;
current++;
} else if (nums[current] == 1) {
... | ALGO | 0.999864 | 6.187324 |
ccc51a55-c769-4281-b67c-c2b7cf6b7e0a | LeeDiay/Code_PTIT | Code_C/81.cpp | #include<stdio.h>
#include<math.h>
int main()
{
long long a, d, t, i, n,j, test;
scanf("%lld", &test);
for (i=1; i<=test; i++)
{
scanf("%lld", &a);
if (a%2==0)
{
long long chan=0, le=0;
while (a > 0)
{
t=a%10;
d=t;
if (d%2==0) chan++;
... | ALGO | 0.99972 | 3.922531 |
81648e9e-f6c2-4e35-a781-419e191466b3 | blackout-yash/Codeforces | Challenge/1500/37_D_Secret_Passwords.cpp | // D. Secret Passwords
// Link - https://codeforces.com/contest/1263/problem/D
/*--------------------------------------👻 Yash 👻--------------------------------------*/
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// #pragma GCC optimize("Ofast")
// using namespace __gnu_pbds;
#i... | ALGO | 0.999811 | 4.485878 |
b666e2fa-cf7a-475c-abfe-e09dd6a65627 | reunanen/boost-prebuilt-windows-binaries | libs/graph/example/dijkstra-example.cpp | #include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/property_map/property_map.hpp>
using namespace boost;
int main(int, char*[])
{
typedef adjacency_list< listS, vecS, directedS, no_property,
property< edge_we... | ALGO | 0.999959 | 5.484641 |
405327b6-154d-4156-8305-84a4653007f4 | Liu-YT/LeetCode | cpp/140.Word_Break_II.cpp | /* solution 超时 */
class Solution {
public:
vector<string> wordBreak(string s, vector<string>& wordDict) {
vector<string> res, cur;
unordered_set<string> dict;
for(auto word : wordDict) {
dict.insert(word);
}
helper(s, dict, res, cur);
return res;
}
... | ALGO | 0.999748 | 6.225022 |
2fac7a99-8d0a-416e-9f77-2d9b280fc720 | Dylan3004/Cpp2022 | zestaw-5cpp/zad4.cpp | //
// Created by DW on 2022-06-14.
//
#include<vector>
#include<iostream>
#include<algorithm>
#include <numeric>
#include <random>
#include <string>
#include <cstdlib>
#include <functional>
#include <numeric>
using namespace std;
int main () {
vector<int> vec = {1, 2, 5, 8, 4, 3, 9, 0, 3, 6};
auto sklejka = []... | ALGO | 0.999451 | 4.529448 |
d7fd7642-781c-45dc-9e26-e38af3ab20c5 | Volverman/procon-archive | atcoder.jp/cf17-final/cf17_final_b/Main.cpp | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<int,int>;
int main()
... | ALGO | 0.999952 | 3.69601 |
e8e74e80-f5d2-4cc3-bff3-05cb473c28da | uxth/leetcode | cpp/1986.minimum-number-of-work-sessions-to-finish-the-tasks.cpp | /*
* @lc app=leetcode id=1986 lang=cpp
*
* [1986] Minimum Number of Work Sessions to Finish the Tasks
*/
// @lc code=start
class Solution{
public:
bool check(vector<int> &tasks, vector<int> &vec, int step, int sessionTime){
if (step >= tasks.size())
return true;
int cur = tasks[step... | ALGO | 0.999991 | 6.511197 |
8e1860ba-e3e3-4fc7-9ff4-997d3e0cfeee | quanglm1998/competitive-programming | codeforces/1242/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
long long n;
cin >> n;
if (n == 1) {
cout << 1 << endl;
return 0;
}
long long res = 0;
for (int i = 2; 1ll * i * i <= n; i++) {
if (n % i == 0) {
whi... | ALGO | 0.999989 | 5.356248 |
36902110-0077-45e9-8f1c-9cf9d44e2a22 | maximeoger/algo-cpp | terre11.cpp | #include <iostream>
using namespace std;
/*
Nombre premier :
Savoir si un nombre est premier ou pas
*/
bool isPrimeNumber (int num) {
int dividers = 0;
for(int i=1; i<=num; i++) {
if(num % i == 0) {
dividers += 1;
}
}
return dividers == 2;
}
int main (int argc, char* argv[]) {
if(argc ... | ALGO | 0.988137 | 4.285917 |
daad9b33-9d51-4ad3-9e73-9ced9cf60240 | dpiers/Jedi-Academy | codemp/botlib/be_aas_routealt.cpp |
/*****************************************************************************
* name: be_aas_routealt.c
*
* desc: AAS
*
* $Archive: /MissionPack/code/botlib/be_aas_routealt.c $
* $Author: Zaphod $
* $Revision: 5 $
* $Modtime: 11/22/00 8:47a $
* $Date: 11/22/00 8:55a $
*
*********************************... | ALGO | 0.998563 | 4.877055 |
78f4cfcf-a7b4-4786-a9e2-85f10d84b450 | vignesh/InterviewPractice | LeetCode/mergeSortedLinkedLists.cpp | Node *mergeSortedLinkLists(Node *a, Node*b) {
Node * result = NULL
if (!a) {
return b;
}
if (!b) {
return a;
}
if (a->data <= b->data) {
result = a;
return mergeSortedLinkedList(a->next, b);
}
if (a->data > b->data) {
result = b;
return mergeSortedLinkedList(a, b->next);
}
return result;
} | ALGO | 0.999561 | 4.298549 |
896ebe64-21c6-4d3c-984c-10a3e1075029 | muhamadhilmi01/UTS_DASAR_PEMROGRAMAN | DASAR PEMROGRAMAN/BAB 7/5.cpp | #include <iostream>
using namespace std;
int main()
{
int A[7];
int j, k, C, temp;
cout << "masukan nilai pada elemen array: " << endl;
for (C=0; C<7; C++)
{
//menginput elemen array
cout << "A[" << C << "] = ";
cin >> A[C];
}
cout << "\n nilai element array sebelum... | ALGO | 0.999872 | 3.499663 |
3fc20298-4709-482f-8006-78926d7afcb7 | gotoco/CodingPractice | google_code_jam/gcj_2014/qr_probB.cpp | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <c... | ALGO | 0.999763 | 3.347237 |
cc18e6eb-ffc4-4c81-aa76-2f210841e9e6 | aymanemhd/hackerRankSolutions | venv/lib/python3.10/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.999506 | 5.836969 |
4678168d-5f01-4680-af1d-53aef4e380d0 | uta-noki/AtCoder-by-Docker | atcoder/other/adt_all_20240618_1/b/adt_all_20240618_1_b.cpp | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, start, n) for (int i = start; i < (int)(n); i++)
// お役立ち関数いろいろ
// 文字列を大文字に変換
string toUpper(string s) { transform(s.cbegin(), s.cend(), s.begin(), ::toupper); return s;}
// 文字列を小文字に変... | ALGO | 0.997637 | 3.394177 |
f3161a69-f45f-41c2-b746-5d20636915d1 | DgvDilshan/back_hole | 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.998799 | 6.776823 |
ad94717a-e268-41f7-9cc8-efa90900eabd | soundariyav/LeetcodePractice | 238. Product of Array Except Self.cpp | class Solution {
public:
vector<int> productExceptSelf(vector<int>& nums) {
int pmul=1;
int bmul =1;
vector<int>pm;
vector<int>bm;
for(int i=0;i<nums.size();i++)
{
if(i==0)
{
pm.push_back(pmul);
}
... | ALGO | 0.999993 | 5.579387 |
dd700709-13c0-4632-8125-1153d3b4523a | manuel-lang/Learning-to-Link | distance_main.cpp | #include "data_reader/CSVReader.h"
#include "types/ClusterNode.h"
#include "utils/DistanceFunction.h"
#include "utils/DistanceLearning.h"
#include "utils/Helpers.h"
#include "utils/Prune.h"
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
using namespace distance_learning;... | ALGO | 0.947464 | 5.310075 |
c0eb47b1-cfa2-4970-b0f8-5185f03dec4b | haishand/work | CP/atcoder/medium100/42B_1.cpp | #include<bits/stdc++.h>
#define Tp template<typename Ty>
#define Ts template<typename Ty,typename... Ar>
#define Reg register
#define RI Reg int
#define Con const
#define CI Con int&
#define I inline
#define W while
#define N 100000
using namespace std;
int n;char s[N+5];
int main()
{
scanf("%s",s+1),n=strlen(s+1);
R... | ALGO | 0.999533 | 3.555987 |
460404dc-ac7e-4ba3-9ad8-944ee49c7f76 | sinyovercosy/cp3 | 11799.cpp | #include "stdio.h"
int main()
{
int t, i, n, c, ans;
scanf("%d", &t);
for(i=1;i<=t;i++)
{
ans = -1e9;
scanf("%d", &n);
while(n--)
{
scanf("%d", &c);
if(c>ans)
ans = c;
}
printf("Case %d: %d\n", i, ans);
}
}
| ALGO | 0.999412 | 3.420158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.