uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
1c2fb3ce-9fb6-4127-b973-3b4b07851293 | qavishaikh/C-Tasks | lab 3 task4.cpp | #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
char a;
cin>>a;
if ( (a=='a'|| a=='e'|| a=='i'||a=='o'||a=='u') ||
(a=='A'||a=='E'||a=='I'||a=='O'||a=='U') )
cout<<a<<"\t It IS A wovel";
else
cout<<a<<"\t It IS constanat";
getch();
return 0;
}
| ALGO | 0.997415 | 3.320631 |
fa8b5896-90d7-48de-ade9-744c5fbceac8 | YGYtl/PAT_Advanced_Level | 1048 Find Coins (25分).cpp | #include<bits/stdc++.h>
using namespace std;
vector<int> v;
int n, m;
map<int,int> mp;
int main()
{
bool flag = true;
scanf("%d %d", &n, &m);
v.resize(n);
for(int i=0; i<n; i++){
scanf("%d", &v[i]);
mp[v[i]]++;
}
sort(v.begin(),v.end());
for(int i=0; i<v.size(); i++){
int t = m-v[i];
if(t==v[i]&&mp[t]>=2... | ALGO | 1 | 3.560654 |
6b0168e8-5f98-42ff-ae55-7b94d77441ae | keirond/problems | dsa/data_structures/darray/darray_2d.cpp | #include <bits/stdc++.h>
using namespace std;
struct DiffArr {
int n, m;
vector<vector<long long>> diff, nums;
DiffArr(vector<vector<long long>> &nums) {
n = nums.size();
m = n == 0 ? 0 : nums[0].size();
diff.assign(n + 1, vector<long long>(m + 1, 0));
this->nums.resize(n);
for (int i = 0; i < n; ++i) ... | ALGO | 0.99994 | 3.661863 |
c7cfe929-ae9d-4453-8dcc-1260650dfd8a | tejasnasa/dsa-practice | C++/patterns/pattern01.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
cout << "* ";
}
cout << "\n";
}
return 0;
} | ALGO | 0.999854 | 3.615922 |
9c37a54b-115c-4176-a707-52134ebaec8d | yoonmgyg/lc | Problems/Design Neighbor Sum Service.cpp | class neighborSum {
public:
vector<vector<int>> grid;
int n;
neighborSum(vector<vector<int>>& gird) {
grid = gird;
n = grid.size();
}
int adjacentSum(int value) {
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (grid[i][j] ... | ALGO | 0.999728 | 5.433609 |
3ac66dc0-c79c-488d-8936-54d0ec5acc9a | omsaini-1441/RoadDSA | BookAllocation.cpp | /* You need to allocate all the books to "m" students such that the <b>maximum no. of pages assigned to a student is minimum.</b> */
#include<vector>
using namespace std;
/* check if ele at mid is the solution? i.e minimum, alot mid amount of books to each student and move on, if no. of students exceed given n ,then t... | ALGO | 0.999991 | 5.636308 |
2b35f013-b9d1-403a-89ca-a3e526c31e4b | miffyKing/acmicpc_git | 프로그래머스/3/258709. 주사위 고르기/주사위 고르기.cpp |
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int targetDiceNum;
vector<vector<int>> realDice;
vector<int> DiceListA;
vector<int> DiceListB;
int maxWinNum;
vector<int> winA;
void makeList(vector<int> DL,bool isA, int deep, int Num) //주사위 조합 구하기
{
if (deep==DL.size())
{
... | ALGO | 0.999736 | 5.246723 |
a98ce903-08c9-4081-b015-ac893dff3cb2 | khadija1114/Algorithm | Techniques/gcd sum function.cpp | #include<bits/stdc++.h>
#define mp make_pair
#define ff first
#define ss second
#define bg begin()
#define en end()
#define pb push_back
#define w(x) scanf("%d",&x);while(x--)
#define ws(x) scanf("%d",&x);getchar();while(x--)
#define rep(i,b) for(i=0;i<=b;i++)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.ti... | ALGO | 0.999875 | 3.748642 |
ed4aa97e-e2ed-46fc-81dc-95a5b44a4cdd | knallbob/SoftwareDefinedCPUModes_Beleg | ModeSwitchMode/gem5/src/systemc/tests/systemc/examples/updown/updown.cpp | #include "systemc.h"
#include "specialized_signals/scx_signal_int.h"
#include "specialized_signals/scx_signal_signed.h"
#include "specialized_signals/scx_signal_uint.h"
#include "specialized_signals/scx_signal_unsigned.h"
SC_MODULE(up_down)
{
sc_in_clk clk;
sc_in<sc_uint<1> > up;
sc_in<sc_ui... | TOOL | 0.983404 | 4.01985 |
16699558-b15b-4828-b0fa-3ea66271dce8 | Ponamarev/Infa_2021_Ponamarev | Term_2/Lesson_7/Task_c.cpp | #include <iostream>
#include <iomanip>
#include <cmath>
void print(double number) {
if (int(number) == number) {
std::cout << std::fixed << std::setprecision(1) << number;
}
else if (int(number * 10) == 10 * (number)) {
std::cout << std::fixed << std::setprecision(1) << number;
}
e... | ALGO | 0.999802 | 3.779595 |
da87adf3-3cb9-4af7-a68d-68b88612c809 | Amitkumar-007/face_recognition | opencv-master/samples/cpp/laplace.cpp | #include "opencv2/videoio.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <ctype.h>
#include <stdio.h>
#include <iostream>
using namespace cv;
using namespace std;
static void help(char** argv)
{
cout <<
"\nThis program demonstrates Laplace point/edge detection using OpenC... | ALGO | 0.973665 | 6.16252 |
bf7f2651-4149-4890-ad73-0eb17b5380ae | shakilahamedriaz/STL---Standard-Template-Library- | Playlist-wrong submission/L - 02 Vector - 1/10.1 delete range wise use erase().cpp | //erase() use for delete any data/element.
#include<bits/stdc++.h>
using namespace std;
int main(){
vector<int>v;
v.push_back(1);
v.push_back(2);
v.push_back(3);
v.push_back(4);
v.push_back(5);
cout<< "The elements of the vector : ";
for(int i=0; i<v.size(); i++){
cout<<v[i]<< " ";
}
v.erase(v.begin()+2,v.en... | ALGO | 0.989048 | 4.236716 |
b3994673-771f-46c8-bb19-69ebb7523c8b | ishandutta2007/codeforces | farhod_farmon/normal/114/B.cpp | #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <iomanip>
#define lli long long int
#define sc scanf
#define pr printf
#define pb push_back
#defi... | ALGO | 0.999988 | 3.504253 |
df7cbc8a-61bc-470f-8e6f-bdd20fd0cae9 | ImtiazAhmedAkash/Problem-Solving | codechef/FIGBOT.cpp | /* In the Name of ALLAH, the most gracious, the most merciful */
// FIGBOT - FightBots
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define nl '\n'
#define deb(x) cerr << #x << " = " << x << nl
const int inf = 1e9;
const ll INF = 1e18;
const int mod = 998244353;
const int N = 2e5 + 5;
void ... | ALGO | 0.999983 | 5.336327 |
2e18dd86-9702-41f8-9484-46f27a3f25b9 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0331/travel/travel.cpp | #include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<bitset>
#define LL long long
#define mp(x,y) make_pair(x,y)
using namespace std;
inline int read()
{
int f=1,x=0;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=ge... | ALGO | 0.999992 | 3.712791 |
2a982a50-3e54-4698-b050-e411eb4941b1 | Rino-Saputra/kumpulan-sc-buku-cpp-bahasa-indonesia | c++. lanjutan oleh sianipar/part3/program14.1.cpp | #include<iostream>
using namespace std;
#include <set>
#include <iterator>
const int n = 8,m = 5;
int main()
{
char ch [m] = {'A', 'D', 'E', 'C', 'B'};
int AR1[n] = { 65, 72, 67, 69, 71, 68, 66, 70 };
set<int> Set1( AR1, AR1+7); //set dikonstruksi dengan sebuah array
set<char> Set3(ch, ch+5); //set di... | TOOL | 0.937762 | 3.478914 |
12e03f12-2568-4918-8b61-d248a3d0c8bf | MihaiMalos/TemeLFC | Lab2/main.cpp | #include <fstream>
#include <iostream>
#include "Grammar.h"
#include "FiniteAutomaton.h"
void Menu(Grammar& grammar)
{
int type;
FiniteAutomaton automaton;
automaton.CreateAutomaton(grammar);
std::cout
<< "---------------------------------------\n"
<< "| Menu |\n"
... | TOOL | 0.910683 | 5.588766 |
a5f3e505-82e4-4cd8-bcfc-8f8a70fc8ce6 | VatsBhatt11/45DaysChallengeDSA-Sheet | Stacks And Queues/Sliding Window Maximum.cpp | class Solution {
public:
vector<int> maxSlidingWindow(vector<int>& nums, int k) {
vector<int>ans;
deque<int>dq;
for(int i=0;i<nums.size();i++)
{
if(!dq.empty() && dq.front()==i-k)
dq.pop_front();
while(!dq.empty() && nums[dq.back()]<nums[i])
... | ALGO | 0.999972 | 6.205822 |
fff02f2d-b512-483c-b6a6-61e81c4c0e0d | marsupialtail/logcloud | vendored/LogCrisp_compression_var/util.cpp | #include"util.h"
#include<cstdlib>
#include<cstdio>
#include<ctype.h>
#include<iostream>
#include<cctype>
using namespace std;
// int Myreadline(FILE* in, int& readSize, int& nowSize, long totSize, char *buffer){
// readSize = 0;
// int badChar = 0;
// while(nowSize++ < totSize){
// char temp;
// ... | ALGO | 0.864461 | 3.048938 |
18a70256-6337-4773-bc57-40256c21b8e8 | GHrui/OI | Leetcode/1.cpp | /**
* Two Sum
* O(n ^ 2) = O((n-1) * (n-2) / 2)
*/
#include<iostream>
int main (void) {
int array[] = {2, 7, 11, 15};
int target = 9;
int length = sizeof(array) / sizeof(array[0]);
for (int i = 0; i < length; ++i) {
for (int j = i + 1; j < length; ++j) {
if (array[i] + array[j] =... | ALGO | 0.99809 | 5.47574 |
8022df8b-3b7f-4380-ba14-55fb56ed2d8c | zhujzhuo/MariaDB-source-code | storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp | #include "ndbd_malloc_impl.hpp"
#include <ndb_global.h>
#include <EventLogger.hpp>
#ifndef UNIT_TEST
extern EventLogger g_eventLogger;
#else
extern EventLogger g_eventLogger;
#endif
static int f_method_idx = 0;
#ifdef NDBD_MALLOC_METHOD_SBRK
static const char * f_method = "SMsm";
#else
static const char * f_method = ... | TOOL | 0.897271 | 4.817842 |
4a19237b-da01-45a1-b898-1f23cc143999 | BooRar/Blackbird | seasocks-async/src/main/c/sha1/sha1.cpp | // DO NOT REFORMAT <- for tidy
#include "sha1.h"
/*
* SHA1
*
* Description:
* This is the constructor for the sha1 class.
*
* Parameters:
* None.
*
* Returns:
* Nothing.
*
* Comments:
*
*/
SHA1::SHA1()
{
Reset();
}
/*
* ~SHA1
*
* Description:
* This is the destruc... | ALGO | 0.921086 | 6.912439 |
a1a4c248-062f-4a75-92ec-826a3ac8b592 | hzding621/algorithms | leetcode/cpp/263_ugly_number.cpp | #include <iostream>
using namespace std;
class Solution {
public:
bool isUgly(int num) {
if (num <= 0)
return false;
while (num % 2 == 0) {
num /= 2;
}
while (num % 3 == 0) {
num /= 3;
}
while (num % 5 == 0) {
num /= 5... | ALGO | 0.999649 | 5.179563 |
79d6360c-3f3d-4dc1-803a-8fab269ccdc4 | SanchitAgrawal2405/MCA | WEEK5/frequency of a number.cpp | #include <iostream>
using namespace std;
int main(){
int a[20],n,x,i,count=0;
cout<<"Enter the size of the array:"<<endl;
cin>>n;
cout<<"Enter the elements"<<endl;
for(i=0;i<n;i++)
cin>>a[i];
cout<<"enter to check its frequency:"<<endl;
cin>>x;
for(i=0;i<n;i++)
if(a[i]==x)
count++;
cout<<"frequency of "<<x<... | ALGO | 0.999841 | 3.525943 |
24ac934f-e262-484f-a99b-3ed352985e47 | PrincAgrawal/Leetcode_Questions | 0075-sort-colors/0075-sort-colors.cpp | class Solution {
public:
void sortColors(vector<int>& nums) {
int l=0;
int m=0;
int h=nums.size()-1;
while(m<=h){
if(nums[m]==0){
swap(nums[l],nums[m]);
l++,m++;
}
else if(nums[m]==1)
m++;
... | ALGO | 0.999951 | 6.072276 |
1e4353db-a70a-4fe0-b5e5-ef6e9941ef7b | danieltrt/SBFL | TransCoder-main/data/evaluation/geeks_for_geeks_successful_test_scripts/cpp/RECURSIVE_PROGRAM_PRIME_NUMBER.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
bool f_gold ( int n, int i = 2 ) {
if ( n <= 2 ) return ( n == 2 ) ? true : false;
if ( n % i == 0 ) return false;
if ( i * i > n ) return true;
return f... | ALGO | 0.997893 | 5.523375 |
bb1cab71-378e-4468-8142-3694052729e1 | CZY774/learn-cpp | 3_array.cpp | #include <iostream>
#include <string>
int main() {
// // ARRAY 1D
// int arr[5];
// arr[0] = 10;
// arr[1] = 20;
// arr[2] = 30;
// arr[3] = 40;
// arr[4] = 50;
// std::cout << "Nilai array: " << std::endl;
// for(int i = 0; i < 5; i++) {
// std::cout << arr[i] << " ";
/... | ALGO | 0.959512 | 4.25013 |
860f216c-d000-4849-9a1e-c00de7554d65 | LucaIT523/C_OpenCV_BCC_Recompile | OpenCV470_BCC/modules/dnn/src/layers/nary_eltwise_layers.cpp | #include "../precomp.hpp"
#include "layers_common.hpp"
#include "../op_cuda.hpp"
#include "../op_cann.hpp"
#include "../ie_ngraph.hpp"
#include <opencv2/dnn/shape_utils.hpp>
#include <algorithm>
#include <iterator>
#include <numeric>
#ifdef HAVE_CUDA
#include "../cuda4dnn/primitives/eltwise.hpp"
using namespace cv::... | ALGO | 0.939499 | 3.650608 |
85a09060-05ca-4deb-998c-458ae097649e | python4004/Problem-sovling | Recursive Digit Sum.cpp | #include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int super_digit(const string &n,int k)
{
long long intial_sum=0;
if (n.length() == 1)
{
return stoi(n);
}
else
{
for (char c:n)
{
intial_sum+=c-48;
}
long long mid... | ALGO | 0.999883 | 4.575066 |
b15941ee-7728-47ab-a275-a095f4ab2fe3 | vikasjha2003/Daily-Practice | C++/Arrays1D/rollno.cpp | #include<iostream>
using namespace std;
int main () {
int n;
cin>>n;
int marks [n];
for ( int i = 0; i<n; i++) {
cin>>marks[i];
}
cout<<"The roll no. of failed students: ";
for (int i = 0; i<n; i++ ) {
if (marks[i] <= 35) {
cout<<i<<"\t";
}
}
} | ALGO | 0.999559 | 3.009368 |
95165840-a898-420d-ade6-1bdef80864d7 | sarvex/solution-cpp | 0386.lexicographical_numbers.cpp | #include <vector>
using std::vector;
class Solution {
public:
vector<int> lexicalOrder(int n) {
vector<int> ans;
int v = 1;
for (int i = 0; i < n; ++i) {
ans.push_back(v);
if (v * 10 <= n)
v *= 10;
else {
while (v % 10 == 9 or v + 1 > n) v /= 10;
++v;
}
... | ALGO | 0.999886 | 6.635085 |
80a2446c-fa7b-44d8-93f2-1bd9992bca6e | mealsOrder/SW | barkingDog/0x0B_recursion/01780_paperCnt.cpp | #include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
const int MX = 2200;
int arr[MX][MX];
int cnt[3]; // -1 0 1
// x~x+n, y~y+n 가 같은지 확인
bool check(int x,int y,int n){
for(int i=x;i<x+n;i++){
for(int j=y;j<y+n;j++){
// 하나라도 다르면 false
if(ar... | ALGO | 0.999818 | 4.154103 |
1422b8c3-b4a1-49d8-94c2-1bc3b2cd21db | chewjiaseng/lab8album | 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.99887 | 6.783439 |
98a788db-ecde-4b28-b2f5-8d2fee0532ed | emanuel2700/TyJorgeTyAudante | Training_camp_2024/TC Arg 2024 - Competencia 4 -- Avanzado/L_Magic_Spheres.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
#define pb push_back
#define pf push_front
#define debug(x) cout << #x << " = " << x << endl
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int a, b, c, ... | ALGO | 0.99996 | 3.728234 |
ff4b9df7-6c96-424c-a591-d3a511178f81 | KIMDAHYUN98/Algorithm | C++/배열/반대로 출력.cpp | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
int n, i;
int a[1000];
scanf("%d", &n);
for (i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
for (i = n - 1; i >= 0; i--)
{
printf("%d ", a[i]);
}
return 0;
}
| ALGO | 0.999802 | 3.482647 |
ad4311e7-0256-4e99-b915-d267dfb48b1b | CodeWithIsmail/Competitive-Programming | CodeChef/Maximise_Adjacent_Sum.cpp | /// *** --- || In the name of ALLAH ||| --- *** ///
/// *** --- || Author: Code_with_Ismail ||| --- *** ///
#include <bits/stdc++.h>
using namespace std;
// Data Type:
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typede... | ALGO | 0.999908 | 4.370037 |
8a622294-1d7f-402b-8af6-9a847632f53a | sungzh/leetcode | LeetCode/662. Maximum Width of Binary Tree.cpp | /*
* Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all levels. The binary tree has the same structure as a full binary tree, but some nodes are null.
*
* The width of one level is defined as the length between the end-nodes (the leftm... | ALGO | 0.999985 | 6.840157 |
649b3ac2-6314-48ab-8f0c-9202da101369 | DEBAJITSAMANTA7/SDE_SHEET_STRIVER | Problems on Arrays/find_repeatating_1st_two_no.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void Repeat(int arr[], int n)
{
int arr2[n];
int k = 0;
for (int i = 0; i < n; i++)
{
int count = 0;
for (int j = 0; j < n; j++)
{
if (arr[i] == arr[j])
{
count++;
}
}
if (count == 1)
... | ALGO | 0.999829 | 3.831929 |
e2a821c3-751c-487e-80f4-c5c0334a77c8 | gautam2003kumar/cp | graph/directedGraph/cycle.cpp | #include<bits/stdc++.h>
using namespace std;
void solve(){
int n, m;
cin >> n >> m;
vector<vector<int>> edges(n);
for(int i = 0; i < m; i++){
int a, b; cin >> a >> b;
a--; b--;
edges[a].push_back(b);
}
vector<bool> vis(n), inStack(n);
bool cycleExist = false;
... | ALGO | 0.999992 | 4.884789 |
e7571c5a-f5a7-44f9-b6ef-11acf220f04c | ShishirShekhar/DSA | CharArray/binaryToString.cpp | #include <iostream>
#include <string>
using namespace std;
int binaryToDecimal(string s)
{
// your code goes here
int ans = 0;
int power = 0;
for (int i = s.length() - 1; i >= 0; i--)
{
ans += (s[i] - '0') * pow(2, power);
power++;
}
return ans;
} | ALGO | 0.999744 | 5.008818 |
a9de07c9-07f2-47e4-83ba-5a1c96adf017 | m4oughi/100DaysofCode | pureCPP/0004. Day 4/Array/Array Library CPP-Style/007. Comparison Operators/010. Lexicographical Comparison with String Arrays/main.cpp | #include <iostream>
#include <array>
int main() {
std::array<std::string, 3> arr1 = {"apple", "banana", "cherry"};
std::array<std::string, 3> arr2 = {"apple", "banana", "date"};
if (arr1 < arr2) {
std::cout << "arr1 is lexicographically less than arr2." << std::endl; // Output: arr1 is lexicograp... | TOOL | 0.982565 | 4.662507 |
e2a5b644-4957-455c-b6c5-7ad2564cedca | SanthoshiBoyina/DataStructures-Algorithms | list-operations/solution.cpp | #include <bits/stdc++.h>
using namespace std;
void display(vector<int> &arr) {
for(int i=0; i<arr.size(); i++) {
cout << arr[i] << " ";
}
cout << "\n";
}
void append(vector<int> &arr, int x) {
arr.push_back(x);
}
int countOfX(vector<int> &arr, int key) {
int count = 0;
for(int i=0; i<... | ALGO | 0.999713 | 4.735425 |
0f9c08a4-c761-4865-9027-a48fa035bef9 | Hiroaki-Tanaka-0606/BayesStatistics | calcPostDistribution/PostDistribution_oneLorentz_histogram.cpp | #define _USE_MATH_DEFINES
#include <iostream>
#include <string.h>
#include <cmath>
using namespace std;
//calculate posterior distribution function (model: one Lorentz) from histogram data
int main(int argc, char** argv){
if(argc<2){
printf("Usage: %s configuration_file\n",argv[0]);
return 0;
}
cout << "# Post... | DATA | 0.999515 | 4.792139 |
f6ff381c-5e1f-4007-a9da-00ae700288b3 | lalit-03/os-lab | LAB 6/main1.cpp | #include <bits/stdc++.h>
using namespace std;
//struct defining input of process data
struct process {
int pid;
int at;
int bt;
int prt;
};
//struct defining result of each algorithm
struct ScheduleResult {
float avgWt;
vector<int> ProcessOrder;
string S_type;
};
//comparator for fcfs
boo... | ALGO | 0.999987 | 4.039271 |
1c6bc36a-5a09-4f99-bc19-a4577b69ec7e | KY2001/atcoder-all-my-submissions | future-contest-2021-qual/future_contest_2021_qual_a_1604753412.cpp | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++) // [0, b)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) // [a, b)
#define rep3(i, a, b) for (int i = (int)(a); i >= (int)(b); i--) // reversed [b, a] so [a, a-1, a-2, ..., b]
#defin... | ALGO | 0.999888 | 4.328969 |
d23468a4-a070-47df-8ee1-b8aeb0301f01 | EnotBog/cppl_homeworks_11_move | move_z01/Source.cpp | #include <windows.h>
#include <locale.h>
#include <vector>
#include <iostream>
template <typename T>
void move_vector(std::vector<T>& left, std::vector<T>& right)
{
right = std::move(left);
}
int main()
{
setlocale(LC_ALL, "Russian");
system("chcp 1251");
std::vector <std::string> one = { "test_string1",... | TOOL | 0.888344 | 3.713414 |
bd2d3dd8-c6bd-4a39-bec3-990918328d6e | Harshit-Kotecha/Leetcode | 563-binary-tree-tilt/563-binary-tree-tilt.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.999958 | 6.576862 |
4aa2a03a-18a1-4b92-96d9-3c4dd8449775 | puffin444/optical_flow_prediction | tools/compute_image_mean.cpp | #include <glog/logging.h>
#include <leveldb/db.h>
#include <lmdb.h>
#include <stdint.h>
#include <algorithm>
#include <string>
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/io.hpp"
using caffe::Datum;
using caffe::BlobProto;
using std::string;
using std::max;
int main(int argc, char** argv) {
::google::I... | DATA | 0.86319 | 6.323054 |
63e70dfc-9a5f-414e-9b03-f296a69d8fa5 | sarvex/leetcode-q-sharp | solution/0200-0299/0225.Implement Stack using Queues/Solution.cpp | class MyStack {
public:
MyStack() {
}
void push(int x) {
q2.push(x);
while (!q1.empty()) {
q2.push(q1.front());
q1.pop();
}
swap(q1, q2);
}
int pop() {
int x = q1.front();
q1.pop();
return x;
}
in... | ALGO | 0.999801 | 5.707532 |
bc3a1b4a-3580-4399-b8b8-1878e49faaee | BhuvaneshAdithya45/ada | daa_/visualizesubset.cpp | #include <iostream>
#include <vector>
#include <stack>
#include <iomanip>
using namespace std;
struct State {
int index;
int currentSum;
vector<int> subset;
int depth; // Added to manage indentation for tree structure
};
void printBox(const string& title, const string& content, int depth) {
int ... | ALGO | 0.999893 | 5.879667 |
d098f6b0-12e5-4ded-bc6d-cc17460d1826 | avhi1231/Avhinandan_Se1 | assignment/Module 4/C++ Assignment/maxfrndFun.cpp | #include<iostream>
using namespace std;
class A{
private:
int a,b;
public:
show()
{
cout<<"Enter 1st Number :";
cin>>a;
cout<<"Enter 2nd Number :";
cin>>b;
}
friend max(A t);
};
max(A t)
{
if(t.a>t.b)
{
cout<<"\n1st Number is Greastest ";
}
else
{
cout<<"\n2nd Numb... | ALGO | 0.967522 | 3.682026 |
f15996e5-6532-4f39-bf1c-3f580543f999 | Ayusohm432/Coding | ProblemOfTheDay/Leetcode/17.09.2024_884. Uncommon Words from Two Sentences.cpp | /*
Problem Link : https://leetcode.com/problems/uncommon-words-from-two-sentences/?envType=daily-question&envId=2024-09-17
*/
/*884. Uncommon Words from Two Sentences
A sentence is a string of single-space separated words where each word consists only of lowercase letters.
A word is uncommon if it appears exactly on... | ALGO | 0.999768 | 6.326554 |
cce95b72-20eb-4ee7-b505-593ca0824388 | arm/arm-toolchain | libc/src/math/generic/exp2m1f.cpp | #include "src/math/exp2m1f.h"
#include "src/__support/FPUtil/FEnvImpl.h"
#include "src/__support/FPUtil/FPBits.h"
#include "src/__support/FPUtil/PolyEval.h"
#include "src/__support/FPUtil/except_value_utils.h"
#include "src/__support/FPUtil/multiply_add.h"
#include "src/__support/FPUtil/rounding_mode.h"
#include "src/_... | ALGO | 0.872859 | 5.635189 |
1cd99363-bfe7-435e-9ba4-83e5ec3e133f | soorjya/DSA-Snippets | time_stock.cpp | #include<bits/stdc++.h>
using namespace std;
int maxprofit(int price[],int n){
int buy = price[0];
int max_profit = 0;
for (int i=1;i<n;i++) {
if(buy>price[i])
buy = price[i];
else if(price[i]-buy > max_profit)
max_profit = price[i] - buy;
}
return max_profit;
}
int mai... | ALGO | 0.998784 | 5.181587 |
b559b269-b514-467f-b39b-c9d91eb16fec | hibiki333155555/atcoder_memo | src/zenntansaku/abc150b.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int N;
cin >> N;
string S;
cin >> S;
int count = 0;
for(int i = 0; i < N - 2; i++) {
// str.substr(開始位置, 取り出す長さ);
if(S.substr(i, 3) == "ABC") count++;
//if(S[i] == 'A' && S[i + 1] == 'B' && S[i + 2]... | ALGO | 0.999504 | 5.288919 |
6c632a7b-64b1-495b-8831-9433760581bf | ANCHAL628/Leetcode-Google | 213-house-robber-ii/213-house-robber-ii.cpp | class Solution {
public:
int rob(vector<int>& nums){
//diamond notes just start with 0 or 1 index.
int n=nums.size();
if(n==1)return nums[0];
if(n==2)return max(nums[0],nums[1]);
int dp[101];
dp[0]=nums[0];
dp[1]=max(nums[0],nums[1]);
for(int i=2;i<n-1;i++)
{
dp[i]=max(dp[i-1],nums[i]+dp[i-2]);
}
int dp1[101];
... | ALGO | 0.999928 | 5.630402 |
ec7ae92f-6f7b-480e-9fe2-242b65158756 | Siddharth292004/C-Primer-Solutions- | basics/program_34.cpp | // Check whether a number is positive, negative or zero :
// -----------------------------------------------------------
// Input a number : 8
// The entered number is positive.
#include <iostream>
using namespace std;
int main()
{
int num;
cout << "Check whether a number is positive,negative or zero :\n... | ALGO | 0.997728 | 4.230263 |
d3a9d7b4-383b-44e2-b4f6-fe25b67d570b | tangs/leetcode_problems | src/198/1.cpp | #include <vector>
using namespace std;
class Solution {
public:
int rob(vector<int>& nums) {
int len = nums.size();
if (!len) return 0;
int prev = 0, cur = nums[0];
for (int i = 1; i < len; ++i) {
int tmp = max(prev + nums[i], cur);
prev = cur;
c... | ALGO | 0.999755 | 5.640484 |
de17a10c-401b-4a87-9e89-440a3b664188 | djshaji/neural-amp-modeler-lv2 | deps/NeuralAmpModelerCore/Dependencies/eigen/bench/sparse_cholesky.cpp | // #define EIGEN_TAUCS_SUPPORT
// #define EIGEN_CHOLMOD_SUPPORT
#include <iostream>
#include <Eigen/Sparse>
// g++ -DSIZE=10000 -DDENSITY=0.001 sparse_cholesky.cpp -I.. -DDENSEMATRI -O3 -g0 -DNDEBUG -DNBTRIES=1 -I /home/gael/Coding/LinearAlgebra/taucs_full/src/ -I/home/gael/Coding/LinearAlgebra/taucs_full/build/lin... | ALGO | 0.996148 | 4.173108 |
a823ec97-0d34-4971-9ba1-ec8cd93b4f37 | RahulChobdar/Cipher_Schools | Day1/ques2.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int a;
double avg=0;
for(int i=0;i<5;i++){
cout<<"Enter grade "<<i+1<<":";
cin>>a;
avg+= a/5.0;
}
cout<<"The average grade is:"<<avg;
return 0;
}
| ALGO | 0.950752 | 3.533308 |
ecdb39a6-7156-4271-a07e-94f535c3ca56 | raincross7/code-similarity | codes/train_code/problem054/problem054_368.cpp | #include <bits/stdc++.h>
using namespace std;
typedef vector< vector<int> > vvi;
typedef vector< vector<bool> > vvb;
typedef vector< vector<char> > vvc;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef long long ll;
int main(){
int a,b;
cin >> a >> b;
int m,n;
m=a*100/... | ALGO | 0.999179 | 3.202479 |
18d44ba4-edc4-4403-9854-7aa2ff5686e9 | Nanduposina/cpp | reverse_digit.cpp | #include<iostream>
using namespace std;
void print_reverse(int n)
{
int rev=0;
int last_digit;
while(n>0)
{
last_digit=n%10;//stores remainder
n=n/10;//stores value after division
rev=(rev*10)+last_digit;
}
cout<<"reverse of a number given is:"<<rev;
}
int main()
{
in... | ALGO | 0.999484 | 3.525926 |
09825618-9c3a-4c39-9200-ed51109fec21 | ThLentzas/leetcode | 13/main.cpp | #include <iostream>
#include <unordered_map>
/*
* Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
For ex... | ALGO | 0.999466 | 7.147182 |
90bfb2c2-25e0-4102-9358-0a8a9fb71eb7 | frc2053/2015code | FODRobot2015/src/Vision2015/Contour.cpp | #include "Contour.h"
#include "utils.h"
/* Draw a single contour to the given matrix. */
void drawContour(Contour *contour, Mat *img)
{
vector<Contour> contours(0);
contours.push_back(*contour);
Scalar color = Scalar( 200, 200, 100);
drawContours(*img, contours, 0, color, 2);
}
/* contourDrawList... | TOOL | 0.953399 | 5.571591 |
4ad9564e-1998-4802-86f8-d466d98c3114 | iamlvv/leetcode_solving | leetcode_linked_list_cycle.cpp | #include <iostream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
//Passed
//Runtime: 3 ms, faster than 99.95% of C++ online submissions for Linked List Cycle.
//Memory Usage: 8 MB, less than 57.28% of C++ online submissions for Linked List Cycle.
struct ... | ALGO | 0.999949 | 5.184466 |
44cfa3b6-606b-463c-9ae7-c14ade89a229 | lintang-b-s/leetcode | 0746-min-cost-climbing-stairs/0746-min-cost-climbing-stairs.cpp | /*
dpi = min(dp[i-1] + dp[i-2]) + cost[i]
basecase:
dp[0] = cost[0], dp[1] = cost[1]
testcase:
input :[1,100,1,1,1,100,1,1,100,1]
table: 1 100 2 3 3 103 4 5 104 6
*/
class Solution {
public:
int minCostClimbingStairs(vector<int>& cost) {
int n = cost.size();
int dp[1001];
dp[0]... | ALGO | 0.999918 | 5.35264 |
e6956f92-f233-4764-9264-a1ae22dab9de | raincross7/code-similarity | codes/train_code/problem487/problem487_301.cpp | #include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
ll N = 3;
vector<ll>A(N);
rep(i,N){
cin >> A[i];
}
sort(A.begin(),A.end(),greater<ll>());
cout << A[0]*10 + A[1] + A[2];
} | ALGO | 0.99982 | 4.156813 |
fe518afd-dd5d-4982-aaa2-fe2e938c67a8 | lydrainbowcat/tedukuri | 配套光盘/例题/0x20 搜索/0x25 广度优先搜索/Bloxorz I/POJ3322(3).cpp | //Author:XuHt
#include <queue>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
struct P {
int x, y, z;
} st, ed;
const int N = 506;
char s[N][N];
int n, m, d[N][N][3];
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};
int nx[3][4] = {{0,0,-2,1},{0,0,-1,1},{0,0,-1,2}};
int ny[3][4] = {{-2,... | ALGO | 0.999604 | 4.002388 |
307b4cdf-84ba-4d29-805d-5148e7c03da6 | PiusLim373/leetcode_and_hackerrank | leetcode/interview150/206_reverse_linked_list.cpp | #include <vector>
#include <iostream>
class ListNode
{
public:
int val;
ListNode* next;
ListNode() : val(0), next(nullptr) {};
ListNode(int num, ListNode* next) : val(num), next(next) {};
ListNode(int num)
{
this->val = num;
this->next = nullptr;
}
};
ListNode* buildList(std::vector<int> nums)
{
... | ALGO | 0.999893 | 5.883553 |
ab4d85c0-34c6-4892-9141-42054ba962e3 | Muztahid-2020331021/Algorithms | Algorithms/Binary_Search.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
void BinarySearch_with_Array(ll to_find, ll n, vector<ll> &v);
ll LowerBound(ll element, ll n, vector<ll> &v);
ll UpperBound(ll element, ll n, vector<ll> &v);
int main()
{
int n;
cin>>n;
int i;
vector<ll> v;
for(i=0;i<n;i++){
... | ALGO | 0.999966 | 5.187126 |
08367741-b210-40d2-98a3-e12aa2bd1f7f | fanache99/Competitive-Programming-Library | problems/Kattis/generalchineseremainder/main.cpp | // https://open.kattis.com/problems/generalchineseremainder
#include "bits/stdc++.h"
#include "math/modular.h"
using Mod = VarModular<DynamicModuloPolicy<uint64_t>>;
int main() {
int tests;
std::cin >> tests;
for (int test = 1; test <= tests; test++) {
long long a1, n1, a2, n2;
std::cin >... | ALGO | 0.999559 | 5.305588 |
9f4444d9-ff94-4c1a-afd4-bb4f06ab4558 | sizeofuniverse/Cpp-learning | 自增和自减.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
int main()
{
int a = 0;
int i = 1;
//a=i
//i=i+1
a = i++;
cout << "a=" << a << endl;//1
cout << "i=" << i << endl;//2
int b = 0;
int j = 1;
//j=j+1
//b=j
b = ++j;
cout << "b=" << b << endl;//2
cout << "j=" << j << endl;//2
} | TOOL | 0.988262 | 3.275194 |
30b12415-407c-4f4b-a9ec-be8758163a2b | samridhrana06/C- | Binary tree/vertical_width.cpp | #include<bits/stdc++.h>
using namespace std;
unordered_set<int>st;
int verticalWidth(Node *root){
st.clear();
Width(root,hd);
return st.size();
}
void Width(Node *root, int hd){
if(root != null){
Width(root->left,hd-1);
st.insert(hd);
Width(root->right,hd+1);
}
}
int main(){
// fill the tree
Nod... | ALGO | 0.999901 | 5.411927 |
80c3877f-9482-4b97-9231-9605aa0dec1e | bego-net/Computer-Graphics | Computer Graphics/ASTU geda gate/main.cpp | #include <GL/glut.h>
#include <cmath>
#define PI 3.14159265358979323846
#include <GL/glut.h>
#include <cmath>
#define PI 3.14159265358979323846
// Function to draw a semi-circle with adjustable width
void drawSemiCircle(float cx, float cy, float outerRadius, float thickness) {
const int numSegments = 100; // Numbe... | TOOL | 0.968826 | 4.475872 |
1a422943-3ff8-497e-84af-91320ae8ce4c | hjq562004191/NYOJ | 奋斗的小蜗牛.cpp | #include <stdio.h>
int main(){
int n;
scanf("%d",&n);
while(n--){
long h;
long day = 0;
scanf("%ld",&h);
while(1){
if(h>10){
h-=5;
day++;
}
if(h<=10){
day++;
break;
}
}
printf("%ld\n",day);
}
}
| ALGO | 0.999845 | 3.389168 |
28f8bd74-ac2a-4903-a64d-6130211f6502 | SlowTDancer/University-Work | Data structures and Algorithms/OHANIBTR.cpp | #include <bits/stdc++.h>
#define speeder ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);;
using namespace std;
int fenwick[1000001];
void clear(){
for(int i = 0; i < 1000001; i++){
fenwick[i] = 0;
}
}
void update(int index, int value){
while(index <= 1000001){
if(value <= fenwick[index]) bre... | ALGO | 0.99999 | 4.408473 |
e9d1030d-ce38-47c0-9c28-58d93304320c | abhineetraman/Data-Structures-Practical | Prac 1.cpp | //Program to do linear and binary search
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
//Declearing variables
int size,n;
bool flag=0;
//setting size of array and putting elements into it
cout<<"Enter the size of the array";
cin>>size;
cout<<"\nEnter elements of array";
int arr[... | ALGO | 0.99969 | 5.282287 |
17ab812c-74e5-4f59-a194-2f2857100b24 | sweeneychris/TheiaSfM | libraries/spectra/benchmark/Cpp.cpp | #include <Eigen/Core>
#include <iostream>
#include "timer.h"
#include <SymEigsSolver.h>
#include <GenEigsSolver.h>
using namespace Spectra;
using Eigen::MatrixXd;
using Eigen::VectorXd;
using Eigen::MatrixXcd;
using Eigen::VectorXcd;
void eigs_sym_Cpp(MatrixXd &M, VectorXd &init_resid, int k, int m,
... | ALGO | 0.998076 | 5.68016 |
24e5a185-a706-4a3e-947a-56fee2a01fc4 | akkera102/gbadev-ja-test | 121_lsdj_bgm_test2/src/tool/lsdpack/src/lsdpack-0.0.5/rules/repeat_command_rule.cpp | #include "repeat_command_rule.h"
#include <cassert>
static void remove_duplicate_command(std::deque<unsigned int>& bytes, size_t i) {
while (i < bytes.size() - 1) {
bytes[i] = bytes[i + 1];
++i;
}
bytes.resize(bytes.size() - 1);
}
/* If the same command appears more than twice in a row:
... | TOOL | 0.973624 | 6.504678 |
01342a88-3231-45db-8377-46265410bb57 | matielli/condicionaisEmCpp | exercicios.cpp | #include <stdio.h>
int main() {
int numero;
// Exercício 1
printf("Digite um número: ");
scanf("%d", &numero);
if (numero > 10) {
printf("O número é maior que 10.\n");
}
// Exercício 2
printf("Digite um número: ");
scanf("%d", &numero);
if (numero == 0) {
printf("O número é zero.\n");
}... | ALGO | 0.985009 | 3.105896 |
b0fba51e-44c6-44e1-b1c6-bb59236d4ca5 | tranvandat05032002/C-C-DoThi | chuoistring/mahoadaonguoc.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s , sb = "" , se = "";
int k;
cin >>s>>k;
sb=s.substr(0,k);
se=s.substr(k,s.size()-k);
reverse(sb.begin(),sb.end());
reverse(se.begin(),se.end());
cout<<sb+se;
return 0;
}
| ALGO | 0.999901 | 3.405216 |
a1129660-59b0-481b-b247-3cdb568774a1 | atalariq/cp | problems/Kattis/unknown_contest/Leggja saman.cpp | // Problem: Leggja saman
// Contest: unknown_contest
// Judge: Kattis
// URL: https://open.kattis.com/problems/leggjasaman
// Memory Limit: 1024
// Time Limit: 1000
// Start: Mon 04 Mar 2024 02:07:04 PM WIB
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullpt... | ALGO | 0.999009 | 3.567378 |
74f24e77-d0ed-476a-96f8-6f74c8263b8e | devspan/taboun | src/stakeinput.cpp | #include "stakeinput.h"
#include "chain.h"
#include "txdb.h"
#include "validation.h"
static bool HasStakeMinAgeOrDepth(int nHeight, uint32_t nTime, const CBlockIndex* pindex)
{
const Consensus::Params& consensus = Params().GetConsensus();
if (consensus.NetworkUpgradeActive(nHeight + 1, Consensus::UPGRADE_V5_3... | TOOL | 0.87553 | 6.263597 |
e8092068-0672-4f83-bd4b-f0a3ce01a642 | qtja/seqhack | src/muz/spacer/spacer_legacy_mev.cpp | #include <sstream>
#include "ast/array_decl_plugin.h"
#include "ast/ast_pp.h"
#include "ast/rewriter/bool_rewriter.h"
#include "muz/base/dl_util.h"
#include "ast/for_each_expr.h"
#include "smt/params/smt_params.h"
#include "model/model.h"
#include "util/ref_vector.h"
#include "ast/rewriter/rewriter.h"
#include "ast/rew... | ALGO | 0.913802 | 7.13679 |
0ad649d2-5887-4c4b-be39-06021d5ac57d | LingNc/LingNc | school/暑假集训/板子/二分.cpp | #include<bits/stdc++.h>
#include"A.cpp"
//找到满足条件的第一个值,没找到返回最大值
int bigger(vector<int> &str,int val){
int l=-1,r=str.size();
while(l+1<r){
int mid=l+(r-l>>1);
if(check()) r=mid;
else l=mid;
}
// 没找到的判断条件
return (r==str.size())?INF32:str[r];
}
//找到满足条件的最后一个值,没找到返回-1最小值
int le... | ALGO | 0.999973 | 4.411552 |
ad970503-c28d-4711-9bc8-0a3445459c83 | righthand0521/LeetCode | src/1325.cpp | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
#include "tree.h"
/**
* 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),... | ALGO | 0.99949 | 6.838094 |
9e18b79a-9a87-462e-9805-7d4951d19a4e | shrutjainj/3-C-Pattern-Printing | 7 oddnumbertriangle.cpp | #include<iostream>
using namespace std;
int main()
{
int n;
cout<<" Enter number : ";
cin>>n;
for(int i =1; i<=n; i++){
for(int j=1; j<=2*i-1; j++){
cout<<j;
}
cout<<endl;
}
return 0;
}
/* Enter number : 5*/
//1
//13
//135
//1357
//13579 | ALGO | 0.999944 | 4.125134 |
afea0deb-f825-491f-925e-9901b7135eab | rootrasel/Introduction-to-Algorithms | Week-07/Club selection contest/111.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
cout << i;
}
cout << endl;
for (int i = 2; i < n; i++)
{
for (int j = 2; j < n; j++)
{
cout << "";
}
cout << i;
for (in... | ALGO | 0.999944 | 3.174285 |
c1529be7-783d-4d21-afc1-f66a2ef71f2b | Bol-C14/Matrix_Solver_Benchmarking_Suite | lib/nicslu/src/demo/demo.cpp | //this demo is the same as demo.c except for that this demo calls the C++ wrapper
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include "nicslu_cpp.inl"
#ifdef _WIN32
#pragma comment(lib, "nicslu.lib")
#endif
const char *const ORDERING_METHODS[] = { "", "", "", "", "AMD", "AMM", "AM... | ALGO | 0.996299 | 4.661188 |
024997c8-2586-4051-8c9b-19c153ff6937 | fedecaccia/codility | 1-BinaryGap.cpp | /*A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains... | ALGO | 0.99989 | 6.221569 |
ccdf6807-712f-4add-9f3a-48e7808f9c22 | jinclef/algorithm | sds/20250204/7453.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n; // <=4000
long long arr[4][4002];
vector<long long> ab;
vector<long long> cd;
int main(){
ios_base::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL);
// 입력 받기
cin >> n;
for (int i=0;i<n;++i){
for(int j... | ALGO | 0.999928 | 4.521069 |
ac157c75-abbb-4111-81c4-f32d1bdbeee8 | ishandutta2007/codeforces | antoine/normal/854/A.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
int gcd(int a, int b) {
return b == 0 ? a : gcd(b, a%b);
}
int main() {
int n;
std::cin >> n;
int ansA = 0;
int ansB = 0;
for (int a = 0; a < n; ++a) {
int b = n - a;
if (b == 0) continue;
if (gcd(a, b) != 1)
continue;
if (a >= b)
contin... | ALGO | 0.999751 | 3.902937 |
b208fa81-2157-4e21-8fc3-e8789a99eb22 | SawZiDunn/SE-kmitl-cpp | lab9/lab2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
class Polynomial
{
private:
// Each term is represented as a pair (coefficient, exponent)
std::vector<std::pair<int, int>> terms;
// Helper function to sort terms by exponent (descending order)
void sortTerms()
{
std::sort(terms.be... | TOOL | 0.982997 | 5.772451 |
1d0d8593-ac99-491c-8b63-b84df977b00d | Skeleton71/Cplus_lang | Task set #1 c++ programming/N8.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
double pi,e,a,b;
pi = 3.14159;
e = 2.71828;
a = pow(pi, e);
cout << a << endl;
b = pow(e, pi);
cout << b << endl;
if(a>b)
{
cout << "Pi>e";
}
else
{
cout << "E>pi";
}
return 0;... | ALGO | 0.999262 | 3.5511 |
e92e2037-b692-4568-a762-a83389c9d8cf | AntonioTena13-pogi/Antonio-Tena | Juan_Antonio_Tena_lab_2.cpp | #include <iostream>
using namespace std;
typedef struct Node{
string songName;
Node *link;
}Node;
Node *createNode(string data){
Node *newNode = new Node;
newNode->songName = data;
newNode->link = NULL;
return newNode;
}
void traverse(Node *head){
Node *temp = new Node;
temp = head;... | ALGO | 0.993287 | 4.311963 |
9488e167-c15d-487f-9f9d-3503fa238b41 | sabrina-mostafa/Numerical_Methods | Trapezoidal Rule.cpp | /// ~~~~~Bismillah'hir Rah'maanir Rahim~~~~~ ///
/* " Allah(SWT) blesses with knowledge whom he wants. " */
/* " Indeed with Hardship, comes Ease. " */
/// Originator : Sabrina Mostafa
/// Dept. Of CSE
/// International Islamic University Chittagong
#include<bits/stdc++.h>
using nam... | ALGO | 0.999939 | 4.122947 |
beb3b7d7-f887-419d-a446-97ba227f2327 | harsh256-code/Striver_SDE_Sheet_challenge | Kadane’s_Algorithm.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
//if(nums.size() == 1)return nums[0];
int sum = 0,m=INT_MIN;
for(auto &it:nums){
sum+=it;
m = max(m,sum);
if(sum<0)sum=0;
}
return m;
}
};
| ALGO | 0.999975 | 6.037398 |
33e6fa5c-5f5f-41f8-90b6-f975dd8e75da | arifulmrislam/Introduction-to-Algorithms-Problem-Solving-part---III | Module 006 Lab Class 02/dfs.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int visited[N];
vector<int> adj_list[N];
void dfs(int node)
{
cout << node << endl;
visited[node] = 1;
for (int adj_node : adj_list[node])
{
if (visited[adj_node] == 0)
{
dfs(adj_node);
}
}
}
in... | ALGO | 0.999976 | 4.706742 |
b1b768c3-e122-4778-bf2d-217ccaa71bd0 | SravaniSegireddy/Coding-Career-Journey | InterviewBit/Binary Search/Day2_CountElementOccurence.cpp | //https://www.interviewbit.com/problems/count-element-occurence/
//Method 1: Using Maps - Time Complexity: O(logn), Space Complexity: O(n)
/*
int Solution::findCount(const vector<int> &A, int B) {
map <int, int> mp;
map <int, int> :: iterator it;
int n = A.size();
for(int i=0; i<n; i++){
if(mp.f... | ALGO | 0.999929 | 6.068511 |
b215eb8a-c031-48b6-a086-92594e6f6789 | Astromis/tinyEmbeddingsEngine | word2vec.cpp | #include "word2vec.hpp"
Word2Vec::Word2Vec(char* _train_file)
{
strcpy(train_file, _train_file);
word2vecStandartInit();
}
Word2Vec::~Word2Vec()
{
free((void*)syn0);
// It is unknown but it seems that the free invokes somewhere else previously
//free((void*)syn1);
free((void*)syn1neg);
fre... | DATA | 0.974161 | 5.496407 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.