uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
87898fe2-78af-4a7d-b150-f5dc5c2a7fe2 | mtianyan/Mtianyan-Play-with-Algorithm-Interview | 06-Stack-and-Queue/Course Code (C++)/06-Priority-Queue/main_priority_queue_basic.cpp | #include <iostream>
#include <queue>
#include <ctime>
using namespace std;
bool myCmp(int a , int b){
if(a%10 != b%10)
return a%10 > b%10;
return a > b;
}
int main() {
srand(time(NULL));
// 默认的priority queue, 底层是最大堆
priority_queue<int> pq;
for(int i = 0 ; i < 10 ; i ++){
i... | ALGO | 0.992294 | 4.385921 |
bc2f5583-116a-42e6-a1c0-4d67fca9edeb | u-noob-i/contest | Codechef/Starters 47/C.cpp | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <queue>
#include <climits>
using namespace std;
int n, m, i, j;
void solve(int T)
{
string s;
cin >> n >> s;
i = n;
int last = -1... | ALGO | 0.999841 | 4.499448 |
694cb400-e1f0-43f9-b91f-ac4f30ae93a4 | longJ91/Algorithm | Baekjoon/삼성SW역량테스트기출문제/달이 차오른다 가자.cpp | // : https://www.acmicpc.net/problem/1194
// Z sw
// BFS + پ (Ʈũ)
// a~z ˰ Ʈ ũ Ǵµ...
#include <iostream>
#include <string>
#include <queue>
#include <cstring>
using namespace std;
int N, M;
int map[50][50];
int map_state[50][50][1 << 6];
struct MS {
int x, y;
int key;
};
int main() {
memset(map_state, 0, size... | ALGO | 0.999859 | 4.062444 |
bcbedc9a-b3c6-4148-831a-acc8497705ad | nohc2001/AtomCode | armVN-A/tabledata.cpp | #include <iostream>
#include <fstream>
#include <stdio.h>
#include <string.h>
using namespace std;
constexpr char filename[256] = "tabledata_example.txt";
constexpr char outfile[256] = "tableout.txt";
constexpr char instfile[256] = "all_inst.txt";
uint32_t mainInst;
inline bool is1(uint32_t loc)
{
return mainInst ... | TOOL | 0.976202 | 3.411911 |
e92e41e7-db72-4e86-8819-7195e5657609 | rares-gh-pisoi/pbinfo | Clasa 10/meditatie/teme/10.02.2024/oaste2/Oaste2/main.cpp | #include <iostream>
#include <fstream>
#include <climits>
using namespace std;
ifstream fin("oaste2.in");
ofstream fout("oaste2.out");
int a[101][101],n,m,s=0,reg=0;
int dirl[]={-1,1,0,0};
int dirc[]={0,0,1,-1};
void umplere(int x,int y){
s+=a[x][y];
reg++;
a[x][y]=-1;
for(int i=0;i<4;i++){
int ... | ALGO | 0.999924 | 3.425269 |
70e64b2f-5f94-4959-b3a0-f4cd05af4cf2 | jansen-craft/competitive-programming | cses/sorting-and-searching/traffic-lights.cpp | #include <iostream>
#include <set>
//#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
set<int> rd;
multiset<int> dist;
int length, num_lights, tmp, max;
cin >> length >> num_lights;
rd.insert(0);
rd.insert(length);
dist.inse... | ALGO | 0.999457 | 3.170983 |
6d36065c-8327-4bdd-997e-b96c4e733d6d | bioexcel/bioexcel-code-releases | GROMACS/gromacs-2018.3/src/gromacs/linearalgebra/gmx_lapack/slapy2.cpp | #include <cmath>
#include "../gmx_lapack.h"
#include "gromacs/utility/real.h"
float
F77_FUNC(slapy2,SLAPY2)(float * x, float * y)
{
float xabs,yabs;
float w,z;
xabs = std::abs(*x);
yabs = std::abs(*y);
if(xabs>yabs) {
w = xabs;
z = yabs;
} else {
w = yabs;
z = xabs;
}
if( std::abs... | ALGO | 0.999637 | 4.686365 |
b1efc1c6-8288-4793-9da4-cff6782ab86b | marekjm/pjac | src/main.cpp | #include <sys/stat.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <fstream>
#include <algorithm>
using namespace std;
class Exception {
public:
virtual string what() const = 0;
Exception() {}
virtual ~Exception() {}
};
class IOExceptio... | TOOL | 0.861568 | 4.944523 |
becef1ca-ec5d-4aa7-a39a-675963ab8a49 | AkiomaSam/C-TUT | Week 2/electricitybill.cpp | // This program is used to calculate the electrcity bill cost for consumed units
#include<stdio.h>
int main()
{
int a;
float b;
printf("Enter the number of units of electricity used\n");
scanf("%d", &a);
if ( a <= 100 ) b = a*2;
else if ( a <= 250 ) b = a*3.5 ;
else b = a*5;
printf("The cost of the electrici... | ALGO | 0.992903 | 3.969809 |
589f084b-5cb5-423a-9d8b-7751f73afda4 | stefanandonov/OOP2024 | en/ex2/task2.cpp |
//
// Created by Stefan Andonov on 8.3.24.
//
#include<iostream>
using namespace std;
enum POSITION {
EMPLOYEE, //0
MANAGER, //1
OWNER //2
};
class Employee {
private:
char name[50];
double salary;
POSITION position;
public:
//2in1 nescafe
Employee(char *_name = "Stefan", double _sa... | ALGO | 0.983785 | 4.899616 |
976a3854-b2c9-492a-b852-77bcc12da7fd | ProjectBlaze/frameworks_base | tools/aapt/pseudolocalize.cpp | #include "pseudolocalize.h"
using namespace std;
// String basis to generate expansion
static const String16 k_expansion_string = String16("one two three "
"four five six seven eight nine ten eleven twelve thirteen "
"fourteen fiveteen sixteen seventeen nineteen twenty");
// Special unicode characters to ove... | TOOL | 0.958492 | 5.794505 |
af8484be-bc48-4c2c-a5a5-19c0d14c7fa2 | Charaphat/32-bit-Fixed-Point-Neural-Network-for-Microcontroller | lib/nn_esp32/nn_fixed_point.cpp | #include <nn_fixed_point.h>
#include <nn_fixed_point_acitivations.h>
nnFixedPoint::nnFixedPoint() : hiddenNeurons(nullptr), weights(nullptr), outputs(nullptr), biases(nullptr), hiddenLayers(0)
{
this->activation = fixedPointActivation::ReLUFixedPoint;
this->initialize(0, 0, nullptr, 0);
}
nnFixedPoint::~nnFix... | TOOL | 0.885113 | 6.120087 |
975cab34-8f6a-44d0-9072-bd84ac62df91 | tanvieer/ProblemSolving | acm.hust.edu.cn/contest/25.10.2014/The Notebook.cpp | #include<iostream>
using namespace std;
int main()
{
int a,b=0,c=0,i;
while(cin>>a)
{
for(i=2;i<a;i++)
{
if(a%i==0)
{
b=a/i;
c=i;
i=0;
break;
}
}
if(c==0 || b==0)
c... | ALGO | 0.999833 | 3.177205 |
69734cfc-ea59-4f7b-8065-5aff9190addc | manikanta2901/ubuntu | .history/imp/cpp/Algorithm/matrixExponentiation_20200715213829.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 101
int arr[N][N],I[N][N];
void matrixMultiplication(int A[][N],int dim,int order){
int result[dim + 1][dim + 1];
for(int i = 0; i < dim; i++){
for(int j = 0; j < dim; j++){
result[i][j] = 0;
for(int k = 0; k < dim; k++){... | ALGO | 0.999776 | 3.326339 |
57d27f64-27e0-48f1-9b3e-989ada59c3ec | bansal-samarth/Daily-Dose-Of-DSA | 0169-majority-element/0169-majority-element.cpp | class Solution {
public:
int majorityElement(vector<int>& nums) {
int cnt = 1;
int num = nums[0];
for(int i = 1; i < nums.size(); i++) {
if(nums[i] == num) {
cnt++;
}
else if(cnt > 1) {
cnt--;
}
... | ALGO | 0.999902 | 5.82231 |
1f66bf0d-d89d-496e-809b-40e62401c030 | hasankuspinar/maze-generator | hasan.kuspinar_kuspinar_hasan_hw1.cpp | #include <iostream>
#include "Stack.h"
#include <string>
#include <vector>
#include "Randgen.h"
#include <fstream>
using namespace std;
struct Cell
{
int x;
int y;
bool right = 1;
bool left = 1;
bool up = 1;
bool down = 1;
bool visited = 0;
};
bool vector_find(int num, vector<int> & vector1... | ALGO | 0.90213 | 3.758191 |
a42ac972-0095-434d-bee7-02faf54b054d | gutaussehend-Harshal/CPP-and-DSA-practice-questions | .vs/Programiz/tut8.cpp | #include <iostream>
// C++Program to Multiply Two Numbers
int main () {
int cin, cout, product;
std::cout << "Enter the integers: " << std::endl;
std::cin >> cin >> cout;
product = cin * cout;
std::cout << "The multilplication of " << cin << " & " << cout << " is " << product << std::end... | TOOL | 0.990584 | 4.059011 |
2720c5d5-9c0a-4c62-9068-dbbae28dad8d | MDRobiulhassan/Data-Structure-Algorithms | Dynamic Programming/Stock/buyselliiimemoization.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
int stockSum(int i, vector<int> &prices, int buy, int cap,
vector<vector<vector<int> > > &dp)
{
int profit = 0;
if (cap == 0)
return 0;
if (i == prices.size())
return 0;
... | ALGO | 0.999848 | 5.373819 |
c91f0ac3-19a7-47db-9a47-1ee5d067ea32 | manish-tech-git/SdeSheetChallenge | 0 1 Knapsack.cpp | // ************************************************************ Using Memoization ************************************************************************
int solveMem (vector<int> &values, vector<int> &weights, int index, int capacity, vector <vector <int>>& dp )
{
if (index <= 0)
if (weights[0] <= ... | ALGO | 0.999995 | 5.658247 |
96e5d425-610a-4248-b5fd-c18320ca3ed6 | AshutoshBisht/uva-problems | 573_The_Snail.cpp | #include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
#define DEBUG
int main()
{
#ifdef DEBUG
cin.sync_with_stdio(false);
cin.tie(NULL);
ifstream in("input.txt");
ofstream out("output.txt");
auto bkp_in = cin.rdbuf();
auto bkp_out = cout.rdbuf();
cin.rdbuf(in.rdbuf())... | ALGO | 0.999584 | 3.438266 |
076289f6-0f8b-4760-9018-60860bf28e07 | artteam0/OAIP-1-semestr | lab06 (first part) гс/доп/ЛР6 ДОП1/ЛР6 ДОП1/ЛР6 ДОП1.cpp | #include <iostream>
using namespace std;
void main()
{
setlocale(LC_CTYPE, "rus");
float p, q, i;
cout << "Введите первоначальную цену p" << endl;
cin >> p;
cout << "Введите конечную цену q" << endl;
cin >> q;
i = 0;
while (p < q)
{
p = p + p * 0.03;
i = i + 1;
}
cout << "Конечная цена: " << p << endl;
... | ALGO | 0.99944 | 3.365086 |
ac507d5f-74ee-48a1-a10c-f043132a6d0b | madhav-bits/Coding_Practice | leetLLReorderList.cpp | /*
*
//**********************************************************143. Reorder List.***************************************************
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You may not modify the values in the list's nodes, only nodes itself may be changed.
Example 1:
... | ALGO | 0.999962 | 5.899206 |
998fedf8-322c-4b13-92aa-b258ae5c6206 | bartosz-kowalski/metody-numeryczne | Nelder-Mead/CPP/simpleks.cpp | #include "simpleks.hpp"
#define ALPHA 1.1
#define BETA 0.4
#define GAMMA 2.05
#define DELTA 0.3
#define EPSILON 0.0000001
#define MAX_I 1000
class simplex{
private:
const int dim; //number of dimensions
const int dim_sim;
double** sim; // the simplex itself
public:
simplex();
... | ALGO | 0.999987 | 4.888525 |
39f59bc9-8592-41c0-82f3-590247586758 | miguelAlessandro/CompetitiveProgramming | Codechef/trainDAG/spoj/HEAPULM.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxN = 1e5 + 10;
string s[maxN];
pair<string, int> label[maxN];
int st[maxN<<2];
int n;
void build(int nx=1, int l=0, int r=n-1) {
if (l == r) {
st[nx] = r;
return;
}
int mid = (l+r)/2;
build(nx<<1, l, mid);
build(nx<<1|1, mid+1, r);
if (label[st[nx<<1... | ALGO | 0.999001 | 4.07692 |
769ac541-ef81-4d4d-988c-8ba7eb4e21fb | sanyamss99/CSES | 1622 - Creating Strings.cpp | #include<bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define p7 1000000007
#define p9 998244353
#define pb push_back
#define ff first
#define ss ... | ALGO | 0.999955 | 5.038694 |
e30a6a13-7144-4892-ad21-d222d823cdd0 | surajthakur2004/CPP-Code | reversearray.cpp | #include<iostream>
using namespace std;
/*
int main()
{
int array[10]={1,2,3,4,5,9,10,34,43,55};
for(int i=9;i>=0;i-- )
{
cout <<array[i]<<" ";
}
cout<<endl;
cout<<array[0];
}
*/
/*
int main()
{
int arr[5]={1,2,3,4,5};
int length= sizeof(arr)/sizeof(int);
for (int i=0; i... | ALGO | 0.997302 | 3.551459 |
ac0d6faf-2417-44c1-923c-97114a5b5b57 | shreyans00/DSA | Algozenith/Prefix Sum/11.5.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int mod = 1e9 + 7;
void solve()
{
int n, q, k;
cin >> n >> q >> k;
int a[n + 1], b[n + 1];
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
while (q--)
{
int A, l, r;
cin >> A >> l >> r;
// arr... | ALGO | 0.999732 | 4.158777 |
a34acd11-c390-4493-9a17-694c0fa4812b | weidongz/Rubbish_Code | NowCoderExercises/Nowcoder-Week2/Assignment2.cpp | /*
给定一颗二叉树,分别实现按层和 ZigZag 打印二叉树。
ZigZag遍历: 意思是第一层从左到右遍历,第二层从右到左遍历,依次类推。
*/
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
struct TreeNode{
/*TreeNode * lch, * rch;
TreeNode(TreeNode* Curlch, TreeNode* Currch){
lch = Curlch;
rch = Currch;
}*/
... | ALGO | 0.999963 | 4.160896 |
4ebe534a-12a7-47f8-8de5-86bd4f89fa14 | Pavitragandhi/leetcodesolutions | 2490-circular-sentence/2490-circular-sentence.cpp | class Solution {
public:
bool isCircularSentence(string sentence) {
istringstream s(sentence);
string read;
vector<string> store;
while(s >> read){
store.push_back(read);
}
int n = store.size();
int m = store[n-1].size();
... | ALGO | 0.999765 | 6.1871 |
92c43b8f-2e82-4cab-8b8f-3de72d96bd8c | MaheshSharan/LeetCode_Automation | solutions/0800-0899/0828.Count Unique Characters of All Substrings of a Given String/Solution.cpp | class Solution {
public:
int uniqueLetterString(string s) {
vector<vector<int>> d(26, {-1});
for (int i = 0; i < s.size(); ++i) {
d[s[i] - 'A'].push_back(i);
}
int ans = 0;
for (auto& v : d) {
v.push_back(s.size());
for (int i = 1; i < v.si... | ALGO | 0.999987 | 6.32804 |
08ddb265-b47f-49bb-a2de-8aa9acdefb89 | KushPulkit/FOCP_2_lab | Practice Assignment 1/ques16.cpp | //Q16. WAP that determines whether two ints are opposite in sign using XOR
#include<iostream>
using namespace std;
int main(){
int a,b;
cout<<"Enter two numbers: ";
cin>>a>>b;
if((a^b)<0)
cout<<"Opposite signs";
else
cout<<"Same Sign";
return 0;
}
| ALGO | 0.998955 | 3.60895 |
5c9ca224-71e4-4d64-afe3-2c0f22a480d8 | Forhad-islam/CodeForce-Problem-Solving-by-C- | Hulk.cpp | #include<iostream>
using namespace std;
int main()
{
int a;
cin>>a;
for(int i=1;i<a;i++)
{
if(i%2 != 0)
cout<<"I hate that ";
if(i%2==0)
cout<<"I love that ";
}
if(a%2!=0)
cout<<"I hate it";
if(a%2==0)
cout<<"I love it";
}
| ALGO | 0.99998 | 3.311054 |
0bb8cbe8-7a61-4577-ac04-8b8d60e0aabc | raincross7/code-similarity | codes/train_code/problem137/problem137_244.cpp | #include <iostream>
using namespace std;
int main(){
string s;
while(cin>>s){
if(s == "0")break;
int sm = 0;
for(int i = 0; s.size( ) > i; i++){
sm += s[i]-'0';
}
cout << sm << endl;
}
}
| ALGO | 0.999344 | 3.903318 |
73139ec6-b7f6-4a93-9259-68c9752b0c1b | pri1712/codefoces | 1946C.cpp |
#pragma GCC optimize("-O2")
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <map>
#define ci(n) cin>>n
#define co(n) cout<<n
#define nl '\n'
#define LLMAX LLONG_MAX
#define r0 return 0
#define rall(x) (x).rbegin(), (x).rend()
#define all(x) (x).begin(), (x).e... | ALGO | 0.999569 | 3.930166 |
6cecd71f-4bb6-449f-b452-28b8312de2b6 | marble-develop/leaf_frameworks_av | media/module/codecs/amrnb/dec/src/dec_lag6.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/dec_lag6.c
Functions: Dec_lag6
Date: 01/31/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description:
(1) Updated to accept new parameter... | ALGO | 0.999371 | 6.893827 |
5333a2fb-e484-42c1-83f2-5501bac77ce2 | ishandutta2007/codeforces | penguinhacker/normal/605/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN=1000;
int n;
double p[mxN][mxN], dp[mxN], ev[mxN], rem[mxN];
bool vis[mxN];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for (int i=0; i<n; ++i)
for (int j=0; j<n; ++j) {
int x;
cin >> x;
p... | ALGO | 0.999892 | 3.371846 |
a03589d5-1674-4e24-b220-cf59e910e88a | SciAps/android-frameworks-base | media/libstagefright/codecs/amrnb/dec/src/d8_31pf.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/d8_31pf.c
Functions:
Date: 01/28/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Modified to pass overflow flag through to basi... | ALGO | 0.999536 | 5.077264 |
4c8eef58-0d48-4755-b4e2-fbf5b10a3613 | 42magarine/advent_of_code | day04/part2/main.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstring>
#include <cerrno>
#define RESET "\033[0m"
#define RED "\033[31m"
#define YELLOW "\033[33m"
#define WORD "MAS"
int find_X(const std::vector<std::vector<char>>& grid, int row, int col) {
int rows = grid.size();
in... | ALGO | 0.995462 | 6.091857 |
65964be5-0aa2-47b4-aafd-86458fd687ec | ishandutta2007/codeforces | anandoza/normal/1672/B.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
// template {{{
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define f first
#define s second
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define trav(a, x) for (auto... | ALGO | 0.999917 | 6.044299 |
0aaa7e29-df4e-4abe-888a-ca0350394a2d | therajsoren/codeforces-solutions | 900/Even Odds.cpp |
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll = long long;
void solve() {
ll n, k; cin >> n >> k;
ll middle = (n + 1) / 2;
if (k <= middle) {
cout << 2 * k - 1 ;
} else {
k = k - middle;
cout << 2 * k;
}
}
int main() {
ios_base::sync_with_st... | ALGO | 0.999517 | 4.178272 |
7abd6e59-64c4-4485-9a93-136aa18f10e7 | Ansh1693/contests | codeforces/E_Sakurako_Kosuke_and_the_Permutation.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define nL "\n"
#define pb push_back
#define mk make_pair
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define forEqual(i, a, b) for (int i = a; i <= b; i++)
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rloop(i, a... | ALGO | 0.999604 | 4.276587 |
247673b5-4640-40cf-81ad-9a499af7ff23 | morris821028/UVa | volume119/11930 - Rectangles.cpp | #include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
using namespace std;
#define eps 1e-6
struct Pt {
float x, y;
bool operator<(const Pt &a) const {
if(a.x != x)
return x < a.x;
return y < a.y;
}
};
struct Seg {
Pt s, t;
};
float c... | ALGO | 0.999911 | 3.736337 |
778614fd-650e-4b97-bad8-6114c1e6e3e5 | Kamal-Bhagchandani/GeeksforGeeks | GfG - 160/016.Anagram.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
/*
Question Link: https://www.geeksforgeeks.org/batch/gfg-160-problems/track/string-gfg-160/problem/anagram-1587115620
*/
class Solution {
public:
// Function is to check whether two strings are anagram of each other or ... | ALGO | 0.999672 | 6.298766 |
d2b08809-928a-46c5-bb41-a9dac08beb4e | ChayanMallick13/DSA-LOVE-BABBAR | LECTURE - 138/Max_1_Area_rec.cpp | // https://leetcode.com/problems/maximal-rectangle/description/
class Solution {
void banao(vector<int> & arr,vector<int> & next,vector<int> & pre){
stack<int> s,st;
int n = arr.size();
(n,0);
(n,0);
s.push(n);
st.push(-1);
for(int i = n-1;i>=0;i--){
... | ALGO | 0.999966 | 6.36804 |
7592599a-be14-41b3-ba29-18f916327cfb | MinboyKim/BojAlgorithmStudy | 22_November/20/1436_KangManJoo.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int num;
int cnt = 0;
int i = 0;
cin >> num;
while (1) {
i++;
string s = to_string(i);
if (s.find("666")!=string::npos) {
cnt++;
};
if (cnt == num) {
break;
}
}
cout<<i;
return 0;
} | ALGO | 0.997395 | 3.544953 |
f8d2afe1-b2f9-4ff1-9b22-8b937059470b | RazRus8/ITMO-CPP-Tasks | Lesson14/ControlTasks/ControlTask1/Program.cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <math.h>
#include <vector>
#include <typeinfo>
using namespace std;
template<class T>
T average_of_array(T arr[], int length)
{
T sum = 0;
if (typeid(T) == typeid(char))
{
int _sum = 0;
for (int i = 0; i < length; i++)
{
... | TOOL | 0.982133 | 3.762959 |
2f3a7042-d388-4c95-8d11-a32072a4a861 | bagel/FunWithAlgorithms | divide/pow.cpp | #include <iostream>
using namespace std;
double quickMul(double x, int n) {
if (n == 0) {
return 1;
}
double y = quickMul(x , n / 2);
return n % 2 == 0 ? y * y : y * y * x;
}
double myPow(double x, int n) {
return n > 0 ? quickMul(x, n) : 1 / quickMul(x, -n);
}
int main() {
cout << "... | ALGO | 0.999772 | 5.957881 |
912d2f7b-2ec8-417d-92fb-49df140d376f | hfinkel/llvm-project-cxxjit | libcxx/test/std/containers/sequences/vector/vector.cons/construct_size_value.pass.cpp | // <vector>
// vector(size_type n, const value_type& x);
#include <vector>
#include <cassert>
#include "test_macros.h"
#include "test_allocator.h"
#include "min_allocator.h"
#include "asan_testing.h"
template <class C>
void
test(typename C::size_type n, const typename C::value_type& x)
{
C c(n, x);
LIBCPP_A... | TEST | 0.931358 | 6.664313 |
5e6c9b88-1df8-4710-bf86-09dbc3444a1f | brijeshagal/Competitive-Programming | CodeForces/1374B.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void solve(long long int n)
{
if(n == 1){
cout << "0\n";
return;
}
long long int ctr = 0;
while(n > 0){
if(n%2 != 0){
n*=2;
ctr++;
... | ALGO | 0.999776 | 4.120026 |
869d72d1-b043-4443-a444-311d2041118b | wxMEdit/wxMEdit | src/xm/mad_encdet.cpp | #include "mad_encdet.h"
#ifdef _DEBUG
#include <crtdbg.h>
#define new new(_NORMAL_BLOCK ,__FILE__, __LINE__)
#endif
bool IsBinaryData(const ubyte* data, size_t len)
{
size_t i = 0;
ubyte b;
while(i < len)
{
b = data[i];
if(b == 0)
return true;
i++;
}
return false;
}
xm::EncodingID DetectChineseEncodin... | TOOL | 0.961258 | 4.694659 |
ac9b8104-bc8f-413b-a9b6-b80d63997830 | IvanDe83/C-Gustokashin | 10.5.cpp | // Дана строка, содержащая пробелы. Найдите, сколько в ней слов (слово – это последовательность непробельных символов, слова разделены одним пробелом,
// первый и последний символ строки – не пробел).
#include <iostream>
using namespace std;
int main() {
bool flag = false;
int cnt = 0;
string s;
... | ALGO | 0.999177 | 4.384724 |
f668e176-5fc6-424f-9eaa-08a26fbef649 | SeismicSystems/seismic-solidity | libsolidity/formal/Invariants.cpp | #include <libsolidity/formal/Invariants.h>
#include <libsolidity/formal/ExpressionFormatter.h>
#include <libsolidity/formal/SMTEncoder.h>
#include <libsolutil/Algorithms.h>
#include <boost/algorithm/string.hpp>
using boost::algorithm::starts_with;
using namespace solidity;
using namespace solidity::smtutil;
using n... | ALGO | 0.994537 | 7.382157 |
e0119dbc-efef-405f-b488-2c9c52444deb | pranavsindura/CompetitiveProgramming | codeforces/C/141c.cpp | #include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | ALGO | 0.99977 | 3.889842 |
2147a337-c031-4eda-afc9-84e59ed50026 | mostafa-talat72/leetcode-solutions | 1656-count-good-triplets/1656-count-good-triplets.cpp | class Solution {
public:
int countGoodTriplets(vector<int>& arr, int a, int b, int c) {
int ans = 0;
for (int i = 0;i < arr.size();i++) {
for (int j = i + 1;j < arr.size();j++) {
if (abs(arr[i] - arr[j]) > a)continue;
for (int k = j + 1;k < arr.size();k++) {
if (abs(arr[j] - arr[k]) > b || abs(arr[i] ... | ALGO | 0.999726 | 5.733649 |
69a50e6e-8545-48bc-91cc-d636cf18fd2d | zjuxlh1993/leetcode | solveNQueens.cpp | class Solution {
public:
void dfs(int deep)
{
if (deep==m){
ret.push_back(q);
return;
}
for (int i=0;i!=m;i++){
if (query(deep,i)){
cover(deep,i);
q[deep][i]='Q';
dfs(deep+1);
q[deep][i]='... | ALGO | 0.999843 | 5.31979 |
3f87fb57-f181-46bc-918e-2e335234dba2 | codeplaysoftware/sycl-for-cuda | llvm/lib/CodeGen/LiveIntervals.cpp | #include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/... | TOOL | 0.982188 | 7.222578 |
bd1ec715-e0ed-4d3e-bd0e-38bfa47fe6a3 | irori-gthb/atcoder | abc1xx/abc188/abc188_d.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int main() {
int N;
ll C;
cin >> N >> C;
map<int, ll> s, e;
set<ll> st;
ll a, b, c;
rep(i, N) {
cin >> a >> b >> c;
st.insert(a);
st.insert(b + 1);
st.insert(c);
s[a] += ... | ALGO | 0.999966 | 3.882264 |
018090e2-2775-4a0a-ac5a-f9e36f1a95fe | jtonyortiz/competitive-programming | DS_Review/Recursion/BinaryRec.cpp | //Author: James Ortiz
//File: BinaryRec.cpp
//Description: An example of binary recursion by calculating
//the binary sum in C++
//Compile: g++ -std=c++11 -Wall BinaryRec.cpp -o BinRec
//
#include <vector>
#include <iostream>
using namespace std;
//
//Input: An array A and integers i and n
//Output: The sum of the n ... | ALGO | 0.999953 | 6.369423 |
8819c170-759b-45ce-af7d-61eab841c036 | liqiangnlp/Tree | src/main.cpp | #include <algorithm>
#include <string>
#include <iostream>
#include "tree.h"
using namespace std;
int main( int, char ** )
{
Tree<string> tr;
Tree<string>::preOrderIterator top, one, two, loc, banana;
top=tr.begin();
one=tr.insert(top, "one");
two=tr.appendChild(one, "two");
tr.appendChild(two, "apple");
bana... | ALGO | 0.996917 | 4.015855 |
361ae3e2-cea2-4e39-95a6-3d4707321857 | pwiez/assignmentsIFPR | joguinhos_C++/robo_labirinto/PedroWiezelRobo.cpp | #include "biblaureano.h"
void mostraInfoePreparaTerreno()
{
mudaCor(WHITE);
gotoXY(1, 10);
cout << " Bem vindo ao jogo do Labirinto!" << endl;
cout << "\n Para jogar, desenhe o labirinto. 'Q' liga o desenhador, e 'W' desliga." << endl;
cout << " Quando estiver pronto, aperte 'R', ";
c... | ALGO | 0.918898 | 3.141868 |
5869ac89-9086-4e21-99ec-8ef501f2bfe0 | Orange-pipi/Homework | 第四次试验/二分查找.cpp | /*************************************************
** : һʮ
** : tsingke
** : 2020-10-27 / 21:12
** Ȩ : <EMAIL>
** (Ȩ) : Orange-pipi
/**************************************************/
#include <iostream>
#include <cstdlib>
#include <windows.h>
#include <cmath>
using namespace std;
/*-----------------------------... | ALGO | 0.996799 | 4.031148 |
f1679ea6-bf6f-43e0-925b-e880491ec94a | OpenHUTB/engine_bak | Engine/Source/ThirdParty/PhysX3/APEX_1.4/shared/general/HACD/src/dgAABBPolygonSoup.cpp | /****************************************************************************
*
* File Name : Bitmap.C
* Visual C++ 4.0 base by Julio Jerez
*
****************************************************************************/
#include "dgHeap.h"
#include "dgStack.h"
#include "dgList.h"
#include "dgMatrix.h"
#include "dgPo... | ALGO | 0.999778 | 5.020588 |
7cf0d8e6-7b01-499f-8fda-7752ec4d2fe0 | tavo-wasd-gh/heateq | src/cpp/main.cpp | #include <iostream>
#include "heatmap.hpp"
int main()
{
int steps = 400; /* Iteraciones */
double dt = 0.01; /* dt por iteración */
/* Para una placa de hierro (c = 22.8x10^-6 m^s/s) de 40x60 cm,
* Grilla de 50 x 75 nodos, cada uno de longitud 8x10^-3 m */
Heatmap hierro(50, 75, 22.8e-6, 8e-3);
/* Punto calie... | ALGO | 0.991979 | 5.287695 |
3cacf917-0364-4f38-8797-d9af8d8a01a3 | jeffxtang/eigen | bench/sparse_dense_product.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
//g++ -O3 -g0 -DNDEBUG sparse_product.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.05 -DSIZE=2000 && ./a.out
// -DNOGMM -DNOMTL -DCSPARSE
// -I /home/gael/Coding/LinearAlgebr... | ALGO | 0.998788 | 4.386344 |
d4d304a3-15d9-4558-8206-85a1ff82a465 | Kaiponbusters/atcoderanswers | mathalgorithm/009DP.cpp | #include <bits/stdc++.h>
using namespace std;
// clang-format off
/* accelration */
// 高速バイナリ生成
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
// cin cout の結びつけ解除, stdioと同期しない(入出力非同期化)
// cとstdの入出力を混在させるとバグるので注意
struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false... | ALGO | 0.99999 | 4.92326 |
7a7bbc4a-ebe4-4332-82c6-0ae224f3a5b8 | JanDuwe/MediMinder | Arduino/libraries/MediMinder_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/reduce_common.cpp | #include "edge-impulse-sdk/tensorflow/lite/c/builtin_op_data.h"
#include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/quantization_util.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/integer_ops/mean.h"
#include "edge-impulse-sdk/ten... | ALGO | 0.987074 | 7.387085 |
dd7c6c3a-de0b-4c0d-91b0-8e04a9a8bed0 | jwseph/competitive-programming | cses/1716.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9+7;
struct Mod {
int n;
vector<ll> fac, inv;
Mod(int n): n(n), fac(n+1), inv(n+1) {
fac[0] = 1;
for (int i = 1; i <= n; ++i) fac[i] = fac[i-1] * i % mod;
inv[n] = exp(fac[n], mod-2);
for (... | ALGO | 0.999988 | 5.378718 |
8cc147b5-c204-4ad9-8df2-b58d39f1d3ba | dranxer/LeetCode-Solns | next-greater-element-i/Accepted/8-8-2024, 7_28_42 AM/Solution.cpp | // https://leetcode.com/problems/next-greater-element-i
class Solution {
public:
vector<int> nextGreaterElement(vector<int>& nums1, vector<int>& nums2) {
stack<int>st;
map<int,int>mp;
for(int i=0;i<nums2.size();i++){
mp[nums2[i]]=i;
}
vector<int>nge(nums2.size... | ALGO | 0.999937 | 5.952352 |
accf044c-b918-4238-911b-dd5f5b1c8944 | fucan/hackshield | 3rd/include/cat/src/math/rtl/addsub/Add1.cpp | #include <cat/math/BigRTL.hpp>
using namespace cat;
u8 CAT_FASTCALL BigRTL::Add(int legs_a, const Leg *in_a, int legs_b, const Leg *in_b, Leg *out)
{
#if !defined(CAT_NO_LEGPAIR)
// Add first two legs without a carry-in
LegPair sum = (LegPair)in_a[0] + in_b[0];
out[0] = (Leg)sum;
// Add remaining leg... | ALGO | 0.998359 | 5.610324 |
e7da5326-d72c-44e9-87ec-ce4073b8cb4f | cuclaoliu/OpenCVTutorial | OCR/segmentOcrHigh.cpp | #include <opencv2/opencv.hpp>
#include <tesseract/baseapi.h>
#include <vector>
#include <fstream>
using namespace std;
using namespace cv;
Mat binarize(Mat input)
{
//Uses otsu to threshold the input image
Mat binaryImage;
cvtColor(input, input, CV_BGR2GRAY);
threshold(input, binaryImage, 0, 255, THRESH_OTSU);... | DATA | 0.974276 | 5.928523 |
96eaf484-9c13-4652-8ab3-085086ab25f5 | yabirgb/Estructuras-de-Datos | prct3/src/StackMaxQueue.cpp | #include <cassert>
using namespace std;
// Throws exception if isEmpty()
template <class T>
T StackMax<T>::peak () {
assert (!isEmpty());
return cola.peak()->data;
}
template <class T>
void StackMax<T>::push (T data) {
pair newPair;
newPair->data = data;
if (isEmpty()) {
newPair->max = data;
} else {
... | ALGO | 0.931913 | 5.574596 |
22031a29-7577-47da-8a15-cc735cd55bca | DeadE1ephant/My-project- | Library/PackageCache/com.unity.ide.visualstudio@2.0.22/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include <fcntl.h>
#include <io.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call m... | TOOL | 0.947374 | 6.926379 |
773f413a-065a-4d36-a52a-01e4a5e942da | jwleesnu/ws_livox | src/mp2p_icp/3rdparty/libnabo/examples/usage.cpp | // This example is in the public domain
#include "nabo/nabo.h"
#include <iostream>
int main()
{
using namespace Nabo;
using namespace Eigen;
using namespace std;
// 100 points in 3D
MatrixXf M = MatrixXf::Random(3, 100);
// 50 query points
MatrixXf q = MatrixXf::Random(3, 50);
// Create a kd-tree for M, n... | ALGO | 0.999771 | 7.387105 |
978aecb9-3dab-49ea-a9b6-3f1849450d42 | VietDQ11/Assignment | bai7.cpp | #include<iostream>
using namespace std;
float Plus(float a, float b)
{
return a + b;
}
float Minus(float a, float b)
{
return a - b;
}
float multipty(float a, float b)
{
return a * b;
}
float divide(float a, float b)
{
return a / b;
}
void operation(float a, float b, float (*p2Func)(float, float))
{
cout << p2F... | TOOL | 0.967558 | 3.523733 |
93b8738c-531f-4148-8df3-f6ac5e251617 | liaolushen/sicily | 1100/1176/main.cpp | #include <iostream>
#include <string>
using namespace std;
int a[1001];
int adj[1001][1001];
const int INFINITE = 1000000;
int getCard(int forePtr, int afterPtr) {
if ((afterPtr - forePtr) <= 1) {
return (a[forePtr] >= a[afterPtr]) ?
(a[forePtr]- a[afterPtr]) : (a[afterPtr] - a[forePtr]);
} else if (adj[forePt... | ALGO | 0.999105 | 3.958716 |
adeb4ef3-e37d-4903-a099-b4bb9d3748db | naman-gemini/SPOJ | AMR10G.cpp | #include<stdio.h>
#include<algorithm>
using namespace std;
/*void swap(int *a, int *b)
{
int t=*a; *a=*b; *b=t;
}
void sort(int arr[], int beg, int end)
{
if (end > beg + 1)
{
int piv = arr[beg], l = beg + 1, r = end;
while (l < r)
{
if (arr[l] <= piv)
l++;
else
swap(&arr[... | ALGO | 0.999941 | 3.359789 |
b17662d9-c27d-4357-8561-897fd46a7693 | ishandutta2007/codeforces | tanphatls987/normal/617/E.cpp | #include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define INPUT freopen("340.inp","r",stdin)
#define OUTPUT freopen("340.out","w",stdout)
#define FOR(i,l,r) for(auto i=(l);i<=(r);i++)
#define REP(i,l,r) for(auto i=(l);i<(r);i++)
#define FORD(i,l,r) for(auto i=(l);i>=(r);i--)
#define REPD(... | ALGO | 0.999983 | 3.591086 |
7dc7e6fa-c6d0-4296-a126-a5f2d492754f | seulseul44/oss2025 | 250524/세 수의 중간값/median-of-three-numbers.cpp | #include <iostream>
using namespace std;
int main() {
int A,B,C;
cin>>A>>B>>C;
if(B>A&&B<C){
cout<<1;
}
else{
cout<<0;
}
return 0;
} | ALGO | 0.999961 | 4.063291 |
e4381d80-ee2d-4dce-8e59-8718144bef50 | simb4/kbtu_pp1_2018 | pp1/week3/reverse.cpp | #include <iostream>
using namespace std;
int main() {
/*
array - ordered list of objects (for example integers)
Problem: read n, and n elements of an array, and output them in reverse order
*/
/*
INCCORECT EXAMPLE:
int n;
int a[n];
cin >> n;
*/
int n;
cin >> n;
int a[n];
fo... | ALGO | 0.998344 | 5.019265 |
f2c62b71-0341-474e-84ae-4ad1e3e95db3 | BeaPastor98/FlutterBLoC | bloc_example/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.998743 | 6.76775 |
39ee7190-9374-448d-9ab3-396835e6959e | bsarvan/code_algorithms | BinarySearchTree.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left, *right;
TreeNode(int v):val(v), left(nullptr), right(nullptr) {}
};
TreeNode *BuildTree(vector<int> input, int &offset) {
if (offset == input.size()) return nullptr;... | ALGO | 0.999964 | 5.563538 |
410868a3-0a5c-49b4-9756-7115b08c2282 | yoosofan/slide | cpp/src/op/side_triangle/side24.cpp | // Error
#include <iostream>
#include <cmath>
using namespace std;
class complexCls{ double r,i;
public:
complexCls(int m=0,int n=0)
{r=m;i=n;}
void Show(void)
{cout<<r<<"+ i "<<i<<endl;}
double Magnitude(void)
{return sqrt(r*r+i*i);}
void input(void){
cout<<"Enter real:"; cin>>r;
cout<<"Enter i... | TOOL | 0.875639 | 3.888529 |
917e1d11-4ac7-4eca-a505-a969ecf8779b | MapleSystem/secure-c | llvm/utils/TableGen/InstrDocsEmitter.cpp | #include "CodeGenDAGPatterns.h"
#include "CodeGenInstruction.h"
#include "CodeGenTarget.h"
#include "TableGenBackends.h"
#include "llvm/TableGen/Record.h"
#include <string>
#include <vector>
using namespace llvm;
namespace llvm {
void writeTitle(StringRef Str, raw_ostream &OS, char Kind = '-') {
OS << std::string(... | TOOL | 0.865564 | 7.493601 |
dedda7c7-73ea-4be0-a841-a592434d7616 | zv-proger/ol_programms | acmp/0957.cpp | /*
: (<EMAIL>)
0957 acmp.ru
*/
#include<bits/stdc++.h>
using namespace std;
int dt[1 << 6][1 << 6], last = 0;
void step(int lx, int ly, int rx, int ry, int x, int y) {
if (lx == rx - 1) return;
int mx = (lx + rx) / 2, my = (ly + ry) / 2;
int cur = ++last;
if (x < mx) { dt[mx][my] = dt[... | ALGO | 0.9997 | 3.130458 |
bc9053a2-ed6a-4b4f-9461-e3aa1b05823b | plamenko/altruct | src/algorithm/math/bits.cpp | #include "altruct/algorithm/math/bits.h"
#include <cmath>
#include <stdint.h>
namespace altruct {
namespace math {
/**
* Base-2 Logarithm.
*/
namespace {
int8_t _tbl_ilog2_16_full[1 << 16];
int8_t _tbl_ilog2_16[16] = {
0, 7, 1, 13, 8, 10, 2, 14, 6, 12, 9, 5, 11, 4, 3, 15 };
int8_t _tbl_ilog2_32[32] = {
0, ... | ALGO | 0.997591 | 6.875166 |
75be067d-af43-4bdf-a7c7-9886c5c9f4cb | Ayush8165/leetcode_solutions | 40. Combination Sum II/solution.cpp | #include <bits/stdc++.h>
using namespace std;
void findCombi(int index, int target, vector<int> &arr, vector<vector<int>> &ans, vector<int> &ds)
{
if (target == 0)
{
ans.push_back(ds);
return;
}
for (int i = index; i < arr.size(); i++)
{
if (i > index && arr[i] == arr[i - 1... | ALGO | 0.999995 | 5.3618 |
9d456ba7-da32-452d-9604-2e0b710955cb | aminul01-g/CPP | Operating_System_Algorithms/optml_page.cpp | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
// Function to check if a page is in the frame
bool search(int key, const vector<int>& fr) {
for (int val : fr)
if (val == key)
return true;
return false;
}
// Function to predict the frame to replace
int predict... | ALGO | 0.999844 | 6.971615 |
626e05be-f8d5-4dc7-a16c-48fd5923f17c | jayhusemi/opencv_contrib | modules/aruco/samples/detect_markers.cpp | #include <opencv2/highgui.hpp>
#include <opencv2/aruco.hpp>
#include <iostream>
#include "aruco_samples_utility.hpp"
using namespace std;
using namespace cv;
namespace {
const char* about = "Basic marker detection";
//! [aruco_detect_markers_keys]
const char* keys =
"{d | | dictionary: DICT_4X4... | TOOL | 0.985249 | 6.726289 |
7d3e015f-5c2d-4467-8231-8f0ef39239f1 | jtrosty/School-Work | dsa/graph/kruskal.cpp | #define MAXNUMVERTICES 10
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <climits>
using namespace std;
class Graph
{
private:
int theGraph[MAXNUMVERTICES][MAXNUMVERTICES] = {INT_MAX};
set<int> vertices;
public:
void insertEdge(int from, int to, int ... | ALGO | 0.999986 | 4.669253 |
2bd9b968-dd6c-45a9-b09b-57e523d53c4e | grftwhre/14.10.18 | 1programm(primeorcomposite).cpp | #include <iostream>
#include <locale.h>
#include <stdio.h>
using namespace std;
int main() //определить простое число или составное
{
int n,r,i;
i=1;
printf("Enter x\n");
scanf("%d", &n);
if (n==1)
printf("prime");
else
r=n%i;
do{
i++;
r=n%i;
}while (r!=0);
if (i==n)
printf("%d - prime", n);
... | ALGO | 0.999812 | 3.670713 |
98961c28-55b8-4474-8ad9-ec999c6a07cc | ishandutta2007/codeforces | penguinhacker/normal/717/C.cpp | #include <bits/stdc++.h>
using namespace std;
#define sz(v) int(v.size())
#define ar array
typedef long long ll;
const int N = 2e5+10, MOD = 1e4+7;
void solve() {
int n; cin >> n;
vector<int> a(n); for (auto& x : a) cin >> x;
auto b = a;
sort(a.begin(), a.end());
sort(b.rbegin(), b.rend());
ll... | ALGO | 0.999969 | 4.435909 |
a8ed4e94-cc2b-4f70-a379-badf9ec04879 | CoderSubrota/dsa | tree/search-binary-tree/assignment/sortedByStr.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
// Custom comparator function to sort by name, and by age if names are the same
bool compare(pair<string, int>& a, pair<string, int>& b) {
if (a.first == b.first) {
return a.second > b.second; // Sort by age i... | ALGO | 0.997643 | 6.291879 |
2f651143-b232-4256-ab5c-3017795bce94 | akashb2003/dsa_in_cpp | basic_linkedList.cpp | #include <stdio.h>
#include<stdlib.h>
struct node
{
int data; struct node * next;
}
displayLink(struct node * ptr)
{
while(ptr!=NULL)
{
printf("%d\n",ptr->data);
ptr = ptr->next;
}
}
int main()
{
struct node* head = (struct node*)malloc(sizeof(struct node));
struct node* first... | ALGO | 0.965534 | 3.884542 |
64f8f4aa-9d26-43d2-9ee7-ab20e7a0d035 | shajayb/Alice2022_UoC | src/ZSPACE/depends/Eigen_Unsupported/doc/examples/MatrixPower_optimal.cpp | #include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
using namespace Eigen;
int main()
{
Matrix4cd A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(A);
std::cout << "The matrix A is:\n" << A << "\n\n"
"A^3.1 is:\n" << Apow(3.1) << "\n\n"
"A^3.3 is:\n" << Apow(3.3) << "\n\n"
... | ALGO | 0.998442 | 3.396939 |
e48609e8-38eb-4b14-a771-2375e8ced796 | yipu3/algorithm-practice | MDJ/j.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <bitset>
#define INF 1000000005
#define eps 1e-10
#define PI acos(-1.0)
#define K (0.017453292519... | ALGO | 0.999968 | 3.969603 |
d20fd894-c071-4364-b804-1bf9cf59ffa2 | onasheep/c_algorithm | Day10/Day10_032.cpp | // 32. ּڰ ϱ
#include<iostream>
#include<vector>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, K;
cin >> N >> K;
vector<int> A(N);
for (int i = 0; i < N; i++)
{
cin >> A[i];
}
int count = 0;
for (int i = N - 1; i >= 0; i--)
{
if (A[i] <= K) /... | ALGO | 0.999912 | 3.565175 |
f359a0c6-b730-4bf2-99a1-c3a7716d359a | Weber0323/ITSA9 | ITSA9/ITSA9.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main() {
int n = 0;
int ans = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
if (i % 3 == 0) { ans += i; }
}
cout << ans << '\n';
return 0;
} | ALGO | 0.999921 | 3.855285 |
f6631f60-5702-4d73-87c1-10d0b11b94a0 | adriaant/CALM-API | calmlib/Module/Feedback.cpp | #include "CALMGlobal.h"
#include "Feedback.h"
#include "Connection.h"
// Initialize the basic members of a module
// Derived classes need to call this function before doing own Initialization routine
void Feedback::Initialize( int moduleSize, char* moduleName, data_type* pars, int mtype, int idx )
{
Module::Initializ... | ALGO | 0.988737 | 4.506234 |
954bc061-f2b2-4a5c-b3fa-cc3d221c2e5b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_10536_10.cpp | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long MAX = 2e6 + 7;
const long long dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const long long dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
long long i, j, k, t, n, q, l, r, mid;
string s;
long long up, dn, rt, lt, ud, rl;
void solve() {
cin... | ALGO | 0.999918 | 5.336749 |
201913a2-8bb5-4264-8579-5b9057ae1cec | jasveen18/CP-krle-placement-lag-jayegi | 450 DSA Questions/15 Bit Manipulation/4TwoDistinctElements.cpp | vector<int> singleNumber(vector<int>& nums)
{
int res1 = 0, res2 = 0, xo = 0;
int n = nums.size();
for (int i = 0; i < n; i++) {
xo ^= nums[i];
}
// This is the first distinct bit that the 2 unique numbers have.
int firstDifferentBit = (xo & (~(xo - 1)));
for (int i = 0; i < n; i++... | ALGO | 0.999857 | 5.115838 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.