uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
56619d19-dde3-440a-bf65-e920ad58e07c | ArchitKumar1/LeetCode-Submissions | group-anagrams/Accepted/4-7-2020, 1:05:34 AM/Solution.cpp | // https://leetcode.com/problems/group-anagrams
class Solution {
public:
vector<vector<string>> groupAnagrams(vector<string>& strs) {
map<string,vector<string>> m1;
vector<vector<string>> ans;
for(string s : strs){
string t = s;
sort(t.begin(),t.end());
m... | ALGO | 0.999997 | 6.571596 |
e93f06e5-1afd-4137-9116-af2530249788 | sdasgup3/Leetmap | all_problems/415_Add_Strings.cpp | /*
* Problem Description
Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.
Note:
The length of both num1 and num2 is < 5100.
Both num1 and num2 contains only digits 0-9.
Both num1 and num2 does not contain any leading zero.
You must not use any built-in BigInteger... | ALGO | 0.999762 | 6.619854 |
1e3aba29-49d5-45bf-9d96-4c24503c2dfc | yjkim721/gem5_project | full_code/src/systemc/tests/systemc/misc/synth/add_chain_FUNC/add_chain.cpp | /*****************************************************************************
add_chain.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/**************************************************************************... | TOOL | 0.999132 | 5.909687 |
16dc4bfa-1ad5-43a4-ab1c-a8212de65918 | clydecode8/BlockTAR_v2 | mobile/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.998201 | 6.772262 |
e90fc8ed-646a-4318-8e8e-5d257c528899 | muhammadakfz/Algorithm-Adventures | TLX/troc-32/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, a, b, c;
cin >> n >> a >> b >> c;
if((n % a == 0 and n % b != 0) || n % c == 0) cout << "YES";
else cout << "NO";
return 0;
} | ALGO | 0.999865 | 3.735326 |
0029fefb-1947-4dca-97fa-06a291e74df0 | chinmay-gupta-2003/StriverA2Z | STEP15 (GRAPHS)/LEC1/printAdjList.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
return 0;
}
vector<vector<int>> printAdjacency(int n, int m, vector<vector<int>> &edges)
{
// Write your code here.
vector<vector<int>> adjList(n);
for (int i = 0; i < n; i++)
{
adjList[i].push_back(i);
}
for (int i = 0; i < edges.size();... | ALGO | 0.999881 | 5.068419 |
ad15d0f9-8d14-47e8-acdb-e4340dab98a1 | triplemzim/competitive_programming | Codechef/Long contest september 2014/b.cpp | #include<bits/stdc++.h>
using namespace std;
#define ms(x,val) memset(x,val,sizeof(x))
#define scan(x) scanf("%d",&x)
#define scanL(x) scanf("%I64d",&x)
#define print(x) printf("%d\n",x)
#define debug(x) printf("DEBUG: %d\n",x)
#define printL(x) printf("%lld\n",x)
#define ull unsigned long long
#define iii long long
... | ALGO | 0.999861 | 3.458974 |
7d69626d-2241-4826-bf80-5ee6b998754a | KunalRSangalge/DSA | Codeforces/219A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int k;
cin>>k;
string s;
cin>>s;
vector<int>freq(26,0);
for(int i=0;i<s.size();i++){
freq[s[i]-'a']++;
}
string ans="";
for(int i=0;i<26;i++){
if(freq[i]%k!=0) {cout<<-1;
return 0;}
else {
... | ALGO | 0.999956 | 3.996981 |
b4698801-555f-4efd-afe6-01b3450a4210 | adnguyen527/CS-3377-C-C-Programming-in-UNIX-Environment | Assignment9/NumberList.cpp | #include "NumberList.h"
using namespace std;
void NumberList::deleteList()
{
ListNode* nodePtr; // to traverse the list
ListNode* nextNode; // points to the next node
// initialize nodePtr to the head of the list
nodePtr = head;
// traverse through list starting at the beginning,
// deleting... | ALGO | 0.87325 | 5.057966 |
4d22e2f2-9d55-4c06-bc6a-3e2e3c115d47 | prashkrans/DSA | 9. Bit Manipulation/7. X3. Single number (LC#136).cpp | /* Bit Manipulation problem: 7. (XOR problem 3.) LC#136. Single number
Given an array where every element repeats twice except one element, find that non repeating element.
Example 1:
Input: arr[] = {1, 2, 3, 2, 4, 1, 4}
Output: 3
Constraints:
1 <= nums.length <= 3 * 104
-3 * 104 <= nums[i] <= 3 * 104
Each element in... | ALGO | 0.999903 | 5.640837 |
c157b12c-20a4-4795-ac97-098ff147382c | limiao2008/android1 | tools/aapt/Command.cpp | #include <utils/Errors.h>
#include <utils/KeyedVector.h>
#include <utils/List.h>
#include <utils/Log.h>
#include <utils/SortedVector.h>
#include <utils/threads.h>
#include <utils/Vector.h>
#include <errno.h>
#include <fcntl.h>
#include <iostream>
#include <string>
#include <sstream>
using namespace android;
#ifndef... | TOOL | 0.973465 | 5.878781 |
d6bfa798-ed65-4fa3-ab0b-d69353be1230 | singlarohan/leetcode_sol | 0400-nth-digit/2022-10-17 09.08.55 - Runtime Error - runtime NA - memory NA.cpp | class Solution {
public:
int findNthDigit(int n) {
int currN{1}, x = 10;
int num{}, curr_count{0};
while(++num){
if(num == x){
x *= 10;
currN++;
}
curr_count += currN;
if(curr_count >= n)
break;
... | ALGO | 0.999831 | 6.83382 |
5583585d-ce0d-4bed-8769-5eaecf9637ec | sinian666/code_102_7 | cpp_ๅฏๆฌ32/chapter_sorting/radix_sort.cpp |
/**
* File: radix_sort.cpp
* Created Time: 2023-03-26
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* ่ทๅๅ
็ด num ็็ฌฌ k ไฝ๏ผๅ
ถไธญ exp = 10^(k-1) */
int digit(int num, int exp) {
// ไผ ๅ
ฅ exp ่้ k ๅฏไปฅ้ฟๅ
ๅจๆญค้ๅคๆง่กๆ่ดต็ๆฌกๆน่ฎก็ฎ
return (num / exp) % 10;
}
/* ่ฎกๆฐๆๅบ๏ผๆ นๆฎ nums ็ฌฌ k ไฝๆๅบ๏ผ */
void countingSortDigit(vector<... | ALGO | 0.999929 | 5.788882 |
f54f0870-27e1-469f-9a48-2bdfe09da5b1 | AjaySingh8923/LLVM | libcxx/test/std/algorithms/alg.sorting/alg.sort/partial.sort.copy/partial_sort_copy_comp.pass.cpp | // <algorithm>
// template<InputIterator InIter, RandomAccessIterator RAIter, class Compare>
// requires ShuffleIterator<RAIter>
// && OutputIterator<RAIter, InIter::reference>
// && Predicate<Compare, InIter::value_type, RAIter::value_type>
// && StrictWeakOrder<Compare, RAIter::value_type>}... | TEST | 0.998648 | 6.934341 |
eac64075-625f-4b67-a8d8-8661824dac1a | Glazomer/MATI_IT_ALL | 13/6.3.13.cpp | #include <iostream>
#include <cmath>
int find (int n[], int j){
int r = 0, result = 0;
for (int i = 0; i < j; i++){
if (n[i] < 0){
r = 0;
}else{
++r;
result = r > result ? r : result;
}
}
return result;
}
int main(int argc, char** argv){
int test[] = {2, 53,-2,0,0,0,-77};
std... | ALGO | 0.999552 | 4.293178 |
dc7068bb-5f44-4994-81e1-f9d0c30f8995 | simonjpascoe/cqf | Core/Mathematics.cpp | #pragma once
#define _USE_MATH_DEFINES
#include <math.h>
#include "stdafx.h"
#include "Mathematics.h"
#include "Debugging.h"
#define DBL_NUDGE 1e-12
namespace Common {
double interpolate(double xp, const vector<double>& x, const vector<double>& y)
{
if (xp + DBL_NUDGE < *min_element(x.begin(), x.end(... | ALGO | 0.999706 | 6.170196 |
389737e7-1e61-41c4-8a75-f4209be9e956 | biyotteu/algorithms | C++/๊ณ์ฐ๊ธฐ ํ๋ก๊ทธ๋จ.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
int sum;
cin >> sum;
while(1){
int x;
char y;
cin >> y;
if(y == '='){
cout << sum;
return 0;
}
cin >> x;
if(y == '+') sum += x;
else if(y == '-') sum -= x;
else if(y == '*') sum ... | ALGO | 0.999555 | 3.54803 |
fb66d45f-3395-4397-bd95-de1bf61bc2ed | SchweinDeBurg/repositorium | Graphics/OpenEXR/Source/IlmImf/ImfLut.cpp | #include "stdafx.h"
//-----------------------------------------------------------------------------
//
// Lookup tables for efficient application
// of half --> half functions to pixel data,
// and some commonly applied functions.
//
//-----------------------------------------------------------------------------
#inc... | TOOL | 0.982189 | 6.399932 |
f687e11d-0825-4b7e-bb08-6e9e063898f7 | BongYeob/PS | BOJ/17609.cpp | #include <iostream> //17609
#include <string>
#include <stack>
using namespace std;
int check(string str) { //ํ๋ฌธ ์ฒดํฌ
bool answer = true; //ํ๋ฌธ
bool answer1 = false; //์ ์ฌํ๋ฌธ
int start = -1;
int finish = str.size();
int temp_start, temp_finish;
bool start1 = false;
bool finish1 = false;
for (int i = 0; i < str... | ALGO | 0.999961 | 4.088597 |
4391d040-b7f5-496c-b031-84edefb7d3f1 | cjnoyesuws/astrology | cpp/Astrow32/newplanets/Anomaly.cpp |
#include <math.h>
#include "astro.h"
#include "compute.fns"
#include "utl.h"
#include <float.h>
#include "lngdbl.h"
/* fuction that returns a Truncated double argument such that
trunc_val(-21.7) = -21.0, and trunc_val(21.7) = 21.0 */
double trunc_val( double val )
{
if ( val < 0.0 )
return( ceil( val ) );
e... | ALGO | 0.999915 | 3.753434 |
a314a269-8d81-437e-9a48-76886e9cc941 | anjalim28/Leet-Code | dec2023/day1LeetCode.cpp | class Solution {
public:
bool arrayStringsAreEqual(vector<string>& word1, vector<string>& word2) {
string s1 = "";
string s2 = "";
for(const string& s : word1)
s1 += s;
for(const string& s : word2)
s2 += s;
return s1==s2;
}
};
| ALGO | 0.99948 | 6.336808 |
c78e3e85-dbf3-404f-8b08-019f57b23aa0 | 0baydullah/ProblemSolving | C0DEF0RCES/2023-05 (may)/1832 a.cpp | #include "bits/stdc++.h"
#define endl "\n"
#define pb push_back
#define all(v) v.begin(),v.end()
#define srt(s) sort(s.begin(),s.end())
#define rsrt(s) sort(s.rbegin(),s.rend())
#define rev(v) reverse(v.begin(),v.end())
#define all(x) x.begin(),x.end()
#define PI acos(-1)
#define gcd(a,b) __gcd(a,b)
#define lc... | ALGO | 0.999938 | 4.130446 |
1467db76-bc71-41fb-8321-e70761840043 | Aadarshg087/competitive-programming | TLE Eliminators Course/Number Theory/KuroniImpossibleCalculation.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
// Macros
#define ll long long int
#define endl "\n"
void solve()
{
ll n, MOD;
cin >> n >> MOD;
vector<ll> v(n);
for (int i = 0; i < n; i++)
{
cin >> v[i];
}
ll ans = 1;
for (int i = 0; i < n - 1; i++)
{
... | ALGO | 0.999985 | 4.773925 |
83dd188e-1328-4eb2-84bb-8a5dd5bbc107 | lawy623/Algorithm_Interview_Prep | Algo/Leetcode/137SingleNumerII.cpp | //1. Get each bit's times. retain only %3.
class Solution {
public:
int singleNumber(vector<int>& nums) {
int res = 0;
for (int i = 0; i < 32; ++i) { //For which bit
int sum = 0;
for (int j = 0; j < nums.size(); ++j) {
sum += (nums[j] >> i) & 1; //The number o... | ALGO | 0.99989 | 5.399695 |
9faa9179-d71f-41c2-bf1b-c6d1e8a3ff39 | LarssonEmil/SeamCarving | LinkSquare.cpp | #include "LinkSquare.h"
LinkSquare::LinkSquare()
{
}
LinkSquare::~LinkSquare()
{
if (root)
{
Node* traverse = root;
Node* down = root;
for (int y = 0; y < ysize; y++)
{
traverse = down;
if (y + 1 != ysize)
down = down->down;
else
{
bottom;
int test = 3;
}
for (int x = 0; x <... | TOOL | 0.964122 | 4.140112 |
5411b2f5-96b1-41d5-b5d3-8284996ee8f4 | matthewschallenkamp/Euler | C++/40.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <bitset>
using namespace std;
vector<int>digits(long long n)
{
vector<int> m;
while (n > 0)
{
m.push_back(n % 10);
n /= 10;
}
return m;
}
int main()
{
int c = 0;
int mult = 1;
int current = 0;
for ... | ALGO | 0.999858 | 4.616137 |
1adca4e5-1a26-4fcd-b7e0-0ad8738dab1a | httin/cses | sorting-and-searching/nested-ranges-check.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vpii = vector<pii>;
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(x)... | ALGO | 0.999957 | 3.334115 |
82377a24-2554-4bc1-ab91-d150e0e4bc18 | ihsanriadi123/LinearSearch_041 | LinearSearch_041/LinearSearch_041.cpp | #include <iostream>
using namespace std;
int arr[20]; // array to be searched
int n; // number of elements in the array
int i; // index of array element
void input()
{
while (true)
{
cout << "Enter the number of elements in the array: ";
cin >> n;
if ((n > 0) && (n <= 20))
break;
else
cout << "\nA... | ALGO | 0.995904 | 3.6705 |
88537081-bffe-47d6-82d8-35fb9567c6c1 | ElementAstro/Atom | atom/algorithm/algorithm.cpp | #include "algorithm.hpp"
#include <algorithm>
#include <future>
#include <thread>
#include "spdlog/spdlog.h"
#ifdef ATOM_USE_OPENMP
#include <omp.h>
#endif
#ifdef ATOM_USE_SIMD
#include <immintrin.h>
#endif
#ifdef ATOM_USE_BOOST
#include <boost/algorithm/string.hpp>
#endif
#include "atom/error/exception.hpp"
nam... | ALGO | 0.999931 | 7.491643 |
3064f494-4ecf-4f60-8444-955850077ee2 | PhoenixDigitalFX/Inkscape | src/live_effects/lpe-parallel.cpp | /** \file
* LPE <parallel> implementation
*/
#include "lpe-parallel.h"
#include "display/curve.h"
#include "object/sp-shape.h"
#include "ui/knot/knot-holder.h"
#include "ui/knot/knot-holder-entity.h"
// TODO due to internal breakage in glibmm headers, this must be last:
#include <glibmm/i18n.h>
namespace Inksca... | TOOL | 0.96624 | 7.039368 |
71b99858-fefe-4e0b-a1b3-ce65f2aebc74 | hvdieu/mycode | Cpp/PKGROUP.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef pair<long long, int> lli;
typedef long long ll;
typedef unsigned long long ull;
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Rep(i,a,b) for(int i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define sz(s) int(s... | ALGO | 0.999415 | 3.868761 |
e9d8746f-25eb-4921-8b36-03b3ea4e959e | lihongzheshuai/yummy-code | gesp/3/luogu/P5015.cpp | #include<iostream>
#include<string>
using namespace std;
int main(){
string n;
getline(cin,n);
int count = 0;
for(int i = 0;i<n.length();i++){
if(n[i]==' '){
continue;
}else{
count++;
}
}
cout << count;
return 0;
}
| ALGO | 0.999454 | 3.227241 |
63a90601-0120-45ae-8e71-ca2281b6b767 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_12845_50.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k;
const int MAXN = 2002;
int A[MAXN];
int main() {
scanf("%d,%d", &n, &k);
double t = n * (n - 1) / 2;
if (t <= k)
printf("no solution");
else {
for (int i = 1; i <= n; i++) {
cout << '0' << ' ' << i << endl;
}
}
}
| ALGO | 0.999937 | 3.082909 |
e4d24a0e-532d-4a70-b9a9-87e223c4c923 | NymurKhan/100-cpp-LeetCode-Problem-Solving | array_continous.cpp | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
class Solution {
public:
int minOperations(vector<int>& nums) {
int n = nums.size();
int ans = n;
set<int> st(nums.begin(), nums.end());
vector<int> uniqueNums;
for (int ... | ALGO | 0.999965 | 7.08199 |
a7eea726-5153-4f9d-9bb9-7f3004ef9a36 | jj123t/code | luogu/1060.cpp | /*************************************************************************
> File Name: 1060.cpp
> Author:123emm
> Mail: <EMAIL>
> Created Time: Thu Jul 20 14:35:17 2023
************************************************************************/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, m... | ALGO | 0.999953 | 4.008136 |
d9c2a535-84b9-4d28-827d-ff2a84179361 | kunalbag7/programming | C++/player.cpp | #include<stdio.h>
int main()
{
int k;
scanf("%d",&k);
while(k-->0)
{
int n,s;
scanf("%d %d",&n,&s);
int cost[n],t1[n],t2[n],tt1=0,tt2=0,t,q;
for (int i=0; i<n;i++)
{
scanf("%d",&cost[i]);
}
for (int i=0; i<n;i++)
{
scanf("%d",&q);
if(q==0)
{
t1[tt1]=cost[i];
tt1++;
}
else
... | ALGO | 0.999431 | 3.331596 |
11407fa3-4c45-4e5b-968b-afad5b9e5f23 | kirgy/marlin-firmware-ender-3-pro-skr-mini-e3-crtouch | Marlin/src/feature/meatpack.cpp | /**
* MeatPack G-code Compression
*
* Algorithm & Implementation: Scott Mudge - <EMAIL>
* Date: Dec. 2020
*
* Character Frequencies from ~30 MB of comment-stripped G-code:
* '1' -> 4451136 '4' -> 1353273 '\n' -> 1087683 '-' -> 90242
* '0' -> 4253577 '9' -> 1352147 'G' -> 1075806 'Z' -> 34... | TOOL | 0.945297 | 5.888532 |
f6942906-18b5-4d0d-9c5f-a843e0edcc5d | raphaelcampos/uva-online-judge-problems | ACM-ICPC Dhaka Site Regional Contests/2015/p1726.cpp | #include "stdio.h"
#include "iostream"
#include <cstdlib>
#include "cmath"
using namespace std;
int main(int argc, char const *argv[])
{
int T, Q;
int d, s;
char r;
unsigned int c_l[10], c_nl[10];
unsigned sum = 0;
scanf("%d", &T);
while(T--){
for (int i = 0; i < 10; ++i)
{
c_l[i] = 0;
c_nl[i] = 0;... | ALGO | 0.994076 | 3.760325 |
300a05aa-01d4-445e-92b1-71ba68480312 | Anantk21/100-Days-of-Code | leetcode_2310.cpp | #include <iostream>
class Solution {
public:
int minimumNumbers(int sum, int k) {
if (sum == 0) return 0;
for (int i = 1; i <= 10; ++i)
if ((i * k) % 10 == sum % 10 && i * k <= sum) return i;
return -1;
}
};
int main() {
// Example usage
Solution solution;
int s... | ALGO | 0.999941 | 6.363353 |
dd8e1396-5a9b-4088-9111-20d528b17545 | mari625/shad_algorithms | Algorithms/rhyme.cpp | #include <iostream>
#include <vector>
struct Node {
int key = 0;
int size = 0;
char exists = 'f';
};
void ConstructTree(int begin, int end, int index, std::vector<Node>& tree) {
if (begin == end) {
tree[index] = Node{begin, 1, 't'};
return;
}
if (begin + 1 == end) {
tr... | ALGO | 0.999987 | 3.514226 |
05a18969-1f82-4590-9baf-c6c919e698bd | abhinavrapartiwar/DSA-Journey | Linked List/Questions/detect_cycle_in_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
bool hasCycle(ListNode *head)
{
unordered_set<ListNode *> s;
ListNode *curr = head;
while (curr != NULL)
{
if (s.find(curr) != s.end())
retu... | ALGO | 0.999834 | 4.114645 |
7eb9d4d7-0084-481e-9fce-0084eea7e7b8 | AshfaqMahmud/CPP-codes | leetcode/closestrings.cpp | bool closeStrings(string word1, string word2) {
// map<char,int> m1,m2;
// bool res = true;
// if(word1.size() != word2.size())
// {
// return false;
// }
// for(int i=0; i<word1.size(); ++i){
// char c1,c2;
// c1 = word1[i];
/... | ALGO | 0.999977 | 5.767618 |
2952c5e8-3f92-4041-9de4-2841ef7617e6 | phuicy/ROBOOP | newmat/solution.cpp | /// \ingroup newmat
///@{
/// \file solution.cpp
/// One dimensional solve routine.
#define WANT_STREAM // include.h will get stream fns
#define WANT_MATH // include.h will get math fns
#include "include.h"
#include "myexcept.h"
#include "solution.h"
#ifdef use_namespace
namespa... | ALGO | 0.999989 | 5.800463 |
a3469b7d-800d-4954-a28f-e5b7b597ef77 | fmyuan/pflotran-elm-interface | src/pflotran/.deprecated/mdt/Hanford300.cpp | #include "Hanford300.h"
#ifndef MAX
#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
#endif
#ifndef MIN
#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
#endif
Hanford300::Hanford300(Grid **grid_) {
river_polygon = NULL;
north_pond_west_trench = NULL;
north_pond_east_trench = NULL;
plume = NULL;
ascii_grids = NULL;
Pet... | ALGO | 0.909684 | 4.337204 |
eeaaf45e-8d0f-42b4-9b37-1f4f3f2031e0 | p1kalys/Leetcode-DSA-Vault | 68-text-justification/text-justification.cpp | class Solution {
public:
vector<string> fullJustify(vector<string>& words, int maxWidth) {
int n = words.size();
vector<string> ans;
int i = 0;
while( i < n){
int len = words[i].size();
int j = i + 1;
while( j < n && len + words[j].size() + (j-i) <... | ALGO | 0.999975 | 6.295014 |
6e7c0ab9-9dc2-4868-8a43-950ed5d5dfd1 | keitaroooo/atcoder-studying | atcoder-regular-contest/116/B.cpp | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
const int MOD = 998244353;
int main() {
int N;
cin >> N;
vector<long long> A(N);
long long ans = 0;
for(int i = 0; i < N; ++i) {
cin >> A[i];
ans = ans... | ALGO | 0.999829 | 5.189949 |
2aac779c-593d-4b45-a142-1de462c6a4ea | alexandraback/datacollection | solutions_5652388522229760_0/C++/lostleaf/a.cpp | #include <cstdio>
void solve()
{
long long t, s = 0;
scanf("%lld", &t);
if (t == 0)
{
printf("INSOMNIA\n");
return;
}
bool shown[10] = {0};
int cnt = 0;
while (cnt < 10)
{
s += t;
for (long long tmp = s; tmp; tmp /= 10)
{
int digi... | ALGO | 0.998835 | 4.604089 |
b1f403d3-d91c-4ff1-993d-fdb35d5792b3 | PalAditya/NetworkingLab | lsr.cpp | #include<iostream>
#include<stdio.h> //fputs
#include<sys/types.h> //socket, connect
#include<sys/socket.h> //socket, connect
#include<stdlib.h> //exit
#include<string.h> //explicit_bzero
#include<arpa/inet.h> //inet_pton
#include<unistd.h> //read
#include<time.h> //time
#include<pthread.h>
#define MAXCLIENTQ 10 //ba... | ALGO | 0.991344 | 3.107998 |
548a4d6c-aff1-4349-a33d-4ed4fe9810b7 | kifah-s/Problem_Solving | Gammal_Tech_Academy/2_C++_Programming_Language/Exercises/Pro_120_Bank_Account_Class_Program/Bank_Account_Class_Program_V2.cpp |
/* >>> Bank Account Class Program ( Version 2 ) <<< */
/* >>> Create a class called "BankAccount" that has a static member variable "interestRate" and two member variables "balance" and "accountNumber".
The class should have a constructor that sets the initial balance and account number, and member functions "deposi... | TOOL | 0.940036 | 6.74739 |
cb4e2aa0-be02-4099-a3e9-45beb7295cc1 | raghuvanshraj/Competitive-Programming-Archive | Codeforces/acmsguru/106.cpp | /**
* author: vulkan
* created: 14.09.2020 08:00:53 PM
**/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define MOD 1000000007
#define INF 1000000000
#define SET_ARR(arr,n,val) for (int i = 0; i < n; ++i) arr[i] = val
#define SET_ARR2D(arr,n,m,val) for (int i = 0; i < n; ++i) for (int j =... | ALGO | 0.999968 | 4.4339 |
212cc674-94c8-4c6d-bda1-df5878d481b1 | ardiapri/023_PertemuanPertamaPemrogramanDasar | enc_temp_folder/468c5bd625b492d17d195b883f8bcb86/PertemuanPertamaPemrogramanDasar.cpp |
#include <iostream>
using namespace std;
int main()
{
float a, b;
cout << "Masukkan jari-jari = ";
cin >> a;
b = 3.14 * a * a;
cout << "Luas Lingkaran Adalah = " << b << endl;
system("pause");
}
| ALGO | 0.97812 | 3.228543 |
3f9459ad-af28-4456-847b-70b9899324a2 | ssbadjate02/Competetive-Programming | Expected_move.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(x) (x).begin(),(x).end()
#define ss second
#define ff first
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typ... | ALGO | 0.999922 | 3.45207 |
3852e1a1-5cf5-4e02-b35b-6640a91a1ad4 | martin-rod/OpenAudio_ArduinoLibrary | RadioFMDiscriminator_F32.cpp | #include "RadioFMDiscriminator_F32.h"
// ==== UPDATE ====
void RadioFMDiscriminator_F32::update(void) {
audio_block_f32_t *blockIn, *blockA=NULL, *blockB=NULL;
int i;
static float32_t discr0, disc1, disc2;
static float32_t sumNoise;
static float saveIn = 0.0f; // for squelch
static float saveOut... | ALGO | 0.993869 | 6.005723 |
e5ec68fa-90f9-4c20-9e9a-322163f23368 | sonapraneeth-a/competitive-programming_submissions | platforms/binarysearch/practice/easy/116__recurring-character/solutions.cpp | // clang-format off
/**
* FILE DESCRIPTION
*
* Filename: 116__recurring-character/solutions.cpp
* Created on: 05 September 2021
* Last modified: 05 September 2021
* Author: sonapraneeth_a
* Description: BinarySearch submission for 'Recurring Character' problem
*/
/**
* CHANGELOG
*... | ALGO | 0.999982 | 5.289849 |
77f34d05-9401-49ec-8033-8846ec5a3809 | Lavanya-Jaganathan/Leetcode-Solutions | 0064-minimum-path-sum/0064-minimum-path-sum.cpp | class Solution {
public:
int solve(int i,int j,int m,int n,vector<vector<int>>& G,vector<vector<int>>&dp)
{
if(i>=m || j>=n)
{
return INT_MAX;
}
if(i==m-1 && j==n-1)
{
return G[i][j];
}
if(dp[i][j] != -1)
{
return dp[i][j];
}
else
{
return dp[i][... | ALGO | 0.999985 | 6.162176 |
70effb0e-8cd3-43b5-93f3-f707d83f3972 | pramodkumar5921/DSA | 63. Unique Paths II.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m=obstacleGrid.size();
int n=obstacleGrid[0].size();
vector<vector<int>>dp(m,vector<int>(n));
if(obstacleGrid[0][0]==1 || obstacleGrid[m-1][n-1] == 1){
return 0;
}
... | ALGO | 0.99975 | 6.045333 |
361ce206-b9e6-4685-bae8-ae8cb256c5db | MDK8888/DataStructure-DSA- | Recursion/Recursion1.cpp | #include<iostream>
using namespace std;
Count(int m)
{
//Base case
if(m==0)
{
return 0;
}
//>>Tail Recursion<<
/* cout<<m<<endl;
Count(m-1);*/
//>>Head Recursion<<
Count(m-1);
cout<<m<<endl;
}
int main()
{
int n;
cout<<"Enter a number:";
cin>>n;
Co... | ALGO | 0.999945 | 4.006099 |
494b6da8-3d1b-4683-b75b-8f1ce4080b7d | DarkEnderr/C- | hieups.cpp | #include<bits/stdc++.h>
using namespace std;
int toigian(int a, int b, int c, int d) {
int tu, mau = 0;
if (d > b) {
if (d%b==0) {
int temp = b;
b = b * d/b;
a = a * d/temp;
} else if (d%b!=0) {
int temp = b;
int temp1 = d;
... | ALGO | 0.999773 | 5.427101 |
3a2b9bde-e65c-4223-ad06-5eb30e0c4e86 | lkt9899/PS | SWEA/D3/3499.โ
ํผํํธโ
์
ํ/ํผํํธโ
์
ํ.cpp | #include <cstring>
#include <iostream>
#define fio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
using namespace std;
const int MAX = 1000;
int N, mid;
string deck1[MAX];
string deck2[MAX];
string ans[MAX];
void input() {
cin >> N;
mid = (N + 1) / 2;
for (int i = 0; i < N; i++) {
if (i <... | ALGO | 0.999698 | 3.425831 |
86cdf34a-23d2-42e9-a88c-628878447b6a | j-a-h-i-r/Online-Judge-Solutions | Uva/10004 - alternate.cpp | #include<cstdio>
#include<vector>
#include<queue>
using namespace std;
void bfs(int mat[200][]){
}
int main()
{
int n,e,x,y;
int edge[200][200];
while(scanf("%d", &n) && n!=0 ){
for(int i=0; i<200; i++) memset(edge[i], 0, sizeof(edge[i]));
scanf("%d", &e);
while(e--) {
... | ALGO | 0.999194 | 4.026252 |
888a18d2-8910-404b-ac6d-8e7e984ed012 | ajkrish95/CompetitiveProgramming | zeta_nim_game_codechef.cpp | // Dynamic Programming implementation of edit distance
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
// Change these strings to test the program
#define STRING_X "SUNDAY"
#define STRING_Y "SATURDAY"
#define SENTINEL (-1)
#define EDIT_COST (1)
inline
int min(int a, int b) {
return a < b ? a : b;
}
/... | ALGO | 0.999978 | 5.429786 |
f9887a55-e614-4064-8ba2-67be7e06fba9 | ishandutta2007/codeforces | thebes/normal/869/C.cpp | #include <iostream>
using namespace std;
typedef long long ll;
ll a, b, c, i, j, ans=1, tmp, mod = 998244353, cnt[5005][5005];
int main(){
for(i=0;i<=5000;i++){
for(j=0;j<=5000;j++){
if(i == 0 || j == 0) cnt[i][j] = 1;
else cnt[i][j] = (j*cnt[i-1][j-1]+cnt[i-1][j])%mod;
}
}
scanf("%I64d%I64d%I64d",&a,&b,... | ALGO | 0.999971 | 4.936228 |
e7e5dd0f-8224-4d40-acac-7bad2e36cd76 | zanqging/Lobby | cocos2d/extensions/Particle3D/PU/CCPUParticleFollower.cpp | #include "CCPUParticleFollower.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticleFollower::DEFAULT_MAX_DISTANCE = 3.40282e+038f;
const float PUParticleFollower::DEFAULT_MIN_DISTANCE = 10.0f;
//-----------------------------------------------------------------... | TOOL | 0.927309 | 6.540458 |
84556af8-f0a1-407a-8318-1414a17d1f83 | Ujjwal55/LeetCode-Solutions | Number of occurrence - GFG/number-of-occurrence.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
//User function template for C++
class Solution{
public:
/* if x is present in arr[] then returns the count
of occurrences of x, otherwise returns 0. */
int firstIndex(int arr[], int n, int x){
int low = 0, high = n... | ALGO | 0.999949 | 5.854087 |
be938aff-5162-4d8c-8c63-474934259f45 | rky0930/MyTensorflowBenchmark | app/cc/src/tensorflow_lite/tensorflow/tensorflow/lite/tools/make/downloads/eigen/lapack/eigenvalues.cpp | #include "lapack_common.h"
#include <Eigen/Eigenvalues>
// computes eigen values and vectors of a general N-by-N matrix A
EIGEN_LAPACK_FUNC(syev,(char *jobz, char *uplo, int* n, Scalar* a, int *lda, Scalar* w, Scalar* /*work*/, int* lwork, int *info))
{
// TODO exploit the work buffer
bool query_size = *lwork==-1;... | ALGO | 0.999076 | 4.678171 |
e63b06a5-cca7-4d67-ba54-aa429eb541db | Vishal-sys-code/Competitive-Programming-Solutions | Code_Abbey/CPP/10-LinearFunction.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
ll t; cin >> t;
while (t--) {
ll x1, y1, x2, y2;
ll a, b;
c... | ALGO | 0.999559 | 4.626041 |
9c470572-60eb-4409-8a7b-c7463e398940 | Daiki0555/Katamari | k2EngineLow/ExEngine/bulletPhysics/src/Bullet3Collision/BroadPhaseCollision/b3DynamicBvhBroadphase.cpp | ///b3DynamicBvhBroadphase implementation by Nathanael Presson
#include "b3DynamicBvhBroadphase.h"
#include "b3OverlappingPair.h"
//
// Profiling
//
#if B3_DBVT_BP_PROFILE||B3_DBVT_BP_ENABLE_BENCHMARK
#include <stdio.h>
#endif
#if B3_DBVT_BP_PROFILE
struct b3ProfileScope
{
__forceinline b3ProfileScope(b3Clock& cloc... | ALGO | 0.956077 | 6.760708 |
6f4214da-8c21-466b-b03c-99ad03054d39 | Zia6/Acm | onlineJudge/UVA/็ฌฌไธ็ซ /12124.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <cctype>
#include <iomanip>
#include <sstream>
template <class T>
inline void read(T &x)
{
x = 0;
int f = 1;
char c = get... | ALGO | 0.999964 | 4.210176 |
d4407244-fab1-4f5d-8bec-a92732528bf1 | Soumyapatra001/cpp-programs- | compare_next_element.cpp | //compare i element to i+1 and print max value
#include <iostream>
using namespace std;
int main()
{
int a;
cout<<"Enter the number of elements in an array: ";
cin>>a;
int arr[a];
for(int i=0;i<a;i++)
{
cout<<"Enter the value of "<<i<<"-th index element: ";
cin>>arr[i]; //input elements in array
}
for(int ... | ALGO | 0.999397 | 3.697259 |
b748d7eb-b0de-471c-854b-67a57dc8c9e7 | raincross7/code-similarity | codes/train_code/problem344/problem344_475.cpp | #pragma GCC optimize(3)
#include<bits/stdc++.h>
#define int long long
#define F first
#define S second
#define P pair
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define V vector
#define RE return
#define ALL(a) a.begin(),a.end()
#define MP make_pair
#define PB push_back
#define PF push_front
#define FILL(a,b) memset(a,b,... | ALGO | 0.999586 | 3.193726 |
84833342-4f23-42bd-b26a-3771384cdedf | KevinMathewT/Competitive-Programming | NumberOfWays.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Author - Kevin Mathew
// Birla Institute of Technology, Mesra
void te(){
ll n;
cin >> n;
ll a[n];
for(ll i=0;i<n;i++) cin >> a[i];
ll dp[n];
dp[0] = a[0];
for(ll i=1;i<n;i++)
dp[i] = a[i] + dp[i-1];
if(dp[n-1] % 3 != 0){
cout << 0 <<... | ALGO | 0.999874 | 3.654762 |
955eab8a-b867-49b7-bad3-db740b376d87 | ishandutta2007/codeforces | emorgan5289/normal/1343/B.cpp | #include <bits/stdc++.h>
using namespace std;
#define inf 1000000000
#define inf_ll 1000000000000000000ll
#define inf_ull 1000000000000000000ull
#define ll long long
#define ull unsigned long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#ifdef ONLINE_JUDGE
#... | ALGO | 0.99869 | 3.993018 |
9232a8b5-7342-421b-8283-d5c8aadb70f8 | likeabhityagi0700/PLACEMENT-PREPRATION-MODULE- | DAY 9 Matrix.cpp | //Problem 1
// 01 Matrix.cpp
//leetcode problem solution
class Solution {
public:
vector<vector<int>> updateMatrix(vector<vector<int>>& matrix) { // mat used as matrix name define
queue<pair<int, int>> queue;
for (int i = 0; i < matrix.size(); ++i) {
for (int j = 0; j < matrix[0].si... | ALGO | 0.999718 | 5.790311 |
c0f9efd4-a233-495e-bda3-85ee9bccfcf3 | strejda/tegra | contrib/llvm-project/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp | #include "llvm/Analysis/ScalarEvolutionNormalization.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpressions.h"
using namespace llvm;
/// TransformKind - Different types of transformations that
/// TransformForPostIncUse can do.
enum Transfor... | TOOL | 0.943969 | 6.291642 |
eb0ada3a-0cf6-4b71-968f-288f66a09981 | allan7yin/low-latency-limit-order-book | LimitOrderBook/Book.cpp | #include "Book.hpp"
#include "Order.hpp"
#include <iostream>
Book::Book() : buyTree(new RedBlackTree<Limit>()), sellTree(new RedBlackTree<Limit>()) {
}
Book::~Book() {
for (auto &[id, order] : orderMap) {
delete order;
}
orderMap.clear();
}
// PRIVATE
void Book::insertLimit(const int limitPrice, ... | ALGO | 0.997182 | 5.264789 |
8c93b789-cea2-4d7d-a320-e4ddca008734 | Pratik-Sarkate/My-codes | Striver_CP_Sheet/Bit_Manipulation-Power_Set/Petr_and_a_Combination_Lock.cpp | // https://codeforces.com/problemset/problem/1097/B
#include<bits/stdc++.h>
#define ll long long int
#define fast_io std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define endl '\n'
using namespace std;
void solve(){
int n;cin>>n;
vector<int> a(n);
for(int i = 0; i<n; i++){
cin>>a... | ALGO | 0.999705 | 4.094397 |
4f6f79d8-3878-4169-93f1-ee7216a47b62 | Shell-Wataru/AtCoder | ABC/ABC143/D.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using ll = long long;
namespace mp = ... | ALGO | 0.999776 | 3.596122 |
beeec92f-0e34-42c1-a276-376ad26ea552 | Yomna521/Path-planner | Path Planner/src/Eigen-3.3/doc/examples/class_Block.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::Block<Derived>
topLeftCorner(MatrixBase<Derived>& m, int rows, int cols)
{
return Eigen::Block<Derived>(m.derived(), 0, 0, rows, cols);
}
template<typename Derived>
const Eigen::Block<const Derive... | TOOL | 0.894492 | 5.865374 |
d8debfa3-fdd6-40b7-81cf-2b9fe9b131d1 | hiyouga/CPP-Learning | old/matlab.cpp | /*
* data_convert.cpp by hoshi_hiyouga
* last_modified in 2017/11/06 19:37
* Convert the characters to numbers
* Only for BUAA MCM Qualification Competition
*/
#include<iostream>
#include<fstream>
#include<cstdlib>
#include<cstring>
#include<sstream>
using namespace std;
string buffer[21];
string strb[56]={"A11","... | TOOL | 0.935992 | 3.051568 |
1f20f8a7-2f9a-42b8-a829-511e22318196 | Makwy1424/SDE-Sheet-Challenge | Find_duplicate_in_array.cpp | #include <bits/stdc++.h>
using namespace std;
int findDuplicate(vector<int> &arr, int n)
{
sort(arr.begin(), arr.end());
for (int i = 0; i < n - 1; i++)
{
if (arr[i] == arr[i + 1])
return arr[i];
}
}
int main()
{
} | ALGO | 0.999837 | 4.126604 |
01581d9a-6962-463f-8ee2-86511dc6a3bf | WaykiChain/wicc-wasm-cdt | libraries/libc++/libcxx/test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval_param.pass.cpp | // <random>
// template<class RealType = double>
// class normal_distribution
// template<class _URNG> result_type operator()(_URNG& g, const param_type& parm);
#include <random>
#include <cassert>
#include <vector>
#include <numeric>
#include <cstddef>
template <class T>
inline
T
sqr(T x)
{
return x * x;
}
in... | TEST | 0.96929 | 4.229073 |
c2e741aa-9471-4e85-b4a9-68e43dd7a9c7 | john-reilly/Self_Driving_Car_Nano_Degree_Term_3_Project_1_Path_Planning | src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.979236 | 3.576145 |
80f88a94-8320-4a03-9b4b-0f9f1ec23b48 | timlee0131/Operating-Systems-Implementation | DeadLock_Avoidance/stageTwo/main.cpp | #include <pthread.h>
#include <fstream>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#include <queue>
#include <chrono>
#include "graph.h"
pthread_mutex_t graphLock, printLock, randLock;
bool gameSignal = false;
bool endOfGame = false;
int A, N, K; // A = total # of people N = # of threads concurrently... | ALGO | 0.995289 | 3.726455 |
e5593b10-f676-4a82-9dfe-d28872e0ee34 | VaporumCoin/VaporumCoin-daemon | src/komodo-tx.cpp | #include "clientversion.h"
#include "coins.h"
#include "consensus/consensus.h"
#include "consensus/upgrades.h"
#include "core_io.h"
#include "key_io.h"
#include "keystore.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/sign.h"
#include <univalue.h>
#include "util.h"
#include "utilmone... | TOOL | 0.902443 | 4.55535 |
487b0ffa-c4b3-4371-997c-404f164b474f | adcgunwoo/Practice_C-plus-plus | C++๋ฌธ์ ์ ์ถ์ฉ/ํด๋์ค(Class)/๋ฉค๋ฒํจ์์ ์ ์ธ๊ณผ ์ ์ ๋ถ๋ฆฌํ๊ธฐ.cpp | //๋ฒกํฐ+์ฐ์ฐ์ ์ค๋ฒ๋ก๋ฉ
//๋ฉค๋ฒ ๋ฉ์๋์ ์ ์ธ๊ณผ ์ ์ ๋ถ๋ฆฌํ๊ธฐ
//์ ์ธ๊ณผ ์ ์๋ฅผ ๋ถ๋ฆฌํ๋ ์ด์
//ํจ์๊ฐ ์ฌ๋ฌ๊ฐ ํ์ํ๊ณ ํธ์ถํ ๋
//๋ฏธ๋ฆฌ ์ ์๋์ง ์์ผ๋ฉด ์์ง ์ ์ธ๋์ง ์์ ํจ์ ํธ์ถ ๋ถ๊ฐ๋ฅ
/*
void a();
void b();
void c(); ์ ์ธ ๋จผ์
void a() {
c(); ๊ทธ๋ฆฌ๊ณ ์ ์
}*/
#include <iostream>
using namespace std;
class vector2 {
public:
vector2(); //์์ฑ์ ์ ์ธ
vector2(float x, float y);//์์ฑ์ ์ ์ธ
float getx() con... | TOOL | 0.919095 | 4.385695 |
ca1cec72-001e-4caa-9f22-2364b8ab741b | pavellevap/code_antiplagiat | final_test/10/u76825_420_B_6444480.cpp | #include <iostream>
#include <cstring>
#include <set>
using namespace std;
int id[100009],ans[100009];
char s[100009];
bool vis[100009],vib[100009];
int main()
{
int n,m;
while(cin>>n>>m)
{
int i,j,k;
set<int> st,sb;
st.clear();
sb.clear();
memset(vis,false,sizeof(v... | ALGO | 0.999991 | 3.68834 |
5ddd92a6-f3d4-4918-b7a8-10ea923543bb | ishandutta2007/codeforces | hyperhyperhypercubelover/normal/453/C.cpp | #include<cstdio>
#include<vector>
std::vector<int> graph[100001];
int a[100001];
int v[100001];
int r[500000];
int rn;
void dfs(int x)
{
int i;
v[x]=1;
r[rn++]=x;
a[x]=!a[x];
for(i=0;i<graph[x].size();i++)if(!v[graph[x][i]])
{
dfs(graph[x][i]);
r[rn++]=x;
a[x]=!a[x];
if(a[graph[x][i]])
... | ALGO | 0.999929 | 3.677217 |
1625c555-c913-4c93-9dd0-87540f171c37 | IvanTicona/Competitive-Programming | Club/Vacaciones/Grafos/๐conservation.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m;
int topo(vector<vector<int>> adj, vector<int> deg, vector<int> place, int start) {
vector<queue<int>> q;
q.resize(2);
for(int i = 0; i < n; i++) {
if(deg[i] == 0) {
q[place[i]].push(i);
}
}
int curr = start;
... | ALGO | 0.999952 | 5.20652 |
d1c37a40-9f4a-489c-8639-048d229484c3 | xin3liang/platform_external_opencore | codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_isf.cpp | /*
------------------------------------------------------------------------------
Filename: isp_isf.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-----------------------------------------------------------------------------... | ALGO | 0.998474 | 5.648031 |
a2c512b4-74ad-404a-8a43-d3714bd855d1 | lakshv06/cp-practice | code/Quicksort.cpp | #include <bits/stdc++.h>
using namespace std;
#define print(a) for(auto it: a){cout<<it<<" ";}
void swap(int &a, int &b){
if(&a==&b)return;
a = a^b;
b = a^b;
a = a^b;
}
int partition(vector<int>&arr, int lo, int hi){
int pivot = arr[hi];
// int i = lo, j = hi;
int i = lo-1;
for(int j=l... | ALGO | 0.999936 | 5.451003 |
becddcc7-6ce8-45ea-9df9-9ec71d4605a8 | Titiuu/leetcode | src/2293.cpp | #include "head.h"
class Solution {
public:
int minMaxGame(vector<int>& nums) {
int n = nums.size();
if (n == 1)
return nums[0];
vector<int> newNums(n / 2);
for (int i = 0; i < n / 2; i++) {
if(i & 1)
newNums[i] = max(nums[2 * i], nums[2 * i + ... | ALGO | 0.999977 | 5.49426 |
a7631677-ae6d-48da-8d4c-8bb35080bff3 | dhruvkumar456/DSA_lab | Linked_list(search,sort).cpp | // Linked_list(search,sort).cpp
//ROLL-NO->IIIT18153
#include<bits/stdc++.h>
using namespace std;
struct node{
int data;
struct node* next;
};
struct node* newnode(int data)
{
struct node* s=new struct node;
s->data=data;
s->next=NULL;
return s;
}
struct node* insert(struct node* root,int data)
{
if(ro... | ALGO | 0.999984 | 3.743822 |
0a3894ac-bbc8-4a1d-aef3-b0af3cbf8e2b | AOSPK/frameworks_av | media/codecs/amrnb/common/src/sub.cpp | /*
Filename: /audio/gsm_amr/c/src/sub.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the sub function. Sync'ed up with the
current template and fixed tabs.
Description: Changed all occurrences of L_diff to diff, ... | ALGO | 0.999431 | 6.918442 |
e008d1fa-fab6-4d16-9891-09ed918358d5 | nimishakavisrinithya/C-Repo | 3471-minimum-average-of-smallest-and-largest-elements/3471-minimum-average-of-smallest-and-largest-elements.cpp | class Solution {
public:
double minimumAverage(vector<int>& nums) {
double avg, m = INT_MAX;
while (nums.size() > 1) { // Run until at least 2 elements exist
auto result = minmax_element(nums.begin(), nums.end());
avg = (*result.first + *result.second) / 2.0; // Ensure fl... | ALGO | 0.99998 | 7.343524 |
1ed00000-c5ee-4d09-8760-1b36b867872d | shash42/Competitive-Programming | CF/Global9/D.cpp | #include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define F first
#define S second
#define int long long
#define lint long long
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define sz(x) (int)x.size()
#define all(x) begin(... | ALGO | 0.999985 | 4.521498 |
4a9ecac2-50dd-4e2b-a464-0713dbcc1db7 | Tim2othy/cpp-kurs | Lรถsungen/Blatt 6/Aufgabe2.cpp | #include <iostream>
#include <cmath>
//nimmt an, dass die Koeffizienten vom groessten Exponenten an nummeriert sind. Beginnend bei 0.
class QuadPol {
public:
QuadPol(double a,double b,double c){
if(a==0){
std::cout<< "Das ist nicht quadratisch"<<std::endl;
return;
}
_koef[0] = a;
_koef[... | ALGO | 0.989231 | 3.809414 |
ada5c702-ec45-448b-9444-700e3b49c165 | Rkp420/LeetCodeDaily | May-2025/Day-15.cpp | #include <iostream>
using namespace std;
// https://leetcode.com/problems/longest-unequal-adjacent-groups-subsequence-i/description/?envType=daily-question&envId=2025-05-15
// BruteForce (TLE)
class Solution
{
public:
vector<string> longestAns = {};
void f(int i, int prev, vector<string> &word, vector<int> &g... | ALGO | 0.999968 | 5.532396 |
bbf3b315-e3fe-4c49-927b-a32b02196761 | Nilanjana02/DSA_C_C-_programe | sorting in array.cpp | //Sorting in array
#include<stdio.h>
#include<conio.h>
int main ()
{
int a[50],i,j,n,small;
printf("Enter how many array element:");
scanf("%d",&n);
printf("Enter the array element:");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
small=a[i];
a[i]=a... | ALGO | 0.999976 | 3.148183 |
94f29235-4e95-4371-920a-793fc7f60a8d | Sameer520/OPERATING-SYSTEM | various memory allocation strategies.cpp | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define MEMORY_SIZE 100
struct MemoryBlock {
int id;
int size;
int allocated;
};
void initializeMemory(struct MemoryBlock memory[], int size);
void printMemory(struct MemoryBlock memory[], int size);
void allocateFirstFit(struct MemoryBlock... | ALGO | 0.998956 | 4.983388 |
34bdbdbf-ec3b-4eee-b43d-1d8020507827 | shyamal2411/DSA-Practice | Hackerrank/diagonalDifference.cpp | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define nl "\n"
const int M=1e9+7;
typedef vector<int> vi;
#define f(i,a,n) for(int i=a;i<n;i++)
#define rf(i,a,n) for(int i=n-1;i>=a;i--)
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cin.tie(0);cout.tie(0);
#define read(arr,n) for(int ... | ALGO | 0.999938 | 3.849386 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.