uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
f9dfa257-3dd2-4cdc-b791-39afcea8a741 | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/maximum_twin_sum_of_a_linked_list/solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
int pairSum(ListNode*... | ALGO | 0.999976 | 5.465988 |
0b41b30f-415c-4ddf-957a-d63b852f2246 | IbraimAblyametov/Programming-New | Practice/36/C++/main.cpp | #include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
const auto PI = 3.141592653589793;
enum CoordSystem { Cartesian, Polar };
class Point {
private:
double x, y;
public:
constexpr static const double percision = 1e-10;
const... | ALGO | 0.999146 | 4.619086 |
4822ba44-3a5c-4ee7-b193-0068955ab9ee | Ricardiam/liretok1 | math/power_of_two.cpp | /**
* @file
* @brief Implementation to check whether a number is a power of 2 or not.
*
* @details
* This algorithm uses bit manipulation to check if a number is a power of 2 or
* not.
*
* ### Algorithm
* Let the input number be n, then the bitwise and between n and n-1 will let us
* know whether the number i... | ALGO | 0.996971 | 7.467488 |
87286bcc-ca6a-4a28-92a0-29be578eff58 | defUserName-404/Online-Judge | CodeForces/707A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, i, j;
cin >> n >> m;
char s[n][m];
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
cin >> s[i][j];
}
for (i = 0; i < n; i++)
{
for (j = 0; j < m; j++)
{
if (s[i][j] ==... | ALGO | 0.993253 | 3.752448 |
67a85e78-f30f-49bd-b887-f0b5401b110a | Haleshot/Competitive-Programming | Codechef/Test_Avg/Test_Avg.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int A, B, C;
cin >> A >> B >> C;
if (((A + B)/2 >= 35) && ((A + C)/2 >= 35) && ((B + C)/2 >= 35))
{
cout << "PASS" << endl;
}
else
{
... | ALGO | 0.996829 | 3.994249 |
da06467b-4cd0-45ab-bd14-4680daeaed6d | thisisshub/HacktoberFest | folders/QUEUES/First non-repeating character in a stream - MED.cpp | /*
First non-repeating character in a stream
Medium Accuracy: 51.34% Submissions: 25204 Points: 4
Given an input stream of A of n characters consisting only of lower case alphabets. The task is to find the first non repeating character, each time
a character is inserted to the stream. If there is no such character t... | ALGO | 0.999607 | 5.205824 |
8c2c056b-d030-466b-b493-ed699ae49f07 | smritiiD7/Leet_Coding | 1996-the-number-of-weak-characters-in-the-game/1996-the-number-of-weak-characters-in-the-game.cpp | class Solution {
public:
static bool comp(vector<int> &a, vector<int> &b)
{
if(a[0]==b[0])
return a[1]>b[1];
return a[0]<b[0];
}
int numberOfWeakCharacters(vector<vector<int>>& ppt) {
sort(ppt.begin(),ppt.end(),comp);
int ans=0;
int n = ppt.size();
... | ALGO | 0.999961 | 5.463705 |
ddc822d9-df11-48d8-923e-1e80b463c0cf | alevi29/leetcode | 2744-find-maximum-number-of-string-pairs/2744-find-maximum-number-of-string-pairs.cpp | class Solution {
public:
int maximumNumberOfStringPairs(vector<string>& words) {
int ret = 0;
unordered_map <string, int> map;
for (auto i : words) map[i]++;
for (auto i : words) {
string temp = i;
reverse(temp.begin(), temp.end());
if (ma... | ALGO | 0.999972 | 5.872293 |
abba6229-3848-4a18-b899-56fe83cd1833 | ishandutta2007/codeforces | crtsir/normal/17/C.cpp | #include<bits/stdc++.h>
using namespace std;
const long long mod=51123987;
int dp[153][53][53][53],nxt[3][153],n,ans;
string s;
int main(){
cin>>n>>s;
s='%'+s;
for(int i=n;i>=1;i--)nxt[0][i]=nxt[0][i+1],nxt[1][i]=nxt[1][i+1],nxt[2][i]=nxt[2][i+1],nxt[s[i]-'a'][i]=i;
dp[1][0][0][0]=1;
for(int i=1;i<=n;i++)
for(in... | ALGO | 0.999971 | 3.631827 |
65793272-d9d9-4e33-89ec-663668f49956 | ananthkumarmv/Coding-problems | codeforces/Combination-Lock.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
string str1, str2;
cin>>str1>>str2;
int tot = 0;
for(int i=0; i<n; i++){
tot += min(abs(str1[i] - str2[i]), 10 - abs(str1[i] - str2[i]));
}
cout<<tot<<"\n";
return ... | ALGO | 0.999796 | 3.774785 |
51793718-c14a-42ce-888a-6abbd99ac843 | PlasmolysisMango/vscode_cpp | exam/cyclequeue.cpp | #include <iostream>
#include <vector>
using namespace std;
class CQueue {
size_t front, rear;
size_t capacity;
vector<int> data;
public:
CQueue(size_t _capacity = 10): front(0), rear(0), capacity(_capacity), data(vector<int>(capacity, 0)) {}
bool empty() const {
if (rear == front)
... | ALGO | 0.999044 | 5.06299 |
aab34d36-4368-4b4c-805f-906ddb9bc5d0 | POC-2025/leetcode | solution/1300-1399/1311.Get Watched Videos by Your Friends/Solution.cpp | class Solution {
public:
vector<string> watchedVideosByFriends(vector<vector<string>>& watchedVideos, vector<vector<int>>& friends, int id, int level) {
queue<int> q{{id}};
int n = friends.size();
vector<bool> vis(n);
vis[id] = true;
while (level--) {
for (int k =... | ALGO | 0.999979 | 5.706132 |
f934efff-e499-4096-8037-5894549ce67e | SoaibAhmed01/c-programming | Module 6/Find_Ratul.cpp | //Bismillahir Rahmanir Rahim
//Soaib Ahmed...
#include <bits/stdc++.h>
using namespace std;
//Driver code
void solve()
{
string s;
int flag=0;
string word;
getline(cin,s);
stringstream ss(s);
while(ss>>word)
{
if(word=="Ratul")
{
cout<<"YES"<<endl;
flag=1;
... | ALGO | 0.999258 | 4.124258 |
fb794c85-7299-4866-a832-29ce06dff1eb | lo0b0o/dsa | lg2142/lg2142-2.cpp | #include <iostream>
#include <vector>
using namespace std;
typedef vector<int> vi;
vi a, b, c;
bool checkSwap(vi a, vi b) {
if (a.size() != b.size()) return a.size() < b.size();
for (int i = a.size() - 1; ~i; i--) {
if (a[i] != b[i]) return a[i] < b[i];
}
return false;
}
void sub() {
for (int i = 0; i < a.siz... | ALGO | 0.99997 | 3.954196 |
e8d48004-edbe-4773-8e9d-65eef7ce11e4 | falcaoanderson/CompetitiveProgramming | juizes/vjudge-s6-B.cpp | // 06/07/23 //
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <tuple>
#include <cstring>
#include <stack>
using namespace std;
#define ll long long
#define endl "\n"
#define fast_io ios_base::sync_wit... | ALGO | 0.999971 | 4.889877 |
4b03fe61-b8f3-46c3-af7c-6d14c038cabe | aeadod/C_break | 链表高级.cpp | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct Node {
char* word;
struct Node *next;
};
void splitIntoWords(char *str,struct Node **wordList){
int count =0;
char*p=str;
while(*p!='\0'){
if(*p!=' '){
count++;
}else{
if(count>0){
struct Node *pNode=(struct Node *)malloc(siz... | TOOL | 0.995728 | 3.018575 |
e07022b4-9733-4cd8-9b35-0a88a52fff4a | Saumyashrestha/CE2021_Lab4_51_52 | CE2021_Lab4_51_52/Lab4 (linked Data Structure)/src/main.cpp | #include "linkedlistBST.h"
#include <iostream>
using namespace std;
int main() {
LinkedListBST bst;
cout << "Is BST empty? " << (bst.isEmpty() ? "Yes" : "No") << endl;
bst.addBST(50, 1);
bst.addBST(30, 2);
bst.addBST(70, 3);
bst.addBST(20, 4);
bst.addBST(40, 5);
bst.addBST(60, 6);
... | ALGO | 0.998735 | 6.123271 |
8482cceb-1be4-42e2-9e13-df8e07084aac | Errantry73/Engorgio | thirdparty/openfhe-development/src/binfhe/examples/eval-function.cpp | /*
Example for the FHEW scheme small precision arbitrary function evaluation
*/
#include "binfhecontext.h"
using namespace lbcrypto;
int main() {
// Sample Program: Step 1: Set CryptoContext
auto cc = BinFHEContext();
cc.GenerateBinFHEContext(STD128, true, 12);
// Sample Program: Step 2: Key Gene... | ALGO | 0.974667 | 4.290221 |
6965b5a3-8ba5-4482-9f25-14d4e2e81f79 | thegamer1907/Code_Analysis | contest/1542585689.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <complex>
#include <stack>
#define LL long long int
#define dob double
#define FILE ""
using namespace std;
const int N = 100010;
char c[1... | ALGO | 0.99997 | 3.001671 |
9ecdf976-f24d-46ee-afad-5a8c46f3d090 | ptitSeb/ctp2 | ctp2_code/robotcom/goals/goalrustle.cpp | #include "c3.h"
#include "dynarr.h"
#include "civarchive.h"
#include "IMapPointData.h"
#include "ic3GameState.h"
#include "ic3UnitDB.h"
#include "ic3world.h"
#include "aimain.h"
#include "AiMap.h"
#include "airndcnt.h"
#include "dr_debug.h"
#include "matrix.h"
#include "grassfire.h"
#include "strategic_map.h"
#incl... | TOOL | 0.908633 | 5.422715 |
5f80f89b-d7be-486f-a2c5-3509bb870fca | Xilinx/hls-llvm-project | llvm/tools/llvm-strings/llvm-strings.cpp | #include "llvm/Object/Binary.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Signals.h"
#include <cctype>
#include <string>... | TOOL | 0.863867 | 7.414546 |
890e3f69-6acb-491e-bad0-e1311d3efacb | dsstest/Mojo-Tec-Skyfire-4.0.6a- | dep/g3dlite/source/stringutils.cpp | /**
@file stringutils.cpp
@maintainer Morgan McGuire, http://graphics.cs.williams.edu
@created 2000-09-09
@edited 2008-01-10
*/
#include "G3D/platform.h"
#include "G3D/stringutils.h"
#include "G3D/BinaryInput.h"
#include <algorithm>
namespace G3D {
#ifdef _MSC_VER
// disable: "C++ exception handler used"
#... | TOOL | 0.96817 | 6.813859 |
4539db47-9162-48bc-9994-4685ebbe9f03 | Er-DEVPOPLI/DSA | LINKED/44_linked_list/02_doubly_linkedlist.cpp | #include<iostream>
using namespace std;
class Node {
public:
int data;
Node* prev;
Node* next;
//constructor
Node(int d ) {
this-> data = d;
this->prev = NULL;
this->next = NULL;
}
~Node() {
int val = this -> data;
if(next != NULL) {
... | ALGO | 0.999422 | 4.629261 |
c2edf599-3ba8-46e1-ac95-6491ef453186 | CodeMatias/bullet-old | src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp | #include "btSoftBodyConcaveCollisionAlgorithm.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"
#include "BulletCollision/CollisionShapes/btConcaveShape.h"
#include "Bulle... | ALGO | 0.99631 | 6.717582 |
2029acf9-04ab-44cd-a4bd-14cf77990f28 | coderFH/CPP | C++/33-双目运算符重载/main.cpp | #include <iostream>
using namespace std;
class Complex {
private:
int m_r; //实部
int m_i; //虚部
friend ostream& operator<<(ostream& ,const Complex&);
friend istream& operator>>(istream&,Complex&);
public:
Complex() {}
Complex(int r,int i) : m_r(r),m_i(i) {}
Complex operator+ (const Complex& c... | ALGO | 0.880238 | 4.759928 |
c1301fdd-f347-4ad4-a413-1a5389d61a5b | soren-minnig/csc_142 | Other/practice.cpp | /*
First, declare two int variables: one for the length of the array to use in the
function and the other for a target number
Create the array
Create a for-loop that searches through the array until it finds the target, and
then return the target
If the loop reaches the final integer in the array and it does not equal ... | ALGO | 0.99996 | 5.91952 |
284d8027-f39e-4c5c-b847-1cf1d05bbd14 | nyanpasua/leetcode | src/problems/二叉树与递归/二叉搜索树与其他数据结构/[222]完全二叉树的节点个数.cpp | /*
* @lc app=leetcode.cn id=222 lang=cpp
*
* [222] 完全二叉树的节点个数
*/
//给你一棵 完全二叉树 的根节点 root ,求出该树的节点个数。
//
// 完全二叉树
// 的定义如下:在完全二叉树中,除了最底层节点可能没填满外,其余每层节点数都达到最大值,并且最下面一层的节点都集中在该层最左边的若干位置。若最底层
//为第 h 层,则该层包含 1~ 2h 个节点。
//
//
//
// 示例 1:
//
//
//输入:root = [1,2,3,4,5,6]
//输出:6
//
//
// 示例 2:
//
//
//输入:root = []
//输出:0
//... | ALGO | 0.999222 | 6.795241 |
bb083ba3-2272-4315-a355-3b45bc108852 | anonimo-iv/scilammps | src/compute_property_chunk.cpp | // clang-format off
#include "compute_property_chunk.h"
#include <cstring>
#include "atom.h"
#include "update.h"
#include "modify.h"
#include "compute_chunk_atom.h"
#include "memory.h"
#include "error.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
Compute... | TOOL | 0.85357 | 6.784649 |
62ce1a04-6db2-44d5-a820-a850896edb0d | raincross7/code-similarity | codes/train_code/problem322/problem322_138.cpp | #include<cstdio>
int main(){
int x;
int n = 1;
while(1){
scanf("%d", &x);
if(x == 0) break;
printf("Case %d: %d\n", n, x);
n++;
}
return 0;
} | ALGO | 0.99832 | 3.802193 |
5e1676ee-c4a9-4346-9a9b-50b26f48ed17 | Kamna16/DSA-codes | Heaps&PriorityQueues/basic.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <stdexcept>
class MaxHeap {
private:
std::vector<int> heap;
void heapifyUp(int index) {
while (index > 0) {
int parentIndex = (index - 1) / 2;
if (heap[parentIndex] < heap[index]) {
std::swap(he... | ALGO | 0.999451 | 6.206364 |
e9568acb-e2b5-4c6f-b035-87525c547370 | martusheff/flutter-ios-widget | flutter_ios_widget/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.997489 | 6.785645 |
39dc6a8b-d4ed-45d4-8893-c7580c47db2f | RomanVolak/djvu-djvulibre | libdjvu/GURL.cpp | #ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if NEED_GNUG_PRAGMAS
# pragma implementation
#endif
// From: Leon Bottou, 1/31/2002
// This has been heavily changed by Lizardtech.
// They decided to use URLs for everyting, including
// the most basic file access. The URL class now is a unholy
// mixture of code fo... | TOOL | 0.862847 | 5.92926 |
0035b34a-24ec-4475-bb19-5d7a8d3e766a | chandanrakholia/LeetcodeSubmissions | search-in-rotated-sorted-array/Wrong Answer/10-5-2022, 7:27:52 PM/Solution.cpp | // https://leetcode.com/problems/search-in-rotated-sorted-array
class Solution {
public:
int search(vector<int>& nums, int target) {
int n=nums.size();
int l=0;
int r=n-1;
int mid=-1;
int k=-1;
while(l<=r){
int mid=l+(r-l)/2;
int prev=(mid-1+n)%n;
... | ALGO | 0.999995 | 6.355556 |
13704496-d9bf-42e8-95de-19f688ac2dad | raincross7/code-similarity | codes/train_code/problem219/problem219_196.cpp | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
int n, a = 0, b = 0;
string buffier;
cin >> buffier;
for(int i = 0;i < buffier.size();i++){
a = a * 10 + buffier[i] - '0';
b += buffier[i] - '0';
}
if(a % b == 0){
cout << "Yes";
}else{
cout << ... | ALGO | 0.999887 | 4.18621 |
a3f15626-682d-4613-aa5a-b3ee7b6c5007 | fardinkamal62/codeforces-solutions | ThemeCP/L-1_08-Jan-2025_0700/A. Simple Design.cpp | /**
* author: @fardinkamal62
* created: 08/01/2025 07:07
**/
#include "iostream"
using namespace std;
int sumOfDigits(int n) {
if (n == 0)
return 0;
return (n % 10) + sumOfDigits(n / 10);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int tt;
cin >> tt;
whil... | ALGO | 0.999879 | 4.958866 |
3adae927-91cd-45ae-bdde-da5d5a49a9a2 | mishraji874/DSA-Abdul-Bari | Pattern7.cpp | #include<iostream>
using namespace std;
int main() {
int n;
cin>>n;
int i = 1,j = 1;
for ( i = 1; i <= n; i++)
{
for ( j = 1; j <= i; j++)
{
cout<<i-j+1<<" ";
}
cout<<endl;
}
return 0;
} | ALGO | 0.999936 | 3.778082 |
1421601a-fa85-4e16-8992-24aca79e6bef | Cynthia2019/CS322 | L1/src/parser.cpp | /*
* SUGGESTION FROM THE CC TEAM:
* double check the order of actions that are fired.
* You can do this in (at least) two ways:
* 1) by using gdb adding breakpoints to actions
* 2) by adding printing statements in each action
*
* For 2), we suggest writing the code to make it straightforward to enable/disable al... | TOOL | 0.880032 | 5.540216 |
9365e07f-8e37-4218-8f46-08b5d8654803 | Happy-76/codemind-cpp | maximum_digit_numbers_count.cpp | #include<bits/stdc++.h>
using namespace std;
int count(int n)
{
int cnt=0;
if(n==0) return 1;
while(n!=0)
{
n=n/10;
cnt++;
}
return cnt;
}
int main()
{
int n,c=0,max;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
max=count(a[0]);
fo... | ALGO | 0.999971 | 3.900928 |
9fc9419a-18b6-4d1d-9c52-ed7b9a3ba519 | BrowserWorks/waterfox | gfx/skia/skia/src/base/SkQuads.cpp | #include "src/base/SkQuads.h"
#include "include/private/base/SkAssert.h"
#include "include/private/base/SkFloatingPoint.h"
#include <cmath>
#include <limits>
// Solve 0 = M * x + B. If M is 0, there are no solutions, unless B is also 0,
// in which case there are infinite solutions, so we just return 1 of them.
stat... | ALGO | 0.997582 | 7.443525 |
1b469d77-d941-4fb0-bed9-b972ee225e26 | whitehax0r/mesa-git | src/util/u_qsort.cpp | #include "u_qsort.h"
#include <thread>
thread_local int (*tl_qsort_r_compar)(const void *, const void *, void *);
thread_local void *tl_qsort_r_arg;
static int
qsort_r_compar(const void *a, const void *b)
{
return tl_qsort_r_compar(a, b, tl_qsort_r_arg);
}
void
util_tls_qsort_r(void *base, size_t nmemb, size_t si... | TOOL | 0.986675 | 5.916709 |
45ee8d88-4bc4-40fc-a28b-2622ad8851d7 | H-Jamieu/Self_study | ch02/Merge_sort.cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void merge(int p, int q, int r, int AQ[])
{
//length of left and right array
int n1 = q-p+1;
int n2 = r-q;
int L[n1+1];
int R[n2+1];
//initilize Left and Righet array
for(int i = 0; i<n1; i++)
{
... | ALGO | 0.999886 | 4.770802 |
69b1eb2a-faab-4dc9-a219-3c4f13b01a8d | osama-kh/money_manegment | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
8cfc8dcb-18ec-4d7c-a4f2-5b560d4cb72e | ARW2705/leet-code-solutions | solutions/500-E-Keyboard-Row/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include "../../utilities/print-vector.cpp"
std::vector<std::string> findWords(std::vector<std::string>& words) {
std::vector<int> charRows {1, 2, 2, 1, 0, 1, 1, 1, 0, 1, 1, 1, 2, 2, 0, 0, 0, 0, 1, 0, 0, 2, 0, 2, 0, 2};
std::vector<std::string> result;
for... | ALGO | 0.998937 | 5.806843 |
62fe5ab3-7ef9-4005-8f18-031d5b3a03a3 | rwiesenfarth/AdventOfCode2021 | Day09/main.cpp |
#include <fstream>
#include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
struct Position
{
Position( int row, int col )
: m_row( row )
, m_col( col )
{}
int m_row;
int m_col;
};
struct Basin
{
Basin(... | ALGO | 0.99977 | 5.785504 |
fb6e5fa1-489d-4e78-9da2-6be8bd25830c | backengineering/llvm-msvc | clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp | #include "DirectoryScanner.h"
#include "clang/DirectoryWatcher/DirectoryWatcher.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/AlignOf.h"
#include "llvm/Support/Errno.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
#include <atomic>
#include <condition_varia... | TOOL | 0.937032 | 7.64819 |
ca1ef646-6b34-474d-8cd8-fa0ad178f2a7 | Asevenx174/CP-source-code- | 02_OJ_solution/Cf contest/edu 97/e.cpp | #include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pf printf
#define ff first
#define ss second
#define sef second.first
#define ses second.second
#define PI 3.14159265 /// tan inverse = atan(value)*(180/PI)
#define ms(a,b) memset(a, b, sizeof(a))
#define lp(i,a,b)... | ALGO | 0.999761 | 3.582426 |
3be668e5-3cd3-4bae-a08b-f2be7eb6932c | mahabub5090/LeetCode_Problem_Solutions | Hard/3203. Find Minimum Diameter After Merging Two Trees.cpp | // Problem Link: https://leetcode.com/problems/find-minimum-diameter-after-merging-two-trees/submissions/1487364351/?envType=daily-question&envId=2024-12-24
class Solution {
private:
void build(vector<vector<int>>& adj, vector<vector<int>>& edges, int n){
for(auto &c: edges){
adj[c[0]].push_bac... | ALGO | 0.999979 | 6.173053 |
5a0c0b3a-f8a9-4ada-86f5-089593933719 | mrinmoyxb/Data-Structures-and-Algorithms | Leetcode/LinkedList/92_ReverseLinkedList.cpp | #include <iostream>
class Node{
public:
int data;
Node* next;
Node(int data){
this->data = data;
this->next = NULL;
}
};
void insertAtTail(Node* &head, int data){
Node* newNode = new Node(data);
Node* current = head;
while(current->next!=NULL){
current = current... | ALGO | 0.999986 | 5.413044 |
e3214805-2e49-47a4-b786-cb441f6b08cd | amithasan16Hstu/CF4 | Chef_Vacation_Transportation.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int x,y,z;
cin>>x>>y>>z;
if(x+y>z)
cout<<"TRAIN"<<endl;
else if(x+y<z)
cout<<"PLANEBUS"<<endl;
else
cout<<"EQUAL"<<endl;
}
} | ALGO | 0.999824 | 4.160811 |
e01e081b-f4af-4117-83a2-4ff99f42749e | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0612/dict/dict.cpp | #include<bits/stdc++.h>
using namespace std;
char c[3051][3051];
string big[3051],small[3051];
int b[3051][27];
int main(){
freopen("dict.in","r",stdin);
freopen("dict.out","w",stdout);
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cin>>c[i][j];
b[i][c[i][j]-'a'+1]++;
}
}
for(int i=... | ALGO | 0.999925 | 3.081167 |
dceb3b30-5397-498b-9d41-29f4ce5aa137 | rakeshkarmaker/c-plus | Library of Rk/STACK_WITHOUT_CLASS.cpp | /*2. (a) Define STACK and its operation PUSH and POP for the following scenario. STACK maxsize = 6. Illustrate the following steps.
Push(2);
Push(3);
Push(5);
Pop();
Push(1);
Pop();
Push(8);
Push(4);
Pop();
Pop();
Pop();
*/
#include <iostream>
using namespace std;
int stack[100];
int top = 0, maximum = 50... | ALGO | 0.957079 | 4.263463 |
1e9ec8a0-8421-46c9-b075-c3d90aa05128 | shelltdf/osgall | prebuild/boost_1_71_0/libs/geometry/doc/src/examples/algorithms/relate.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
//[relate
//` Shows how to detect if a point is inside a polygon, or not
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hp... | ALGO | 0.997816 | 6.485822 |
ef1035e1-f732-435f-bdec-e60e1967404f | sgwrld-999/ICPC | 2. Basic_Number_Theory/2. GCD_&_LDA/5.SieveOfEratosthenes.cpp | #include <bits/stdc++.h>
using namespace std;
/*
Problem link on leetcode : https://leetcode.com/problems/count-primes/
Problem link on geeksforgeeks : https://www.geeksforgeeks.org/sieve-of-eratosthenes/
Explanation:
Approach1: Brute force approach
Run a loop from 2 to n and check whether the number is pr... | ALGO | 0.999994 | 6.585561 |
41c14787-764f-4c0f-a0d2-92d116670552 | black-sat/black | src/lib/src/logic/past_remover.cpp | #include <black/logic/past_remover.hpp>
#include <black/logic/prettyprint.hpp>
#include <numeric>
namespace black_internal::remove_past {
using namespace black_internal::logic;
// Label data type for substituting past propositional letters
static
proposition past_label(formula f) {
using namespace std::... | TOOL | 0.881161 | 6.717273 |
092809e7-af04-490c-b7f5-d6e879df3273 | ishandutta2007/codeforces | radal/normal/1320/A.cpp | #include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("Ofast")
#pragma GCC optimization ("unroll-loops")
#define X first
#define Y second
#define debug(x) cerr << #x << ": " << x << endl;
#define ll long long int
#define endl '\n'
#define mp make_pair
#define pb push_back
#define rep(i,l,r) for... | ALGO | 0.999906 | 3.979462 |
40b00d49-d2f4-40ca-8594-6496f6f48f0a | AlphaGergedan/Towards-Soft-Error-Resilience-in-SWE-with-Teampi | src/tolerance/swe_hardRes_wTaskSharing.cpp | /**
* @file src/tolerance/swe_hardRes_wTaskSharing.cpp
*
* Warning: this file is from Simon Schuck's work (see README.md) and was the
* baseline of our task sharing method Sharing. We do not use this file.
*
* TODO
* - description
*
* - change the name to match with the executable
*
* - curren... | TOOL | 0.972895 | 5.049256 |
37bb8674-2f9e-40cc-9f4f-4de3f610fca2 | pershoot/android_frameworks_base | media/libstagefright/codecs/amrnb/enc/src/p_ol_wgh.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/p_ol_wgh.c
Funtions: p_ol_wgh_init
p_ol_wgh_reset
p_ol_wgh_exit
Lag_max
Pitch_ol_wgh
Date: 02/05/2002
---------------------------------------------------... | ALGO | 0.997372 | 3.601306 |
69706026-5524-4b04-be69-b01fa4c0d218 | shen7563/CodeTree | 250413/문자열의 총 길이 구하기/find-the-length-of-the-string.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
string str[10];
int total_length = 0;
for(int i = 0; i < 10; i++) {
cin >> str[i];
total_length += str[i].length();
}
cout << total_length;
... | ALGO | 0.949968 | 3.641201 |
b7e29586-7062-4474-8247-99ab7629f291 | gabriellisboaconegero/adv_code | adv_code23/d12/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define u64 uint64_t
#define i64 int64_t
struct record_t {
string springs;
vector<int> group_damaged;
};
bool can_be(int group, string &s, int i){
return s[i] != '#' &&
s[i+group+1] != '#' &&
all_of(s.begin()+i+1, s.begin()+i+group+1, []... | ALGO | 0.999233 | 4.137559 |
1935d78f-4623-4cf0-948c-c8704527bd7d | felipefoschiera/Competitive-Programming | URI Online Judge/Seletiva UFFS 2018/c.cpp | /**
* Seletiva UFFS 2018 - URI Online Judge
* Felipe G. Foschiera
*/
#include <iostream>
#include <vector>
#define INF 1e9
using namespace std;
int editDistance(string a, string b, int n, int m){
int dp[n+1][m+1];
for(int i = 0; i <= n; i++){
for(int j = 0; j <= m; j++){
if(i == 0) dp[... | ALGO | 0.999988 | 4.458171 |
b9b84cd6-fc9c-45be-a222-fc661d089480 | Rohitmahi2003/Flutter_projects | api_integration/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 |
7fa06130-4e38-4697-b7cb-5219dbc92622 | yasaswinpalukuri/c-- | leetcode/June 2024/JuneDailyProblems.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution{
public:
// Day 1: Score of a String - Q3110(Easy)
/*
You are given a string s.
The score of a string is defined as the sum of the absolute difference between the ASCII values of adjacent characters.
Return the score of s.... | ALGO | 0.999054 | 5.451222 |
705087d6-d08a-407e-8073-2200bcffe8ed | Hyo-gyeong/C_special-lecture_Day4 | day4_4/day4_4.cpp | #include <stdio.h>
int main(void)
{
int stdNum, scores[100]={0};
char grades[100]={0};
int best = scores[0], grade;
int i;
printf("Enter the number of students : ");
scanf("%d", &stdNum);
printf("Enter %d scores:", stdNum);
for (i = 0; i < stdNum; i++) {
scanf("%d", &scores[i]);
if (best <= scores[i])
... | TOOL | 0.927284 | 3.311826 |
d1934121-0a9f-4261-96b1-891b351c27ba | codeninja404/LeetCode_CPP | 091. Decode Ways.cpp | // My solution.
class Solution {
public:
int numDecodings(string s) {
/** dp[i] =
* value Example
* 0 00, 30, 80 - invalid ending
* dp[i-2] 10, 20 - valid ending with 0
* dp[i-2] ... | ALGO | 0.999913 | 6.444773 |
86462c6a-6c44-4966-9bf6-20552e159b34 | Trisha-Tyagi/DSA | Array/Merge_Intervals.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<vector<int>> merge(vector<vector<int>> arr){
sort(arr.begin(),arr.end());
vector<vector<int>> ans;
int n=arr.size();
for(int i=0;i<n;i++){
if(ans.empty() || arr[i][0]>ans.back()[1]){
ans.push_back(arr... | ALGO | 0.99995 | 5.029202 |
b64af64d-7d41-4b09-a103-b325efc321c1 | jinhan814/BOJ | cpp/5963.cpp | #include <bits/stdc++.h>
#define fastio cin.tie(0)->sync_with_stdio(0)
using namespace std;
#define int int64_t
struct Factorial {
int F[21]{ 1 };
Factorial() { for (int i = 1; i <= 20; i++) F[i] = F[i - 1] * i; }
int operator[] (int i) { return F[i]; }
} F;
void Query1(const int n, int k) {
vector<int> check(n ... | ALGO | 0.999564 | 3.548103 |
8868ba24-9f76-4547-af98-9b04e106eebb | Namchee/undergrad-thesis-program | src/io.cpp | #include "io.h"
#include "eval.h"
#include "utils.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <filesystem>
#include <stdexcept>
#include <argparse/argparse.hpp>
/**
* Parse user inputs from command-line arguments.
*
* @param argc arguments count
* @param argv actual a... | DATA | 0.955306 | 5.5364 |
5cdc9470-4446-4f57-952f-40f61402af24 | porterlin/CP-Practice | leetcode/greedy/3074.cpp | class Solution {
public:
int minimumBoxes(vector<int>& apple, vector<int>& capacity) {
int ans = 0;
int sum = accumulate(apple.begin(), apple.end(), 0);
ranges::sort(capacity, greater<>());
for (auto c : capacity) {
sum -= c;
ans += 1;
if (sum <= 0... | ALGO | 0.999942 | 6.103944 |
f5076afb-9cc4-4472-a1da-22b3d140557e | ishandutta2007/codeforces | kawatea/normal/388/A.cpp | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int n, l, r, m, i;
vector <int> v;
scanf("%d", &n);
for (i = 0; i < n; i++) {
int x;
scanf("%d", &x);
v.push_back(x);
}
sort(v.begin(), v.end());
... | ALGO | 0.999963 | 4.306099 |
daf80ddd-1998-4ad6-9040-5049b48aa1ef | simonmikkelsen/the-errors-tour-of-code | cpp/wavelet-ransform/wavelet-ransform_3.cpp | #include <stdio.h>
#include <stdlib.h>
// This delightful program is designed to perform a wavelet transform,
// a mathematical technique used to divide a continuous-time function into different scale components.
// It is a beautiful and intricate process, much like weaving a delicate tapestry of numbers and functions... | ALGO | 0.996146 | 5.331438 |
a895db90-0b82-4d7b-8917-35e6c3005c78 | InwooLeeme/Algorithm | Boj/13424.cpp | // 13424번 : 비밀 모임
#include <bits/stdc++.h>
#define X first
#define Y second
#define pb push_back
#define sz(a) int((a).size())
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
using namespace std;
using ll = long long;
using ull = unsigned long long;
using dbl... | ALGO | 0.999991 | 4.526867 |
40a3794a-a66f-4946-82d2-92911c09096d | sebastianripa/pbinfo | 2222 pbinfo/main.cpp | #include <iostream>
using namespace std;
int main()
{
long long n, k, p = 0;
cin >> n >> k;
while(n > 1)
{
p++;
n /= 10;
}
cout << 1;
k *= p;
for(int i = 1; i <= k; i++)
cout << 0;
return 0;
}
| ALGO | 0.999765 | 3.262982 |
128d7145-84c1-4971-9732-5b7f2a9e3e34 | abhikyadav/Coding | Min sum formed by digits - GFG/min-sum-formed-by-digits.cpp | // { Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
long long int minSum(int arr[], int n)
{
long long num1 =0, num2=0;
sort(arr, arr+n);
for(int i =0; i<n; i++)
{
if(i%2==0)
{
... | ALGO | 0.999907 | 6.633842 |
826b541c-332d-40f4-acbf-b399e19d14d4 | RitchieLab/biobin | tags/2.2.1/updater/loki/loadPops/ldspline/src/utility/lineparser.cpp | namespace LDUtility {
uint LineParser::Parse(const char *filename, AsciiParser *parser, bool keepComments) {
char line[MAX_LINE_LENGTH];
uint linesParsed = 0; //Keep up with what we've seen
uint lineCount = 0; //Used to know how many were skipped
ifstream file(filename, ios_base::in); //open file fo... | TOOL | 0.86003 | 5.3334 |
d9b7d218-d3ce-4cbf-82a5-1c34cee39a1a | handsomem1n/Algorithms_in_cpp | hw/hw4/DncMCSSgpt.cpp | // DnCMCSS.cpp보다 명료함
#include <iostream>
#include <vector>
#include <climits>
using namespace std;
int crossSum(const vector<int>& nums, int left, int mid, int right) {
int left_sum = INT_MIN;
int sum = 0;
for (int i = mid; i >= left; i--) {
sum += nums[i];
left_sum = max(left_sum, sum);
... | ALGO | 0.99992 | 5.94521 |
73fdecec-0208-4ead-95a8-24ba4b15e46d | TD21forever/goodgoodstudy_acm | 第十次作业/1001.cpp | #include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
//两直线相交 模板
struct point
{
double x,y;
};
point m1[100],m2[100];
double min(double x,double y)
{
return x<y?x:y;
}
double max(double x,double y)
{
return x>y?x:y;
}
double direction(point pi,point pj,point pk)//二维叉乘 有... | ALGO | 0.998116 | 3.794912 |
bd968bc4-75cf-4285-a2df-233da3a106ba | yegnesh22/CPP | workspace/Programming/SearchInsertPos/src/Solution.cpp | /*
* Solution.cpp
*
* Created on: Jan 12, 2022
* Author: ysiyer
*/
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int pos = 1;
int start = 0;
int end = nums.size() - 1;
if (end < 0)
return 0;
if (target <... | ALGO | 0.999892 | 6.333665 |
ad4e66c0-de34-4193-848a-5c86fc892d56 | Ananthpragath/DataStructures | linkedstack.cpp | //linked stack
#include<iostream>
using namespace std;
struct node
{
int data;
node *link;
};
struct Header
{
int count;
node *top;
};
class LinkedStack
{
node *pNew,*temp;
Header *Stack;
public:
LinkedStack()
{
Stack=new Header;
Stack->count=0;
Stack->top=NULL;
}
vo... | ALGO | 0.998941 | 3.644634 |
d4e0806d-2b60-489d-aa5e-9610df96411d | humanwhoexplores/CodeChef-codes- | chef_GRID.cpp | #include<stdio.h>
int matrix[1000][1000];
int main()
{ int T,N,i,j,temp,count; char array[1001];
scanf("%d",&T);
while(T--)
{ scanf("%d",&N);
count=0;
for(i=0;i<N;i++)
{
for(j=0;j<N;j++)
{ matrix[i][j]=0;}
}
for(i=0;i<N;i++)
{
scanf("%s",array);
fo... | ALGO | 0.999678 | 3.050753 |
03e37443-17b0-4b0d-8191-cd2d2892ff6b | insorker/CMU_15-445 | src/optimizer/optimizer_custom_rules.cpp | #include "execution/plans/abstract_plan.h"
#include "optimizer/optimizer.h"
// Note for 2023 Spring: You can add all optimizer rule implementations and apply the rules as you want in this file.
// Note that for some test cases, we force using starter rules, so that the configuration here won't take effects.
// Starter... | ALGO | 0.925314 | 6.565825 |
d92bcbee-a833-402d-a3c8-e7c42dd9dd2c | keqhe/leetcode | round1/leetcode32.cpp |
class Solution {
public:
//ref: http://www.hrwhisper.me/leetcode-longest-valid-parentheses/
int longestValidParentheses(string s) {
if (s.empty())
return 0;
stack<int> left;
vector<bool> match(s.length(), false);
for (int i = 0; i < s.length(); i ++) {
... | ALGO | 0.999812 | 5.819073 |
127b7f36-f9f7-4599-a480-fb8a7391de72 | CrackerCat/Qingyue | module/jni/libcxx/test/std/algorithms/alg.sorting/alg.binary.search/binary.search/ranges.binary_search.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// UNSUPPORTED: libcpp-has-no-incomplete-ranges
// template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
// indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
// constexpr bool ranges::binary_search(I first, S la... | TEST | 0.988242 | 7.731969 |
7e94be0b-52b3-4f81-b174-31fa60e1804d | SETURAJ/LeetCode-Solutions | rotate-list/Accepted/6-14-2022, 7_37_49 AM/Solution.cpp | // https://leetcode.com/problems/rotate-list
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
clas... | ALGO | 0.999979 | 5.796299 |
d20b1309-12fc-440b-a6b2-673c174c9859 | xiezilailai-xkh/MS_DAKA | Week32/k-th-symbol-in-grammar.cpp | class Solution {
public:
int dp(int N, int k){
if(N == 0)return 0;
if(N == 1) return k;
int p = k & 1;
int last = dp(N-1, k >> 1);
if(last == 0){
return p;
}else{
return 1-p;
}
}
int kthGrammar(int N, int k) {
return dp(... | ALGO | 0.999989 | 5.77278 |
a2f96e34-af5a-423a-8d1c-d380bb856b93 | koritafei/leetcode | dp/174.dungeon-game.cpp | /*
* @lc app=leetcode id=174 lang=cpp
*
* [174] Dungeon Game
*
* https://leetcode.com/problems/dungeon-game/description/
*
* algorithms
* Hard (35.73%)
* Likes: 3552
* Dislikes: 70
* Total Accepted: 157.8K
* Total Submissions: 440.9K
* Testcase Example: '[[-2,-3,3],[-5,-10,1],[10,30,-5]]'
*
* The ... | ALGO | 0.999861 | 6.744294 |
afca4c74-1dce-40f4-8218-f529a1701c00 | jrem090/Raytracer | source/sphere.cpp | #include "sphere.h"
sphere::sphere()
{
}
sphere::sphere(vec3 cen, float r, material *m) :
center(cen),
radius(r),
mat(m)
{
}
bool sphere::hit(const ray &r, float t_min, float t_max, hit_record &rec) const
{
vec3 oc = r.origin()-center;
float a = dot(r.direction(),r.direction());
float b = 2... | ALGO | 0.980207 | 6.160684 |
d946fb74-8082-4a98-9e8f-befd1741b2de | ishandutta2007/codeforces | nightglow/normal/1096/D.cpp | #include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<ctime>
#include<set>
#include<vector>
#include<map>
#include<queue>
#define N 300005
#define M 8000005
#define ls (t<<1)
#define rs ((t<<1)|1)
#define mid ((l+r)>>1)
#define mk make_p... | ALGO | 0.999806 | 3.385847 |
9f1e1ceb-20e7-48b3-ad18-4fb2edd58688 | 1234dtg/Course-Projects | CS 101/Lab02/plate.cpp | #include <simplecpp>
main_program
{
turtleSim();
penUp();
forward(-20);
right(-90);
forward(200);
right(45);
penDown();
repeat(20)
{
forward(45);
repeat(65)
{
forward(0.45);
right(-3.6);
}
forward(45);
repeat(70... | ALGO | 0.941728 | 4.180752 |
fdee5062-05ab-4b7f-ae08-a0a55689d510 | TDK1969/My-Leetcode | algorithm/Greed/121_stock_profit.cpp | #include <cstdio>
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
return 0;
}
class Solution {
public:
int maxProfit(vector<int>& prices) {
int maxearn = 0;
int buy = 0;
for (int i = 1; i < ... | ALGO | 0.999959 | 5.321826 |
bc8dc2ca-ceaa-4d3f-a45e-e9782e0bae6e | shamilkeheliya/Hacktoberfest-22 | heap_sort.cpp | #include <iostream>
using namespace std;
// To heapify a subtree rooted with node i which is
// an index in arr[]. n is size of heap
void heapify(int arr[], int n, int i)
{
int largest = i; // Initialize largest as root
int l = 2 * i + 1; // left = 2*i + 1
int r = 2 * i + 2; // right = 2*i + ... | ALGO | 0.999992 | 5.337526 |
6aef41bc-2d8d-4656-9a6d-667665ee3a29 | FFernandez3/flutter_bootcamp | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
54f3049a-24b8-4920-b281-043dd054cefb | googleknight/HackerRank_Solutions | algorithms/implementation/Jumping on the Clouds.cpp | //https://www.hackerrank.com/challenges/jumping-on-the-clouds
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, arr[101],count(0);
cin>>n;
for(int i=0;i<n;i++)
cin>>arr[i];
for(int i=0;i<n;)
{
if(i<(... | ALGO | 0.999977 | 3.769738 |
bd176fcc-1629-4e2d-8ab1-4780993ad8e2 | vkd01/100-DAYS-of-C0DE | A_Beautiful_Year.cpp | // Life Goes on and you Learn from it !! -Steve Jobs
/*
Author : Vimal Kumar Dubey
! Instead of Copying my Template .....Get INSPIRED and Create a unique one //
**************************************************************************************************
You love to watch Do... | ALGO | 0.999205 | 3.782591 |
d948fbb9-b3a5-4940-971f-a0fcfed21566 | tffdev/coding_interview_practice | first_and_last_int_in_sorted_array.cpp | /* Given a sorted array, A, with possibly duplicated elements,
find the indices of the first and last occurrences of a target
element, x. Return -1 if the target is not found. */
#include <iostream>
#include <string>
#include <vector>
struct Range {
int start = -1;
int end = -1;
};
Range find_target_range(std:... | ALGO | 0.999833 | 6.408128 |
9af92ffe-72bf-4955-b5e9-29343ea7d7db | zaburo-ch/icpc_practice | sieve_good.cpp | #include <iostream>
#include <algorithm>
using namespace std;
bool is_prime[10000001];
int main(){
fill(is_prime,is_prime+10000001,true);
is_prime[0] = false; is_prime[1] = false;
for(int i=2;i<10000001;i++){
if(is_prime[i]){
for(int j=2*i;j<10000001;j+=i){
is_prime[j] ... | ALGO | 0.999215 | 4.424925 |
8f4af3e6-7f82-4de4-b61d-8831996badeb | Fabolin99/Artillery-Simulator | angle.cpp | /***********************************************************************
* Source File:
* ANGLE
* Author:
* Fabian Diaz Santiago and Josue Molina
* Summary:
* Everything we need to know about a direction
************************************************************************/
#include "angle.h"
#inclu... | TOOL | 0.993534 | 5.426625 |
560ff44c-cfa7-4e0a-895d-f59cbc861f05 | Brijesh3746/DSA-Brijesh | Recursion/class3.cpp | #include<iostream>
using namespace std;
bool isSorted(int arr[],int size,int i){
if(i >= size) return true;
if(arr[i] > arr[i-1]){
// aage check krlo
// aage ka kam reecursion smbhal lega
bool aageKaAns = isSorted(arr,size,i+1);
return aageKaAns;
}
}
int binaSearch(int a... | ALGO | 0.999908 | 3.785846 |
ca2f7332-cc3d-4982-9c5b-52fa904e5aca | tanjummotin/Competitive-Programming | UVA/272.Tex quotes.cpp | ///in the name of ALLAH
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
string s;
ll c=0;
while(getline(cin,s))
{
for(int i=0;i<s.size();i++)
{
if(s[i]=='"')
{
c++;
if(c%2!=0)
{
s.replace(i,1,... | ALGO | 0.995117 | 3.296745 |
5f0f131a-050f-4d68-a8c1-3f44745aa60d | AmmarHamim/IWT-Lab | Practice/insertionInLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public:
int data;
Node* next;
public:
Node(int val)
{
data=val;
next=nullptr;
}
Node(int val,Node* ptr)
{
data=val;
next=ptr;
}
};
void displayLL(Node* head)
{
Node* temp=head;
while(... | ALGO | 0.999954 | 4.13837 |
0814f9ad-7da1-424d-8385-2fac3df5ad13 | YeonjaeLee/DIAMONDGAMES | Algorithms/Algospot/MERCY/MERCY/main.cpp | #include<stdio.h>
/*
The administrators of algospot.com are so merciful, that they prepared really, really easy problem to prevent contestants from frustration.
Է
Input contains just one positive integer N(N <= 10).
Print N lines. Every line should contain 'Hello Algospot!'(quotation marks for clarity) and nothing... | ALGO | 0.889254 | 3.297076 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.