uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
38126ca9-8eed-421c-ab84-a6bc312167bc | sakura1729/Atcoder | test43.cpp | #include <bits/stdc++.h>
using namespace std;
struct Edge
{
long long to;
long long cost;
};
using Graph = vector<vector<Edge>>;
using P = pair<long, int>;
const long long INF = 1LL << 60;
void dijkstra(const Graph &G, int s, vector<long long> &dis)
{
int N = G.size();
dis.resize(N, INF);
priority... | ALGO | 0.999683 | 4.317148 |
49be3584-3f0e-493d-b9f4-f9f115e8cb7d | stenniswood/bk_code | abkInstant/nlp_protocol/FILE_protocol.cpp | #include <iostream>
#include <list>
#include <string.h>
#include <string>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include "bk_system_defs.h"
#includ... | TOOL | 0.880865 | 3.45998 |
c8268c96-9cf2-4199-8504-2e85104a6aa9 | QinHongZhe/hongzhe-leetcode | solution/1600-1699/1636.Sort Array by Increasing Frequency/Solution.cpp | class Solution {
public:
vector<int> frequencySort(vector<int>& nums) {
vector<int> cnt(201);
for (int& v : nums) ++cnt[v + 100];
vector<vector<int>> t;
for (int i = 0; i < cnt.size(); ++i)
if (cnt[i])
t.push_back({cnt[i], -i});
sort(t.begin(), t.e... | ALGO | 0.999992 | 5.73197 |
c56fd949-093e-43c9-9697-302361504b37 | Min-03/Algorithm | 02/2024_02_22/1039.cpp | #include <bits/stdc++.h>
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
int dists[1'000'001], cnts[10];
int len, k;
void bfs(int st) {
queue<int> q;
q.push(st);
dists[st] = 0;
while (!q.empty()) {
int curr = q.front(); q.pop();
for (int i... | ALGO | 0.999944 | 4.471626 |
e9b7e37f-8270-429c-a400-14aebaefe5eb | jjheon0614/DSA | test.cpp | #include <iostream>
#include <vector>
using namespace std;
struct Node {
int data;
int* Node;
};
// first node -> second -> third -> forth
// store value of the second node
// first node connects with the third => first -> third -> forth
// second value -> second -> first -> third -> forth
int main() {
... | ALGO | 0.999994 | 4.061101 |
e02d454f-0f83-427d-b54b-2e98f7f16f19 | Akshay80015/Coding-Practice | Array/rotateanarray.cpp | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> arr{1,2,3,4,5,6};
int value =arr[ arr.size()-1];
int i = arr.size()-1;
while(i>0)
{
arr[i]=arr[i-1];
i--;
}
arr[i]=value;
for(auto i : arr){
cout<<i<<" ";
}
return 0;
} | ALGO | 0.999422 | 3.92403 |
6ba06de6-cc86-4156-926d-2f73a8a3f8cf | neverac/codes | 19s_09/A/20553370_kasilina_A.cpp | #include<bits/stdc++.h>
using namespace std;
int t,l,r;
int main(){
cin >> t;
while(t--)
{
scanf("%d%d",&l,&r);
cout << l << " " << l*2 << endl;
}
return 0;
}
| ALGO | 0.99919 | 3.890248 |
f2abbc23-984a-4d93-9301-8831b4181200 | Not-Mostafa/CP | D_Taxes.cpp | #include <bits/stdc++.h>
using namespace std;
#define FIO ios ::sync_with_stdio(false), cin.tie(nullptr), cout.tie(NULL)
#define ll long long
#define ld long double
#define all(container) (container).begin(), (container).end()
#define cl(x,y) (x + y - 1) / y
#define lp(size) for (int i = 0; i < size; i++)
#define rlp(... | ALGO | 0.999962 | 4.48453 |
b776437f-c928-4097-aaf0-ba63d258f6ea | viviansh/234313 | libraries/AP_Soaring/ExtendedKalmanFilter.cpp | #include "ExtendedKalmanFilter.h"
#include "AP_Math/matrixN.h"
float ExtendedKalmanFilter::measurementpredandjacobian(VectorN<float,N> &A)
{
// This function computes the Jacobian using equations from
// analytical derivation of Gaussian updraft distribution
// This expression gets used lots
float expo... | ALGO | 0.998866 | 6.301125 |
f9cc6938-f841-4cb5-8db6-80fc2084ad9d | AsminBudha/Competitive-Programming | codechef/NUMPCAMP.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
// freopen("../input.txt","r",stdin);
ll t;
cin>>t;
while(t--){
ll a,b,n;
cin>>a>>b>>n;
a= (a<0)?((n%2==0)?-a:a):a;
b= (b<0)?((n%2==0)?-b:b):b;
cout<< ((a==b)?0:((a<b)?2:1));
cout<<endl;
}
return 0;
} | ALGO | 0.999848 | 3.840028 |
8cd467e2-62aa-4443-b510-295b69cad44d | chitamha/CPlusPlus_HighSchool_Exercises | C++_Va_C/ThayQuang/TwoPointer/3_Bai5_SoLuongDayConCoTongLonHonBangS/bt1.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, s, ans=0;
vector<ll> v;
int main(){
freopen("COUNT.INP", "r", stdin);
freopen("COUNT.OUT", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>> n>> s;
v.resize(n+1);
for (ll i=1; i<=n; i++) cin>> ... | ALGO | 0.999779 | 3.235473 |
666f8535-5756-4017-87d8-cc8e52387ead | Gabrax/GABGRIND | C++/CF/CF_BlackSquare.cpp | #include <cstdint>
#include <cstdlib>
#include <iostream>
#include <iostream>
#include <string>
#include <vector>
#include <cstdint>
#include <array>
#include <algorithm>
#include <unordered_map>
int main() {
std::cin.tie(0)->sync_with_stdio(0);
int32_t res = 0;
int32_t a,b,c,d;
std::cin >> a >> b >>... | ALGO | 0.999638 | 4.029584 |
a29f0e19-a79b-41e3-b3c5-c31051134355 | neloy25/CodeForce | ProblemSet/ProblemsetC/c11_Phoenix_and_Towers.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n,m,x;
cin >> n >> m >> x;
vector<int> v(n);
for(auto &x : v) cin >> x;
priority_queue<pair<int,int>, vector<pair... | ALGO | 0.999922 | 3.361058 |
fbd6f608-9854-4033-a60b-0c165af16730 | ishandutta2007/codeforces | lycmd/normal/546/E.cpp | #include<bits/stdc++.h>
using namespace std;
int const N=233,INF=0x3f3f3f3f;
int n,m,sa,sb,a[N],b[N],ans[N][N];
vector<int>e[N];
struct flow{
static int const N=233333;
int s,t,tot=1,head[N],val[N],nxt[N],to[N],cur[N],dep[N],l,r,q[N];
void add(int x,int y,int v){
to[++tot]=y;
val[tot]=v;
nxt[tot]=head[x];
h... | ALGO | 0.999995 | 3.532814 |
b70955a2-fd5f-41ec-b1ed-81be43367d21 | DER-Endervad/HomeworkPP-11.2 | big_integer.cpp | #include "big_integer.h"
big_integer::big_integer(std::string input) {
this->number_ = input;
}
big_integer::big_integer(const big_integer& other) {
number_ = other.number_;
}
big_integer::big_integer(big_integer&& other) noexcept {
number_ = std::move(other.number_);
}
big_integer& big_integer::operator=(const ... | TOOL | 0.894421 | 4.950536 |
d6444df3-869a-4885-9af8-0d9e431f4fde | AhmedEssamYassin/Problem-Solving | CP Sheets Solutions/ICPC Assiut - Newcomers/Sheet #2 (Loops)/R/Solution.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
/*
ceil() function:
----------------
Sometimes we need to compute the division of an integer rounded up (i.e. by ceiling, NOT by rounding those with remainder r >= 0.5)
For example:
⌈3/2.0⌉ = ⌈1.5⌉ = 2
⌈13/3.0⌉ = ⌈4.333⌉ = 5
In C++,
... | ALGO | 0.999946 | 4.506359 |
81e55591-14a7-4b2f-853a-01211e43b259 | alexandraback/datacollection | solutions_5756407898963968_0/C++/cstnt/MagicTrick.cpp | #include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <ctime>
#include <queue>
#include <map>
#include <set>
#include <cl... | ALGO | 0.998726 | 4.864271 |
521d3099-c974-4564-a38e-f8d7d49465d7 | eyakub175/c-practice-program | Swap/swap_with_pointer.cpp | #include <stdio.h>
void swap(int *xp, int *yp)
{
int temp = *xp;
*xp = *yp;
*yp = temp;
}
int main()
{
int x, y;
printf("Enter Value of x ");
scanf("%d", &x);
printf("\nEnter Value of y ");
scanf("%d", &y);
swap(&x, &y);
printf("\nAfter Swapping: x = %d, y = %d", x, y);
re... | ALGO | 0.999363 | 4.400593 |
66f8e9b8-5927-4e9a-bbe5-e58b55e4542d | ishandutta2007/codeforces | vercingetorix/normal/1606/E.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <cstring>
#include <set>
#include <bitset>
#include <map>
#include <chrono>
#include <random>
#include <unordered_map>
#include <stdio.h>
using namespace std;
typedef long long ll;
typedef long do... | ALGO | 0.999918 | 4.221964 |
d668ce8f-d649-44fc-a346-f88b27a60939 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_10985_10.cpp | #include <bits/stdc++.h>
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
using namespace std;
template <class T, class U>
inline void checkmin(T &x, U y) {
if (y < x) x = y;
}
template <class T, class U>
inline void checkmax(T &x, U y) {
if (y > x) x = y;
}
template <class T, class U>
inline b... | ALGO | 0.999972 | 3.163495 |
acf9c346-1d5c-4074-88c2-44502769ab0b | Irondev25/3rd-Sem-C-C-Programs-DS- | cplusplus/setw.cpp | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
int pop1=2425785, pop2=47, pop3=9761;
char str[20], str2[20];
cout<<setw(8)<<"Location"<<setw(12)<<"Population"<<endl;
cout<<setw(8)<<"Portcity"<<setw(12)<<pop1<<endl;
cout<<setw(8)<<"Hightown"<<setw(12)<<pop2<<endl;
cout<<s... | TOOL | 0.963959 | 3.199653 |
d372f6ee-3ed9-4d10-ae14-4172ffb5a492 | ALGORIDUM/2025_pknu_algorithmStudy | 1주차/6번_BOJ2447/6번_김상지.cpp | #include<bits/stdc++.h>
using namespace std;
char board[2200][2200] = { };
void write(int x, int y, int n){
for(int i =x; i<x+n; i++){
for(int j =y; j<y+n; j++){
board[i][j]='*';
}
}
n = n/3;
for(int i =x+n; i<x+2*n; i++){
for(int j=y+n; j<y+2*n; j++){
bo... | ALGO | 0.999913 | 3.530009 |
666df9ce-63db-4f7e-adee-976bc3aec2f7 | mrwick12/-6companies30days | Microsoft/question_5.cpp | link-https://practice.geeksforgeeks.org/problems/stock-span-problem-1587115621/1#
vector <int> calculateSpan(int price[], int n)
{
vector<int>v;
stack<int>s;
s.push(0);
v.push_back(1);
for(int i=1;i<n;i++)
{
while((s.empty()==false)&&(price[s.top()]<=price[i]))
s.po... | ALGO | 0.99965 | 5.837896 |
bb96eb58-d7ab-4303-a76a-ec151d1ac453 | haruboring/atcoder | abc061/c/main.cpp | #include "atcoder/all"
#include "bits/stdc++.h"
#define int long long
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repp(i, m, n) for (int i = m; i < (int)(n); i++)
#define debug(x) cerr << #x << ": " << x << endl
using namespace std;
signed main() {
int N, K;
c... | ALGO | 0.999964 | 4.575057 |
5d4e7408-53f3-419f-8aee-cf29a2007a48 | trident-dev/cp-resourse-az | Module 0/q7.4.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long int lli;
typedef long long ll;
#define mod 1000000007
void solve(){
string s;
int a, b;
queue<int> q;
cin>>a;
for(int i =0; i<a; i++){
cin>>s;
if(s=="add"){
cin>>b;
q.push(b);
}
else if(s=="print"){
if(!q.empty())
... | ALGO | 0.998946 | 5.083824 |
b9e6d3ec-06d0-4f13-bcac-334c9f12b279 | Sambitcr-7/Leetcode | 1512-number-of-good-pairs/1512-number-of-good-pairs.cpp | class Solution {
public:
int numIdenticalPairs(vector<int>& nums) {
int count = 0;
for (int i = 0; i < nums.size(); i++) {
for (int j = i + 1; j < nums.size(); j++) {
if (nums[i] == nums[j]) {
count++;
}
}
}
... | ALGO | 0.999963 | 6.164583 |
0959d2d6-f546-44da-bd01-2944844fd616 | liuxueyang/cpp | leetcode/problemset/107.cpp | #include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include ... | ALGO | 0.99996 | 4.742342 |
8f824b36-f329-4810-bb3d-538d9de21343 | DavidingPlus/algorithm | leetcode/1109.航班预订统计.cpp | /*
* @lc app=leetcode.cn id=1109 lang=cpp
*
* [1109] 航班预订统计
*/
// @lc code=start
#include <iostream>
#include <vector>
using namespace std;
const int N = 2 * 1e4 + 10;
class Solution {
public:
vector<int> corpFlightBookings(vector<vector<int>>& bookings, int n) {
// 想对数组进行某个区间的修改,就可以用到差分数组(就是前缀和数组逆向的... | ALGO | 0.999755 | 6.543582 |
c8e1f3a1-96f6-463e-bed2-717f8c5939ca | ishandutta2007/codeforces | rubikun/normal/1261/B2.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<18,INF=1<<30;
int bit[MAX+1],N;
//1-indexed
int sum(int i){
int s=0;
while(i>0){
s+=bit[i];
i-=i&-i;
}
return s;
}
//st=sum(t)-sum(s-1)
void add(i... | ALGO | 0.99999 | 4.00315 |
54b094d0-9fad-4d3e-863e-ef8070945710 | tiozo/Training | vnoj/fc127_discount.cpp | #include<bits/stdc++.h>
using namespace std;
const int MOD = 1e9+9;
const int K = 1e5+5;
vector<long long> s(K);
long long power(long long a,int N) {
long long tmp = a, ans =1;
while (N>0) {
if (N&1) ans = ans * tmp % MOD;
tmp = tmp * tmp % MOD;
N>>=1;
}
return ans;
}
int main... | ALGO | 0.999856 | 3.800292 |
3db9d9d2-722f-4740-9466-7ecf8edc8bca | epocode/finite-element-cuda-new | finite-element-cuda-new/include/eigen-3.4.0/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.958721 | 3.076401 |
1effd235-0497-47f8-9c4b-174fa1aa786d | Night-Spider/TiMP_razr2 | calc.cpp | //calc.cpp
#include "calc.h"
uint32_t calc::send_res() {
uint32_t result = 1;
for (const auto& value : values) {
if (value == 0) {
return 0; // Возвращаем 0, если одно из значений равно 0
}
if (result > std::numeric_limits<uint32_t>::max() / value) {
return std::... | TOOL | 0.999066 | 6.678314 |
cb075456-d989-471b-9c45-9703fb3f62b1 | saadmosaif/Vetement_ia | 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.998756 | 6.772262 |
8e133495-968b-47a1-8f8d-efcb8cc18060 | sheima-ayadi/FromMangaToVideo | tesseract-main/src/lstm/maxpool.cpp | #include "maxpool.h"
namespace tesseract {
Maxpool::Maxpool(const std::string &name, int ni, int x_scale, int y_scale)
: Reconfig(name, ni, x_scale, y_scale) {
type_ = NT_MAXPOOL;
no_ = ni;
}
// Reads from the given file. Returns false in case of error.
bool Maxpool::DeSerialize(TFile *fp) {
bool result = ... | TOOL | 0.887936 | 7.04669 |
cafd0120-8f31-4217-a30f-455ab8bf3639 | sophiale07/LeetCode | Longest Substring Without Repeating Characters-i.cpp | /*㷨 ʹHash
ӶΪO(n^2)nΪַijȣĿռΪhash[256];
*/
class Solution {
public:
int lengthOfLongestSubstring(string s){
int size=s.length();
int maxlen=0;
int maxindex=0;
char visit[256];
int i,j;
for(i = 0; i < size; ++i)
{
memset(visit,0,sizeof visit)... | ALGO | 0.999972 | 5.223788 |
612540a4-4d5b-4381-a183-ba046aad2303 | abhishekpawl/dsa | Stack/maximalRectangle.cpp | /* https://leetcode.com/problems/maximal-rectangle/ */
class Solution {
public:
void nsr(vector<int> &right, int n, vector<int> &heights) {
stack<int> s;
for(int i = n-1; i >= 0; i--) {
if(s.empty()) {
right.push_back(-1);
} else {
whi... | ALGO | 0.999909 | 6.600628 |
5f5ede43-1701-4984-987e-72ab5a562f02 | aditiangra/Leetcode-daily-practice | 14-longest-common-prefix/14-longest-common-prefix.cpp | class Solution {
public:
string longestCommonPrefix(vector<string>& strs) {
int n=strs.size();
if(n==0)return "";
sort(strs.begin(),strs.end());
string a=strs[0];
string b=strs[n-1];
string ans="";
for(int i=0;i<a.size();i++)
{
if(a[i]==b[i... | ALGO | 0.999899 | 5.69137 |
693cceb1-9649-4d4e-a84a-265b1b39a7cd | xmonterrosol/Laboratorio-24-de-marzo-Depuraci-n-y-Manejo-de-Excepciones-en-C- | LAB24MARZO/LAB24MARZO.cpp | #include <iostream>
using namespace std;
// Función recursiva para calcular el n-ésimo número de Fibonacci
int fibonacci(int n) {
if (n == 0) return 0; // Caso base 1
if (n == 1) return 1; // Caso base 2
return fibonacci(n - 1) + fibonacci(n - 2); // Llamadas recursivas
}
int fibonacci(int n) {
if (... | ALGO | 0.998909 | 6.185302 |
db5a160d-dee6-482d-b263-118fb7f30794 | tomatoisblue/atcoder | dp/a/main.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define reps(i,s,n) for(int i=s; i<n; i++)
#define all(v) v.begin(), v.end()
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vb vector<bool>
#define vvi vector<vector<int>>
#define vvb vector<vector<bool>>
#define vvc vect... | ALGO | 0.999959 | 4.446575 |
417dc18a-dc67-4063-a9d5-bd04762a3277 | noob1301/Airhood_is_idiot | codeup/codeup1001-1100/1090.cpp | #include<iostream>
#include<cmath>
int main(){int a;int b;int c;std::cin>>a>>b>>c;std::cout<<(long long int)(a*std::pow(b,c-1));} | ALGO | 0.999884 | 3.619485 |
9df3f47f-f690-41cc-935c-788df11c6f4b | alifalhasan/CP-code-vault | Codeforces/Codeforces Round/Codeforces Round 744 (Div. 3)/E1 - Permutation Minimization by Deque/130197871.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename temp>using ordered_set = tree<temp, null_type, less_equal<temp>, rb_tree_tag,tree_order_statistics_node_update>;
//order_of_key(k) : Number of items str... | ALGO | 0.99992 | 5.143298 |
4d0f5ccc-740e-42cb-8dae-8afd717eff08 | Danlif1/AP_Task1 | calcDist.cpp | #include "CalcDist.h"
/**
* @brief Calculating the distance of two vectors using Euclidian distance.
* Actually just calling Minkowski with 2 as it does the same thing.
*
* @param point1 First vector.
* @param point2 Second vector.
* @return double The distance between two vectors.
*/
double Euclidian(std::vec... | ALGO | 0.992361 | 5.902089 |
2b0cd50b-e79a-4d2f-b34d-421e3cabd8db | Ayush-Balodi/CrackYourInternship | 0063-unique-paths-ii/0063-unique-paths-ii.cpp | class Solution {
public:
int dfs( vector<vector<int>> &dp, vector<vector<int>> &nums, int i, int j, int m, int n ){
if( i<0 or i>=m or j<0 or j>=n ){
return 0;
}
if( nums[i][j] == 1 ){
return 0;
}
if( dp[i][j] != -1 ){
return dp[i][j];
... | ALGO | 0.999887 | 6.194018 |
67ac442b-5457-4786-9d6f-5382aa535db8 | diaas14/leetcode-solutions | 213_House_Robber_II.cpp | /**
* Question:
* You are a professional robber planning to rob houses along a street.
* Each house has a certain amount of money stashed.
* All houses at this place are arranged in a circle.
* That means the first house is the neighbor of the last one.
* Meanwhile, adjacent houses have a security system conn... | ALGO | 0.999975 | 5.848372 |
a8da6b70-9404-46bf-bbf9-2fcaa141eaf6 | Kenshin2438/CP-Code-Collection | OJ/LibreOJ/2072.cpp | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.hpp"
#else
#define debug(...) 42
#endif
using ll = long long;
#define all(a) begin(a), end(a)
using ull = unsigned long long;
#include <bits/extc++.h>
const int SEED = chrono::steady_clock::now().time_since_epoch().count();
struct chash { /... | ALGO | 0.99975 | 4.472973 |
6b716aa5-86d7-4493-ad0d-32027312056c | gourabsingha1/LeetCode-and-GFG-Problems | 0974-subarray-sums-divisible-by-k/0974-subarray-sums-divisible-by-k.cpp | class Solution {
public:
int subarraysDivByK(vector<int>& nums, int k) {
int n = nums.size(), pre = 0, res = 0;
unordered_map<int, int> freq;
freq[0] = 1; // initial cumulative sum = 0 and that sum % k will be equal to 0 always
for (int i = 0; i < n; i++)
{
pre = ... | ALGO | 0.999959 | 5.970799 |
3c3e2a6c-6268-41bf-8f65-a1c686297a8a | UtkarshTiwariDevs/Datastructure-and-algorithm | 37 sliding window aditya sir/maxInSubarray.cpp | /*
Input 1:
A = [1, 3, -1, -3, 5, 3, 6, 7]
B = 3
Output 1:
C = [3, 3, 5, 5, 6, 7]
*/
#include <bits/stdc++.h>
using namespace std;
vector<int> solve(int a[], int k, int n)
{
vector<int> v;
list<int> l;
int i = 0, j = 1;
l.push_back(a[0]);
while (j < n)
{
if (a[j] > a[j ... | ALGO | 0.999997 | 4.281796 |
4ba71f2f-3380-4374-87f5-1586ab336efe | cq2018-1822-xlav/TH-CK | 18120018_18120061_18120062_18120533_18120543_Lab03/src/Kernel.cpp | #include "Kernel.h"
#include <algorithm>
#include <iterator>
void displayKernel (const std::vector<float>& v)
{
std::copy(v.begin(), v.end(),
std::ostream_iterator<float>(std::cout, " "));
}
std::vector<float> getGaussianKernel(int rows, int cols, double sigmax, double sigmay)
{
const auto y_mid = (ro... | ALGO | 0.998289 | 5.011014 |
d30a3696-7cf4-476d-b6f0-731e87ad10e1 | ishandutta2007/codeforces | maximumshot/normal/1637/F.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const int inf = 1e9;
const ll inf64 = 1e18;
struct output {
ll res;
void print() {
... | ALGO | 0.999968 | 3.930937 |
8418c65e-4500-4ea2-80e5-51058bcfc360 | deepin-community/llvm-toolchain-15 | llvm/examples/Kaleidoscope/Chapter2/toy.cpp | #include <cctype>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
//===----------------------------------------------------------------------===//
// Lexer
//===----------------------------------------------------------------------===//
// T... | TOOL | 0.924074 | 7.666117 |
6b75a17d-8e02-4838-8e3a-939087fc61e7 | jasonabele/ettus-uhd | host/utils/uhd_cal_rx_iq_balance.cpp | #include "usrp_cal_utils.hpp"
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/utils/paths.hpp>
#include <uhd/utils/algorithm.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <boost/thread/thread.hpp>
#include <boo... | TOOL | 0.914164 | 5.219443 |
514071df-5df7-48cb-bf7f-02b880a3dd91 | uzmabanu356/Learning-in-BCA | C++/HIERARIN.CPP | #include<iostream.h>
#include<conio.h>
class A
{
private:
int a,b,add;
public:
void input1()
{
cout<<"enter two number:- "<<endl;
cin>>a>>b;
}
void sum()
{
add=a+b;
cout<<"addition is :-"<<add<<endl;
}
};
class B1 : public A
{
private:
int a,b,sub;
public:
void input2()
{
cout<<"enter... | ALGO | 0.997299 | 3.620428 |
0c6a545b-1eaa-48a4-b464-3f1a75707eb6 | Noor210111/Codeforces-Problem-Solution | C/1878C - Vasilije in Cacak.cpp | #include <bits/stdc++.h>
typedef long long int lli;
using namespace std;
void solve()
{
lli n, k, x;
cin >> n >> k >> x;
lli sum1, sum2;
sum1 = (k * (k + 1)) / 2;
sum2 =((2 * n - k + 1) * k) / 2;
if(sum1 <= x && sum2 >= x)
cout << "YES" << endl;
else cout << "NO" << endl;
}
... | ALGO | 0.999909 | 4.244474 |
8614edef-e884-458e-a665-fec7af8c2845 | sarvex/leetcode-crystal | solution/1600-1699/1618.Maximum Font to Fit a Sentence in a Screen/Solution.cpp | /**
* // This is the FontInfo's API interface.
* // You should not implement it, or speculate about its implementation
* class FontInfo {
* public:
* // Return the width of char ch when fontSize is used.
* int getWidth(int fontSize, char ch);
*
* // Return Height of any char when fontSize is ... | ALGO | 0.99984 | 5.971519 |
116c4f52-0788-4fe7-b5f9-8185bb71fad6 | Raunak1001/Competitive-Coding | GFG/FindAllFour.cpp | #include<bits/stdc++.h>
using namespace std;
#define vi vector<long long int>
#define vp vector<pair<long long int,long long int > >
#define vc vector<char>
#define vvi vector<vector<long long int> >
#define vvp vector<vector<pair<long long int,long long int> > >
#define vvc vector<vector<char> >
#define ll long long... | ALGO | 0.999461 | 3.120506 |
c538a574-b8b8-4985-8fc0-2811280abd93 | PrashamModi/gfg | Difficulty: Easy/Find Only Repetitive Element from 1 to n-1/find-only-repetitive-element-from-1-to-n1.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution {
public:
int findDuplicate(vector<int>& arr) {
// code here
int xorr = 0;
for(int i = 1; i <= arr.size() - 1; i++){
xorr = (xorr ^ i);
... | ALGO | 0.996728 | 5.807999 |
08fa7cff-c292-4002-9792-61d0a61a9b0a | bappi2097/ACM-Problem-Solving | Codeforces/Manthan, Codefest 19 (open for everyone, rated, Div. 1 + Div. 2)/B.cpp | #include<bits/stdc++.h>
using namespace std;
int n,ar[2000],l[2000],r[2000],cnt=0,mark[2000],maxi,bl=0;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.cpp","r",stdin);
#endif // ONLINE_JUDGE
cin>>n;
for(int i=0;i<n;i++)
{
cin>>ar... | ALGO | 0.999955 | 4.457021 |
1bec7d55-d353-412b-b813-62efb9ac6d0a | sarvex/leetcode-ada | lcof2/剑指 Offer II 091. 粉刷房子/Solution.cpp | class Solution {
public:
int minCost(vector<vector<int>>& costs) {
int r = 0, g = 0, b = 0;
for (auto& cost : costs) {
int _r = r, _g = g, _b = b;
r = min(_g, _b) + cost[0];
g = min(_r, _b) + cost[1];
b = min(_r, _g) + cost[2];
}
return... | ALGO | 0.99771 | 6.458809 |
e1ebe622-69fb-4fcf-a0a3-258e041cd712 | ImCityHunter/CS5006-Algorithms | Final-5006-C/src/problem1.cpp | /*
* problem1.cpp
*
* CS 5006 Final Exam
* Problem 1
*
* The function power_nt() below, which is not tail-recursive,
* computes single-precision X raised to the unsigned int power N.
*
* This problem is to:
*
* 1) create an equivalent function power_tr that transforms
* power_nt() to be strictly tail recurs... | ALGO | 0.999727 | 6.648924 |
7b23470b-51ff-4b93-ab55-2785858b3750 | ishandutta2007/codeforces | milisav/normal/1305/E.cpp | #include<bits/stdc++.h>
#define maxn 50000
using namespace std;
int n,m;
int dp[maxn];
int a[maxn];
int main() {
scanf("%d %d",&n,&m);
dp[1]=0;
dp[2]=0;
if(n<=2) {
if(m==0) {
for(int i=1;i<=n;i++) printf("%d ",i);
return 0;
}
else {
printf("-1"... | ALGO | 0.999972 | 3.289896 |
a36532c1-d2bc-4bc0-852c-1a97a16e346f | mcrl/SnuRHAC | mapa/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp | #include "clang/Basic/JsonSupport.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h"
#incl... | TOOL | 0.89639 | 7.509957 |
d157a4ea-3fba-4a92-bb72-11934b53c05d | yanxian-ll/GS-SR | submodules/diff-surfel-rasterization/third_party/glm/test/gtx/gtx_fast_trigonometry.cpp | #include <glm/ext/scalar_ulp.hpp>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtc/type_precision.hpp>
#include <glm/gtx/fast_trigonometry.hpp>
#include <glm/gtx/integer.hpp>
#include <glm/gtx/common.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/vec1.hpp>
#include <glm/trigonometric.hpp>
#include <cmath>
#i... | TEST | 0.961767 | 6.277224 |
bdb5c023-81a6-42c4-ad2f-cb88bc3cbcc8 | QIDITECH/QIDISlicer | bundled_deps/libigl/igl/harmonic.cpp | template <
typename DerivedV,
typename DerivedF,
typename Derivedb,
typename Derivedbc,
typename DerivedW>
IGL_INLINE bool igl::harmonic(
const Eigen::MatrixBase<DerivedV> & V,
const Eigen::MatrixBase<DerivedF> & F,
const Eigen::MatrixBase<Derivedb> & b,
const Eigen::MatrixBase<Derivedbc> & bc,
cons... | ALGO | 0.998519 | 5.806787 |
5471daef-2d69-4b8e-96c9-33b6d6732359 | qiaotian/CodeSprint | leetcode/cpp/qt_path_sum_ii.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// 1st solution (16ms, beats 42%)
class Solution {
private:
vector<vector<int>> res;
void helper(TreeNode* root, v... | ALGO | 0.999997 | 6.29016 |
dd038216-4e7c-4f86-97b0-9f93a88802f1 | Ish2K/C-Finance | Chp-06/matrix.cpp | #include <assert.h>
#include <math.h>
using namespace std;
double ** addMatrix(double** m1,double** m2,const int N,const int M){
double** m3 = new double*[N];
for(int i=0;i<N;i++){
m3[i] = new double[M];
for(int j=0;j<M;j++){
m3[i][j] = m1[i][j] + m2[i][j];
}
}
return m3;
}
double ** subtractMatrix(doubl... | ALGO | 0.999559 | 4.120894 |
72b8169a-ae26-4a7e-a3d8-c12cd430b3f3 | L1eNn/AiP-practgice-2022 | Naz/28.12.2022/operations.cpp | #include "operations.h"
#include <numeric>
#include <complex>
using namespace std;
double NormalOperations(int op, double firstNum, double secondNum) {
double result;
switch (op) {
case 1:
result = firstNum + secondNum;
return result;
case 2:
result = firstNum - secondNum;
return result;
case 3:
resu... | TOOL | 0.978298 | 3.71265 |
d3d90e45-4b6a-4c92-baf0-b3c6f2d678c8 | c21/Leetcode | medium/118*.130 Surrounded Regions.cpp | /*
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded region.
For example,
X X X X
X O O X
X X O X
X O X X
After running your function, the board should be:
X X X X
X X X X
X X X X
X O X X
*/
#include <vector>
#inclu... | ALGO | 0.999765 | 4.403088 |
d3e23ecb-776d-4522-a898-155f57d44f73 | allenhyp/LeetCodePractice | 209_Minimum_Size_Subarray_Sum.cpp | class Solution {
public:
int minSubArrayLen(int s, vector<int>& nums) {
int n = nums.size(), sum = 0, left = 0, min_len = INT_MAX;
for (int i = 0; i < n; i++) {
sum += nums[i];
while (sum >= s) {
min_len = min(min_len, i - left + 1);
sum -= num... | ALGO | 0.999973 | 6.256215 |
5375848f-c303-40cd-8b60-44935392c1a8 | erkong35/Huffman | HCTree.cpp | #include <queue>
#include <vector>
#include <fstream>
#include <algorithm>
#include "HCTree.hpp"
#include "BitInputStream.hpp"
#include "BitOutputStream.hpp"
using namespace std;
HCTree::~HCTree(){}
/** Use the Huffman algorithm to build a Huffman coding trie.
* PRECONDITION: freqs is a vector of ints,... | ALGO | 0.999049 | 5.34343 |
05263f8c-122a-4128-bf1f-ff8b0d495c0c | Aympab/HypreBoomerAMG_Benchmark | eigen-3.3.7/doc/examples/tut_matrix_resize.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
MatrixXd m(2,5);
m.resize(4,3);
std::cout << "The matrix m is of size "
<< m.rows() << "x" << m.cols() << std::endl;
std::cout << "It has " << m.size() << " coefficients" << std::endl;
VectorXd v(2);
v.resize(5);
... | ALGO | 0.96647 | 3.882785 |
49ea9a62-e071-423f-b264-dd8bb8260a43 | s-m-arafat/online-judge-problems | codeforces/Virtual Round 776 Div 3/B.cpp | //Auth:Shakil Mahmud Arafat -arft666, AUST, Dept. of EEE
#include<bits/stdc++.h>
using namespace std;
//SET PRECIOSION cout << fixed ; cout << setprecision(n) << ans << endl;
typedef long long ll;
typedef vector<ll>vll;
typedef vector<int>vi;
typedef vector<vll>vvl;
typedef vector<vi>vvi;
// #define OJ
#define nl ... | ALGO | 0.999759 | 3.773632 |
03828e52-a4ac-43e0-b011-304dd4769953 | inquaid/Solved-Problems | CODEFORCES/E_MEX_Count.cpp | /**
* https://codeforces.com/contest/2123/problem/E
*
* have to find number of unique MEX after removing k (0..n)
* Or, we can say we have to find for which numbers the MEX is -> i(0..MEX(a))
* for any number i we can observe the answer will be i
* iff there are all numbers atleast once that are less than i
* s... | ALGO | 0.999897 | 5.032116 |
a77f91e7-8f34-4d02-9666-5571c96846c6 | liangzhangleon/CarND-MPC-P10 | src/Eigen-3.3/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.998061 | 5.816968 |
29413dc1-8b46-4185-bdd7-a1bf604a29f6 | AryanChauhan25/CodingBlocks-AlgoCourse-Solutions | Number Theory/LCM.cpp | #include<iostream>
using namespace std;
#define ll long long int
ll gcd(ll a, ll b) {
if(b == 0) {
return a;
}
return gcd(b, a % b);
}
int main() {
ll a,b;
cin>>a>>b;
cout<<(a * b) / gcd(a,b);
return 0;
} | ALGO | 0.999368 | 4.039603 |
a2e38fb3-6d67-464c-8f43-5bda6e5c74e1 | ishandutta2007/codeforces | krk/normal/436/C.cpp | #include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair <int, int> ii;
const int Maxk = 1005;
const int Maxn = 12;
int n, m, k, w;
char B[Maxk][Maxn][Maxn];
vector <ii> W[Maxn * Maxn];
int comp, siz[Maxk], par[Maxk];
vector <int> neigh[Maxk];
bool taken[Maxk];
in... | ALGO | 0.99994 | 3.172118 |
89aadad6-dd62-438d-8290-e5b2c40eb43a | SuperFoolGirl/data_structure_learning | HashTable/ProbingHash.cpp | // 通过散列(哈希)函数,使关键字key映射到一个值,这个值就是对应下标。用这个下标来访问value
// 给定一个最简单的例子,刚入门时做oj,开一个较大的数组,直接用下标访问
// 哈希函数为H(key) = key. H(key)为映射的地址,即下标
// 但如果key是字符串,或者其他类型的对象,就需要一个散列函数,将key映射到一个整数,然后用这个整数作为下标来访问value
// 实现上,这里采用了除留余数法
// H(key) = key % p
// p为大于等于表长的最小质数
// 这样可以保证散列函数的值在0到p-1之间,比直接取余发生冲突概率更小,表分布会更均匀
// 散列表空间利用率,用装填因子α表示
... | ALGO | 0.999253 | 6.090401 |
c52b9819-beb7-440f-9604-5d4215f7d7a1 | prince2520/Data-Structure-and-Algorithm | Challenges - Recursion/smart_keypad-1.cpp | #include <iostream>
using namespace std;
void smart_keypad(string table[], char num[], char out[], int i, int j){
// Base case
if(num[i] == '\0'){
out[j] = '\0';
cout << out << endl;
return;
}
// Rec case
int digit = num[i] - '0';
for(int k=0; table[digit][k]!='\0'; k++){
out[j] = table[digit][k];
... | ALGO | 0.99924 | 4.274288 |
1070ae7f-3b8e-4c25-b877-bb39e4cb23a6 | Anaya898/C-and-Cpp | data_structures/arrays/adt.cpp | #include <iostream>
using namespace std;
struct Array {
int *A;
int size;
int length;
};
void display(struct Array arr) {
cout << endl << "Elements are: " << endl;
for (int i = 0; i < arr.length; i++) {
cout << arr.A[i] << " ";
}
cout << endl;
}
void append(struct Array *arr, int ... | ALGO | 0.868428 | 4.049699 |
dc1da094-e5c3-4f98-85dc-4f06ba508f9c | Nivaskumark/frameworks_av | media/libstagefright/codecs/amrnb/dec/src/d_plsf_5.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/d_plsf_5.c
Date: 04/24/2000
------------------------------------------------------------------------------
REVISION HISTORY
Description: Made changes based on review meeting.
Description: Sync... | ALGO | 0.998239 | 6.493878 |
f6f53dde-32c2-4b38-bd1f-b925c4c6072b | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_11805_7.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, k;
cin >> n >> m >> k;
vector<int> a(n), b(m);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
for (int i = 0; i < m; i++) {
cin >> b[i];
}
sort(a.begin(), a.end());
sort(b.begin(), b.end());
int ia = 0, ib = 0;
bool pos = f... | ALGO | 0.999992 | 3.767781 |
81a1edaf-07e2-474d-8271-80ae842fb378 | KenyaFlutterDev/Striiikly | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
def7c8d8-0f9c-4b1d-bea5-4e0b17fffe25 | GustavoPolicarpo/maratona | URI/GRAPH/2048 - Houston, We've Got a Prob....cpp | // Author: Gustavo Policarpo
// Name: Houston, We've Got a Prob...
// Level: 6
// Category: GRAPH
// URL: https://www.beecrowd.com.br/judge/en/problems/view/2048
#include <bits/stdc++.h>
//LIFE IS NOT A PROBLEM TO BE SOLVED
using namespace std;
#define rep(i,a,b) for(int i = int(a); i < int(b) ; i++)
#define pb pus... | ALGO | 0.999823 | 4.264988 |
10c8d8c8-dc23-46e1-9de7-aa75a766578c | sarvex/leetcode-carbon | solution/1700-1799/1720.Decode XORed Array/Solution.cpp | class Solution {
public:
vector<int> decode(vector<int>& encoded, int first) {
vector<int> ans{{first}};
for (int i = 0; i < encoded.size(); ++i)
ans.push_back(ans[i] ^ encoded[i]);
return ans;
}
}; | ALGO | 0.999991 | 5.141685 |
8ede074b-d46a-4a2b-9587-593d9623df58 | Yycode76/oss25 | 250515/369 게임/369-game.cpp | #include <iostream>
using namespace std;
int main() {
// 변수 선언
int n;
// 입력
cin >> n;
// 출력
for(int i = 1; i <= n; i++) {
if(i % 3 == 0)
cout << "0 ";
else if(i % 10 == 3 || i % 10 == 6 || i % 10 == 9)
cout << "0 ";
else if(i / 10 == 3 || i / 10 == 6 || i / 10 == 9)
cout << "0 ";
... | ALGO | 0.999547 | 4.187159 |
c9e53474-839e-432c-b72a-fc19257db0e3 | arvind-kumar-anand/Coding-Ninjas-All-Code | [CN] Data Structures and Algorithms C++ [2020]/Lecture 18 DP - 1/6.Solution Min Steps to 1 (Memoization).cpp | #include <iostream>
using namespace std;
int minStepsHelper(int n, int *ans)
{
// Base case
if (n <= 1)
{
return 0;
}
// Check if output already exists
if (ans[n] != -1)
{
return ans[n];
}
// Calculate output
int x = minStepsHelper(n - 1, ans);
int y = INT... | ALGO | 0.999985 | 5.175337 |
55304d57-2997-4d95-8342-ac14e7d9a2ec | Anuragmaurya-code/Data-Structures | 03_recursion/10_taylor_series_using_horners_rule.cpp | #include<iostream>
float e1(float x,int n)//using loop
{
float s=1;
for(;n>0;n--)
{
s=1+x/n*s;
}
return s;
}
float e(float x,int n)//using recursion
{
static float s=1;
if(n==0)
return s;
s=1+x/n*s;
return e(x,n-1);
}
int main()
{
std::cout<<e(1,10)<<std::endl;
... | ALGO | 0.999952 | 3.814977 |
534874a2-8578-4641-bd88-57806bccce58 | addRajj/Leet-Code | Chocolate Distribution Problem - GFG/chocolate-distribution-problem.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long findMinDiff(vector<long long> arr, long long n, long long m){
//code
long long minn=INT_MAX;
sort(arr.begin() , arr.end());
for(int i=0;i<=(n-m);i++)
{
if((ar... | ALGO | 0.999913 | 5.928328 |
689aec38-2d97-4a28-a5e2-46d1e12bdb32 | ishandutta2007/codeforces | triple__a/normal/1299/D.cpp | // #pragma comment(linker, "/STACK:102400000,102400000")
#pragma GCC optimize("O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
// #pragma GCC optimize("trapv")
#include<bits/stdc++.h>
#define int long long
#define double long double
using namespace std;
namespace std {
template<class Fun... | ALGO | 0.999983 | 4.656139 |
31f137f4-3bb9-4706-82c5-35ba3d9c9c4f | xkrTz/pipeline | pipeline.cpp | #include <fstream>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// Função para ler o tempo de clock do Pipeline
float ler_tempo_clock() {
float tempo_clock;
cout << "Insira o tempo de clock do Pipeline: ";
cin >> tempo_clock;
return tempo_clock;
}
// Função para ler o ... | ALGO | 0.999254 | 5.521005 |
3cbc289d-c40d-4d5c-b3ed-b1bdc9163e89 | lasher169/hiit_me | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
730701b3-2fe8-4798-a3f6-d06096f7ce66 | allfs/mariadb | storage/ndb/src/ndbapi/NdbOperationSearch.cpp | /******************************************************************************
Name: NdbOperationSearch.C
Include:
Link:
Author: UABMNST Mona Natterkvist UAB/B/SD
Date: 970829
Version: 0.1
Description: Interface between TIS and NDB
Documentation:
Adjust: 97102... | TOOL | 0.885582 | 5.197618 |
b0ecd538-a634-4234-b207-32f2dda080fd | narendravarma2004/DSA0158-C- | Overload+oper.cpp | #include <iostream>
using namespace std;
class Add {
public:
int value;
Add(int v) : value(v) {}
Add operator + (const Add& obj) {
return Add(value + obj.value);
}
};
int main() {
Add a1(5), a2(10);
Add a3 = a1 + a2;
cout << "Sum: " << a3.value << endl;
return 0;
}
| TOOL | 0.993074 | 5.38306 |
da971440-ec13-4c6b-8cf2-b037a24c9395 | IagoGMacedo/IMD0029-Estrutura-De-Dados-Basicas-I | conteudos/provas_praticas/20182-Unidade3/src/HashTable.cpp | //
// HashTable.cpp
//
// Created by Eiji Adachi Medeiros Barbosa
//
#include "HashTable.h"
#include <string>
#include <iostream>
using namespace std;
HashEntry<std::string, std::string> *ENTRY_DELETED = (HashEntry<std::string,std::string>*)(-1);
HashTable::~HashTable()
{
for( int i = 0; i < this->getSize(); ... | ALGO | 0.943969 | 5.634953 |
346a460c-8080-46a3-89c9-de072e10a655 | Shubhamm1211/GFG- | Difficulty: Medium/Allocate Minimum Pages/allocate-minimum-pages.cpp | //{ Driver Code Starts
// Initial function template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
bool solve(vector <int> &arr, int k, int maxi){
int cnt = 1;
int sum = 0;
for(int i = 0; i < arr.size(); i++){
sum += arr[... | ALGO | 0.999412 | 5.387258 |
1f169935-3fd5-4f27-b474-bff4102e93ff | monster119120/conv_relu_plus_plus | ncnn_src/src/layer/x86/eltwise_x86.cpp | #include "eltwise_x86.h"
#if __SSE2__
#include <emmintrin.h>
#if __AVX__
#include <immintrin.h>
#endif // __AVX__
#endif // __SSE2__
#include "x86_usability.h"
namespace ncnn {
Eltwise_x86::Eltwise_x86()
{
#if __SSE2__
support_packing = true;
#endif // __SSE2__
}
int Eltwise_x86::forward(const std::vector<Mat>&... | ALGO | 0.996906 | 6.661181 |
e85ef01f-db2e-403f-940c-e60c18f54e9d | jiwoo0629/Baekjun_Algorithm | algorithm/수학/2580_스도쿠.cpp | #include <iostream>
using namespace std;
int main(void)
{
int sdocu[9][9];
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
cin >> sdocu[i][j];
}
cout << endl;
for (int i = 0; i < 9; i++)
{
int count = 0; //빈칸 개수
int line[9] = { 0, };
int blank[9] = { 0, };
for (int j = 0; j < 9; j++)
{... | ALGO | 0.999862 | 3.203279 |
d095bfcd-da1b-4a6a-bdae-1dac97290583 | Praguni-Sanotra/5th-Sem-Training- | 69_Calculator_Project.cpp | #include <iostream>
#include <map>
#include <functional>
using namespace std;
// Define operation functions
double add(double a, double b) { return a + b; }
double subtract(double a, double b) { return a - b; }
double multiply(double a, double b) { return a * b; }
double divide(double a, double b) { return a / b; }
... | ALGO | 0.869364 | 7.522634 |
58757c73-5d24-4546-8cf6-bb710ece36fe | Nancyisrael/operating-systems-programming-lab-experiments | QUESTION 35.cpp | #include <stdio.h>
#define DISK_SIZE 16
#define BLOCK_SIZE 1024
#define INODE_BLOCKS 8
#define DATA_BLOCKS (DISK_SIZE - INODE_BLOCKS)
int disk[DISK_SIZE];
int nextFreeBlock = INODE_BLOCKS; // Start from the first available data block
// Function to allocate blocks for a file
void allocateBlocks(int startBlock, int n... | ALGO | 0.896394 | 5.220385 |
c689d85d-622b-4c03-bbec-fcc2bd275580 | akudrinsky/algorithms-3sem | 3-contest/c.cpp | /*
Ученые работают на раскопках окаменелых останков древних существ на планете соседней звездной системы. В процессе исследования ученые пытаются понять, как именно цепочки ДНК различных существ составлялись из генов.
Цепочки ДНК всех исследуемых существ представляют собой последовательности нуклеотидов. Каждый нуклео... | ALGO | 0.999914 | 5.972863 |
353471f9-a2ae-4fd7-9dd4-4887b8987d95 | beast-45/Leetcode | 0029-divide-two-integers/0029-divide-two-integers.cpp | class Solution {
public:
int divide(int dividend, int divisor) {
if (dividend == INT_MIN && divisor == -1) return INT_MAX;
long long divi = abs((long long)dividend);
long long add = abs((long long)divisor);
long long count = 0;
while (divi >= add) {
long long d =... | ALGO | 0.999784 | 6.069049 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.