uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
fbcd354f-c63d-4810-a714-d58c6a23ee74 | pankajbhatt150/LeetCode-Question-DSA-14-days- | 334-increasing-triplet-subsequence/334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int n=nums.size();
int l,m,r;
l=m=r=INT_MAX;
for(int i=0;i<n;i++){
if(nums[i]<=l)l=nums[i];
else if(nums[i]<=m) m=nums[i];
else return true;
}
return false;
}
}; | ALGO | 0.999979 | 5.76766 |
9a2db7cb-4956-45a5-81a3-a822cc186153 | praymeta/Code-Up-Algorithm | BOJ_14918_Plus.cpp | #include <iostream>
using namespace std;
int main(void) {
int a, b;
cin >> a >> b;
cout << a + b;
}
| ALGO | 0.989445 | 3.430511 |
57d13793-3f6d-454e-93b9-7ca5dbf67956 | Priyo002/6Companies30Days-Challenge-ArshGoyel | Google/LC-211.cpp | #include<bits/stdc++.h>
using namespace std;
class TrieNode {
public:
char data;
TrieNode* children[26];
bool isTerminal;
TrieNode(char val) {
this->data = val;
for (int i = 0; i < 26; i++) {
children[i] = NULL;
}
this->isTerminal = false;
}
};
class WordDictionary {
public:
TrieNode *root;
WordDic... | ALGO | 0.999633 | 5.537557 |
af3aaa32-edb0-4823-aa22-47893778adbe | zhixiongruan/MPC-Project | src/Eigen-3.3/bench/perf_monitoring/gemm/lazy_gemm.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <Eigen/Core>
#include "../../BenchTimer.h"
using namespace Eigen;
#ifndef SCALAR
#error SCALAR must be defined
#endif
typedef SCALAR Scalar;
template<typename MatA, typename MatB, typename MatC>
EIGEN_DONT_INLINE
void lazy_gemm(const MatA &A, const Ma... | ALGO | 0.972297 | 6.117427 |
32372473-0a94-4244-b17a-2d4df07716ae | francescoConforti/ROS2_tutorials | src/my_cpp_pkg/src/go_to_goal.cpp | #include "cmath"
#include "geometry_msgs/msg/twist.hpp"
#include "rclcpp/rclcpp.hpp"
#include "turtlesim/msg/pose.hpp"
/* *************************************************************************************
Keeping this just as history.
For a version that actually works well, check the turtlesim_project_cpp p... | TOOL | 0.893107 | 5.054085 |
87224bbe-f4cd-466b-a676-185eb1378ae0 | nikhil-edulakanti/bank_testing | testing/mutants/BankAccount.mutant.5.cpp | #include <iostream>
#include <vector>
#include <string>
#include <ctime>
using namespace std;
// Enum for different account types
enum AccountType
{
SAVINGS,
CHECKING,
INVALID
};
// Transaction struct to store transaction details
struct Transaction
{
string timestamp;
string type; // "deposit" or... | TOOL | 0.897845 | 7.068769 |
e4072c23-7abc-44df-bb25-2065e0eba3e4 | qutrol3264/parsec | pkgs/libs/ssl/src/crypto/ripemd/asm/rips.cpp | //
// gettsc.inl
//
// gives access to the Pentium's (secret) cycle counter
//
// This software was written by Leonard Janke (<EMAIL>)
// in 1996-7 and is entered, by him, into the public domain.
#if defined(__WATCOMC__)
void GetTSC(unsigned long&);
#pragma aux GetTSC = 0x0f 0x31 "mov [edi], eax" parm [edi] modify [ed... | TOOL | 0.862573 | 4.080586 |
031e8eae-2d99-412f-a025-857c92a56cff | ishandutta2007/codeforces | mhq/normal/1552/C.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
const int maxN = 205;
int x[maxN], y[maxN];
bool marked[maxN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
// freopen("input... | ALGO | 0.999959 | 3.889491 |
c84819bf-79c5-4d45-a203-c4a16896ce1f | donghak937/baekjoon | C++/프로그래머스/0/181895. 배열 만들기 3/배열 만들기 3.cpp | #include <string>
#include <vector>
using namespace std;
vector<int> solution(vector<int> arr, vector<vector<int>> intervals) {
vector<int> answer;
for(int i = 0; i < intervals.size(); i++){
for(int j = intervals[i][0]; j <= intervals[i][1]; j++) {
answer.push_back(arr[j]);
}
}... | ALGO | 0.999886 | 5.556522 |
9d5877d1-ca7a-4c51-8785-85208c3cc78d | Siranjiv/DataStructuresAndAlgorithms | WorkSpace/6. Hash Tables/Q_solution2.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
bool itemInCommon(vector<int> vect1, vector<int> vect2) {
unordered_map<int, bool> myMap;
for(auto i : vect1) {
myMap.insert({i, true});
}
for(auto j : vect2) {
if(myMap[j]) return true;
}
... | ALGO | 0.999408 | 5.656812 |
78949029-cb98-418f-a8af-4821013bb530 | alibaba/nann | blaze-benchmark/thirdparty/boost_1_53_0/libs/graph/example/read_write_dimacs-eg.cpp | #include <boost/config.hpp>
#include <iostream>
#include <string>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/read_dimacs.hpp>
#include <boost/graph/write_dimacs.hpp>
/*************************************
*
* example which reads in a max-flow problem from std::cin, augments all paths from
* sourc... | ALGO | 0.995475 | 6.844003 |
5d91681a-54e2-4924-94cb-a7fb88c5a9d2 | dhiman-64/DataStructures | 09_Arrays/buySell.cpp | #include<bits/stdc++.h>
using namespace std;
int buySell(int arr[] , int n)
{
int minPrice = INT_MAX;
int profit = 0;
for(int i=0 ; i<n ; i++)
{
minPrice = min(minPrice , arr[i]);
profit = max(profit , arr[i]-minPrice);
}
return profit;
}
int main()
{
int n;
cin>>n;
... | ALGO | 0.999778 | 4.637413 |
d3c6352e-0d1b-44e9-943c-3aeb5fbaca2a | j-jorge/bear | bear-factory/bear-editor/src/bf/opaque_rectangle/code/ler_solver.cpp | /**
* \file
* \brief Implementation of the ler_solver class.
* \author Sebastien Angibaud
*/
#include "bf/opaque_rectangle/ler_base_problem.hpp"
#include "bf/opaque_rectangle/ler_solver.hpp"
/*----------------------------------------------------------------------------*/
/**
* \brief Constructor.
* \param pb The... | ALGO | 0.999981 | 5.170166 |
7b5470d3-c790-4729-891b-46cfe98f9fdb | Sergioo29/cs165 | check10a.cpp | /***********************************************************************
* Program:
* Checkpoint 10a, Vectors
* Brother Alvey, CS165
* Author:
* Sergio Henrique
* Summary:
* Summaries are not necessary for checkpoint assignments.
************************************************************************/
#inc... | ALGO | 0.989135 | 4.462079 |
81e10098-6102-4701-a9c3-a840ec38357c | Gaon-Choi/BOJ | 10813.cpp | #include <iostream>
void swap(int* a, int* b) {
int temp;
temp = *a;
*a = *b;
*b = temp;
return;
}
int main(void) {
int size, count;
std::cin >> size >> count;
int* arr = new int[size];
for (int i = 0; i < size; i++)arr[i] = i + 1;
int a, b;
for (int i = 0; i < count; i++) {
std::cin >> a >> b;
swap(&a... | ALGO | 0.999962 | 3.601977 |
e08083fc-6246-4689-8205-e17806e04ef1 | linnahu/StonyBrook | AMS_595/C++/c++_HW1_2.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int error;
cout << "input the maximum acceptable error : " << endl;
cin >> error;
int N = 1;
int D;
D = 1 / N;
do
{
int i;
int x[N];
for (i = 1; i <= N; i++)
{
x[i] = i*D;
}
int fx[N];
for (i = 1; i <= N; i++)
{
... | ALGO | 0.99988 | 3.484173 |
cc10f7be-76c5-493d-a3e5-1ab8257391ff | Subrat29/100DaysCodingChallenge | Trees/K Sum Paths/app2.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct Node
{
int data;
Node *left;
Node *right;
Node(int val)
{
data = val;
left = right = NULL;
}
};
// Recursive utility function to calculate the count of paths with given sum
void sumK_util(No... | ALGO | 0.999965 | 5.096785 |
56592a8f-ec52-4b30-bbb2-0bee3a7d0dc5 | ngxmha/PTIT | CPP/cpp0414.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin >> t;
while(t--){
int n; cin >> n;
set<int> se;
for(int i = 0; i < n; i++){
long long x;
cin >> x;
while(x){
se.insert(x%10);
x /= 10;
}
}
for(int x : se){
cout << x << " ";
}
cout << endl;
}
} | ALGO | 0.999733 | 5.312642 |
c6a7490c-053f-4418-9ff6-52afe6fa54a0 | darkwuta/-CSC417-Assignment | Assignment3/extern/libigl/include/igl/shape_diameter_function.cpp | template <
typename DerivedP,
typename DerivedN,
typename DerivedS >
IGL_INLINE void igl::shape_diameter_function(
const std::function<
double(
const Eigen::Vector3f&,
const Eigen::Vector3f&)
> & shoot_ray,
const Eigen::PlainObjectBase<DerivedP> & P,
const Eigen::PlainObjectBase<Derive... | ALGO | 0.999569 | 7.082757 |
575af4df-139c-416b-baf8-a26958fea1a0 | thahn1230/llama.cpp.android | ggml/src/ggml-sycl/norm.cpp | #include "norm.hpp"
#include "ggml-sycl/common.hpp"
#include "ggml-sycl/presets.hpp"
static void norm_f32(const float* x, float* dst, const int ncols, const int64_t stride_row, const int64_t stride_channel,
const int64_t stride_sample, const float eps, const sycl::nd_item<3>& item_ct1, sycl::float2* s_sum, int... | ALGO | 0.960247 | 6.099164 |
728fd6d4-e326-47ed-b5c0-2adbf29df1a9 | ishandutta2007/codeforces | sert/normal/753/A.cpp | #include <bits/stdc++.h>
using namespace std;
void init() {
#if __GNUG__ == 4 && __GNUC_MINOR__ == 9 ///my GNU version is 4.9.3
freopen("a.in", "r", stdin);
///freopen("a.out", "w", stdout);
#endif
}
typedef long long ll;
typedef long double ld;
const int N = (int)1e6 + 34;
const ll INF = 1e10;
ll c[N], d[N];... | ALGO | 0.999959 | 3.647721 |
67dd2c34-3c4d-48ac-b95c-44a1bedce121 | mguerci/cartesian_throw | panda_controllers/src/trajectory.cpp | // #include <franka_gripper/franka_gripper.h>
#include <franka/gripper.h>
#include <franka/exception.h>
#include <franka/gripper_state.h>
// #include <franka_gripper/GraspAction.h>
// #include <franka_gripper/HomingAction.h>
// #include <franka_gripper/MoveAction.h>
// #include <franka_gripper/StopAction.h>
#include </... | ALGO | 0.972892 | 4.767643 |
6e73788c-0a82-4700-9263-d6db02d8d6e7 | AmanGupt2020/dsa_practice_6 | Playlist.cpp | #include <iostream>
using namespace std;
int main() {
// your code goes here
int t;
int x,n;
std::cin >> t;
while(t--){
std::cin >> n>>x;
cout<<n/(3*x)<<endl;
}
return 0;
}
| ALGO | 0.999684 | 3.846361 |
7db78913-0bb2-4019-a3d8-9164edabd8ab | brickgao/WOJ-learn | 1029.cpp | //By Brickgao
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
using namespace std;
#define out(v) cerr << #v << ": " << (v) << endl
#define SZ(v) ((int)(v).size())
const int maxint = -1u>>1;
template <class T> bool get_max(T& a, const T... | ALGO | 0.999044 | 3.567639 |
bbbcc382-18e4-418e-95cb-c0dd84a0a26d | haribo841/Cpp-challenges | ConsoleApplication1/068 First and Last Character of a String.cpp | //Create a function that takes a string and returns the concatenated first and last character.
#include "068 First and Last Character of a String.h"
std::string FirstLast(std::string str) {
std::string result = "";
result += str[0];
result += str[str.length() - 1];
return result;
} | TOOL | 0.964881 | 5.423043 |
b212d15e-b7b6-46dc-a924-f517fafef2ad | SCahmedmohamed/Competitive-Programming | codeforces/131A. cAPS lOCK.cpp | // By Ahmed Mohamed Scorpion . Jul/27/2022 18:09
#include <iostream>
using namespace std;
int i;
string s;
main() {
cin>>s;
for(i=1;i<s.size();i++) if(s[i]>91){cout<<s; return 0;}
if(s[0]>91)s[0]-=32;
else s[0]+=32;
for(i=1;i<s.size();i++) s[i]+=32;
cout<<s;
}
| ALGO | 0.989819 | 3.384041 |
491032f9-f621-4d93-9d81-eaf4e0fc13ca | tkguswls1106/ProblemSolving-cpp | Algorithm/BackTracking_BOJ-1182_BEST.cpp | #include <vector>
#include <iostream>
using namespace std;
int n,s;
vector<int> iV; // 전체 수열
int cnt = 0;
void func(int k, int sum) {
if(k == n) { // 안더해도 k+1을 해주므로 개수는 최종적으로 k가 n이 되긴 해야함.
if(sum == s) {
cnt++;
}
return;
}
// 이 문제는 가짓수당 각각 for문으로 visited를 확인하고 그에 맞춰... | ALGO | 0.999925 | 4.177601 |
d4800d5b-9cba-4c5a-adee-b2222737842c | Edlward/code | sqlite/face/face.cpp | #include "face.h"
#include <iostream>
#define APPID_D "6EtR9RZUeC55yirVhnz95fVJbB3YLKGnjyuogDKMLtYY"
#define SDKKEY_D "ERmWGed5GcWtsE9WGG22u9d2JTpaqQewRd6vzHyijJmx"
#define APPID_R "6EtR9RZUeC55yirVhnz95fVJbB3YLKGnjyuogDKMLtYY"
#define SDKKEY_R "ERmWGed5GcWtsE9WGG22u9d9Ts5o4HUJL6c3kSjLRLMK"
#define INP... | TOOL | 0.882685 | 4.290423 |
3e5bac46-a99d-4b45-9d3a-4c2a9bcb3095 | eggag32/Competitive-Programming | Codeforces/Tests for problem D.cpp | #pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl
#define debug2(x, y) debug(x), debug(y)
#define repn(i, a, b) for(int i ... | ALGO | 0.999991 | 4.482355 |
089ea2a4-5b10-4f24-a4e5-0a8a601867e6 | serkancam/bo2425 | temeller/segment_tree.cpp | //segment tree algoritmasi
//1-)aralik sorgusu (max sorgusu bu kod icin) yapmak
//2-)nokta update yapmak
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
int n,a[100005],PS[100005],tree[400005];
void build(int node,int start,int end){
if(start==end){tree[node]=a[start];retu... | ALGO | 0.999802 | 4.971272 |
2e79640a-69f3-434d-b023-539f9bd4c3eb | jayeshpatel8/Coding-Practise-using-Leetcode-Coding-Platform | problems/odd_even_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:
ListNode* oddEvenList... | ALGO | 0.999956 | 5.953517 |
e4237839-c36e-48fc-aaaf-3bdc09b8c3f2 | codacy-open-source-projects-scans/gpdb | src/backend/gporca/libgpopt/src/operators/CPhysicalUnionAll.cpp | #include "gpopt/operators/CPhysicalUnionAll.h"
#include "gpos/error/CAutoTrace.h"
#include "gpopt/base/CColRefSetIter.h"
#include "gpopt/base/CDistributionSpecReplicated.h"
#include "gpopt/base/CDistributionSpecStrictRandom.h"
#include "gpopt/base/CDrvdPropCtxtPlan.h"
#include "gpopt/operators/CExpressionHandle.h"
#i... | ALGO | 0.899011 | 6.818256 |
9a362580-6eb0-461a-b594-80d54241a06b | amingaalex/cppprograming | fine for ovverdue libray books.cpp |
/*Authour: Alex Abere
Reg No.: BSCIT-05-0063/2024
Date:17/03/2025
Version 1*/
#include <iostream>
using namespace std;
int main() {
int bookID, dueDate, returnDate;
int daysOverdue, fineRate, fineAmount;
// Get user inputs
cout << "Enter Book ID: ";
cin >> bookID;
cout << "Enter Due Date (as ... | TOOL | 0.969475 | 5.485341 |
2e580efb-6ebf-4738-a60d-0318150376d3 | LosReturn/AC_dream | leetcode/461.汉明距离.cpp | /*
* @lc app=leetcode.cn id=461 lang=cpp
*
* [461] 汉明距离
*/
// @lc code=start
class Solution {
public:
int hammingDistance(int x, int y) {
int _xor = x^y;
int ret = 0;
while(_xor!=0)
{
_xor&=(_xor-1);
ret++;
}
return ret;
}
};
// @lc co... | ALGO | 0.999921 | 5.853274 |
2017f623-201b-455e-9b6e-928fa5722789 | tanyardr/hackerrank | Tree_Preorder_Traversal.cpp | /* you only have to complete the function given below.
Node is defined as
struct node
{
int data;
node* left;
node* right;
};
*/
void preOrder(node *root) {
if (root == NULL) return;
cout<<root->data<<' ';
preOrder(root->left);
preOrder(root->right);
}
| ALGO | 0.999852 | 5.109063 |
d016742b-fc86-4ffa-8512-a0ace2897679 | tanmaypardeshi/CPP-Programs | Programs/P52.CPP | /*Using copy constructor determine and display factorial value of any
given while no.*/
#include<iostream.h>
#include<conio.h>
class Factorial
{
int no;
long unsigned int fv;
public:
Factorial(int,long unsigned int f=1);
Factorial(const Factorial &);
};
Factorial::Factorial(int n,long unsigned int f)
{
no=n... | ALGO | 0.992928 | 3.742213 |
11edc3a7-64bf-4ddf-95f3-db4a4b5bcad6 | mouda/Steven | lib/CORRE_MA_OPE.cpp | #include <iostream>
#include <cmath>
#include <cfloat>
#include <cassert>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <armadillo>
#include "CORRE_MA_OPE.h"
#include "../lib/cholesky.hpp"
using namespace std;
//using namespace boost::numeric;
CORRE_MA_OPE::CORRE_MA_OPE(int ... | ALGO | 0.999415 | 3.781205 |
91825eae-0969-4aa7-9b3b-bea35cca9ed1 | gustawho/twitcurl | SHA1.cpp | /*
100% free public domain implementation of the SHA-1 algorithm
by Dominik Reichl <<EMAIL>>
Web: http://www.dominik-reichl.de/
Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches)
- You can set the endianness in your files, no need to modify the
header file of the CSHA1 class any more
- Aligned ... | ALGO | 0.910131 | 6.777736 |
18a22f4b-867f-4897-bedf-1e894ef54905 | tcmytt/Algorithm | Problems/31NextPermutation.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> DeQuy(vector<int> nums){
return {000};
}
bool TangDanDeu(vector<int> arr,int n){
bool isIncreasing = true;
for (int i = 0; i < n-1; ++i) {
if (arr[i] > arr[i + 1]) {
... | ALGO | 0.999965 | 4.888787 |
7a22c317-f2a7-4680-9893-430ffe5d3be0 | joshualass/CP | Solutions/Contests/AC/ABC412/B412.cpp | #include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s, t; cin >> s >> t;
int ok = 1;
for(int i = 1; i < s.size(); i++) {
if(s[i] <= 'Z') {
if(t.find(s[i-1]) == std::... | ALGO | 0.999986 | 4.957565 |
764d668c-2d16-47ba-938e-8fd56206eeb0 | jmcsuite/SolvingPercebe | Codeforces/2039/C2/C.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
const int maxn = 1e6;
ll x, M;
ll howMany(ll bits, ll mod) {
mod %= x;
ll nums = (1ll << bits) - 1;
nums -= mod;
if (nums < 0) return 0;
return (nums / x) + 1;
}
ll dp() {
ll ans = 0;
for (ll i = 6... | ALGO | 0.999844 | 5.106307 |
a8d83fa5-8ae8-4b4f-b86f-f6e331cf50e6 | k-tanotra/LeetCode | problems/reorder_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 len(ListNode* hea... | ALGO | 0.999956 | 5.871017 |
5bb94d5b-564e-462f-a4c0-975f8fcc8664 | SumiTRawaTX/DSA-CODES | CODES/Linked List/PracticeQuestion/MergeTwoList.cpp | class Solution {
public:
ListNode* mergeTwoLists(ListNode* left, ListNode* right) {
if(left == 0) return right;
if(right == 0) return left;
ListNode* ans = new ListNode(-1);
ListNode* mptr = ans;
while(left && right) {
if(left->val <= right->val) {
... | ALGO | 0.999988 | 5.988201 |
28ddbc9b-91d9-443f-ad96-f1b614c0b190 | carttman/Backjoon | Backjoon/1978_소수 찾기.cpp | #include <iostream>
using namespace std;
int main()
{
int N, result = 0;
int temp, cnt = 0;
cin >> N;
for (int i=0; i<N; i++)
{
cin >> temp;
for (int j=1; j<=temp; j++)
{ //
if (temp % j == 0)
{
cnt++;
}
}
// Ҽ ߰
if (cnt == 2)
{
result++;
}
cnt = 0;
}
cout << result <<... | ALGO | 0.999727 | 4.150361 |
94c12227-0d35-48b2-a6e6-23cdf5ba21e7 | sahil1415/DSA_Problems | bookAllocation.cpp | #include<bits/stdc++.h>
using namespace std;
int maxim(vector<int> v1,int n1){
int maxi = 0;
for(int i = 0; i<n1; i++){
maxi = max(maxi, v1[i]);
}
// cout<<"max of array="<<maxi<<endl;
return maxi;
}
int summ(vector<int> v2, int n2){
int sum = 0;
for(int i=0; i<n2; i++){
su... | ALGO | 0.999928 | 4.43673 |
7bcb9ed5-7fff-4d8c-b3b3-0aaadcd1dffb | ajita-asthana/Algorithms-and-Papers | linkedinListstructure.cpp | # Define a node
#include<iostream>
class Node {
int data;
Node* next;
// Constructor
Node(int val) {
data = val;
next = nullptr;
}
};
# Define linked list class
class LinkedList {
private:
Node* head;
public:
LinkedList() {
head = nullptr;
}
// Insert at end
void insert(int val) ... | ALGO | 0.995667 | 4.852153 |
22a5a48d-3fca-45f9-8730-2bfc24f3f3c5 | manojborugadda/Leetcode-questions | 1631-path-with-minimum-effort/1631-path-with-minimum-effort.cpp | class Solution {
public:
int minimumEffortPath(vector<vector<int>>& heights) {
// for having the minimum value using MIN HEAP
priority_queue<vector<int>,vector<vector<int>>,greater<vector<int>>>pq;
// for direction in all 4 sides
vector<vector<int>>dir = {{0,-1},{-1,0},{0,1}... | ALGO | 0.999992 | 6.194735 |
d573f67c-f8db-4fe2-a4df-cc8bd2b893f1 | Yang2096/snippet | leetcode/minmax/486.cpp | #include "pch.h"
bool PredictTheWinner(vector<int> &nums)
{
int n = nums.size();
if (n <= 2)
return true;
vector<vector<pair<int,int>>> dp(n + 1, vector<pair<int,int>>(n + 1, make_pair(0,0)));
for (int i = 1; i <= n; ++i)
{
dp[i][i].first = nums[i - 1];
for (int j = i - 1; ... | ALGO | 0.999993 | 4.981174 |
0104bac8-76ec-4355-b9c0-301da5e37387 | LezamaLeonardo/3erParcial2.0 | activ23.cpp | #include<iostream>
using namespace std;
#include<math.h>
int main(){
int n;
int p;
cout<<"dime el numero que quieres elevar";
cin>>n;
cout<<"dime la potencia";
cin>>p;
float resultado=pow(n,p);
cout<<numero<< " elevado a la potencia de" <<potencia<< "es" <<resultado<<endl;
return 0;
}
| ALGO | 0.998737 | 4.134255 |
86f567b5-023f-4189-894f-01232513d71d | DuCLeK65t/LTNC_25 | Week 5/C7.cpp | #include <iostream>
#include <cmath>
using namespace std;
void output(int n);
int main()
{
int n;
cin >> n;
output(n);
return 0;
}
void output(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = -n; j <= n; j++)
{
if (abs(j) < i)
cout << "*";
else
... | ALGO | 0.999937 | 3.59862 |
34ef049e-1fcc-437e-9a4c-fc96fc1a9c76 | omarkahol/cmp | src/finite_diff.cpp | #include <finite_diff.h>
namespace cmp {
std::vector<double> external_stencil(const accuracy &accuracy)
{
switch (accuracy) {
case SECOND:
return { { 1, -1 } };
case FOURTH:
return { { 1, -8, 8, -1 } };
case SIXTH:
ret... | ALGO | 0.997492 | 6.191316 |
f67c4832-8702-4b86-a08f-77726bb290ac | HarriOrri/GP2021-Assignments | libigl/include/igl/histc.cpp | template <typename DerivedX, typename DerivedE, typename DerivedN, typename DerivedB>
IGL_INLINE void igl::histc(
const Eigen::MatrixBase<DerivedX > & X,
const Eigen::MatrixBase<DerivedE > & E,
Eigen::PlainObjectBase<DerivedN > & N,
Eigen::PlainObjectBase<DerivedB > & B)
{
histc(X,E,B);
const int n = E.size... | ALGO | 0.997047 | 5.427778 |
7da8cb2d-5031-46c3-a125-e5b463ce1cc0 | yuhi-dev/AtCoder | tessoku/answer/codes/cpp/chap08/answer_A51.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
int Q;
int QueryType[100009]; string x[100009];
stack<string> S;
int main() {
// 入力
cin >> Q;
for (int i = 1; i <= Q; i++) {
cin >> QueryType[i];
if (QueryType[i] == 1) cin >> x[i];
}
// クエリの処理
for (int i = 1; i <= Q; i++) {
if (... | ALGO | 0.998704 | 4.919986 |
c142f3eb-c23e-4f19-9bc9-d6c3e81bbf89 | HarshDex/All-Programs | c++/basic practice questions/allpossiblesubsetIn.cpp | #include <iostream>
#include<math.h>
using namespace std;
void allPossible(int ar[],int n)
{
int count = pow(2,n);
for(int i =0;i<count;i++)
{
for(int j= 0;j<n;j++)
{
if( (i & (1<<j)) !=0)
cout<<ar[j]<<" ";
}
cout<<endl;
}
}
int main()
{
in... | ALGO | 0.99959 | 4.205082 |
84d8d7dd-3640-4adb-8324-f98e70982bff | IvanFrost23/Tasks | acmp/acmp340.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector <int> a;
vector <int> b;
for (int i = 0; i < 3; i++)
{
int x;
cin >> x;
a.push_back(x);
}
for (int i = 0; i < 3; i++)
{
int x;
cin >> x;
... | ALGO | 0.999928 | 3.865838 |
e0281692-6022-4f38-9ff4-5aaaf9d9d2de | Bungmint/competitiveprogramming | contest/atcoder/ABC167/C.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX = 1e9 + 7;
int arr[14][14];
int total[14];
int cost[14];
int n, m, x;
int is_pos(int num)
{
string binary = bitset<12>(num).to_string();
int cost1 = 0;
vector<int> skills(m + 1);
for (int i = 0; i < n; i++)
{
if (binary[11 - i] ==... | ALGO | 0.999891 | 4.441143 |
64974d0d-c832-4f89-8709-93f4a79d54cd | thirt33n/leetcode-solutions | 1951-find-the-winner-of-the-circular-game/find-the-winner-of-the-circular-game.cpp | class Solution {
public:
int findTheWinner(int n, int k) {
// unordered_map<int,bool> removed;
unordered_set<int> removed;
vector<int> rounds;
int cur = 1;
while(removed.size()<n-1)
{
int counter =0;
while(counter<k)
{
... | ALGO | 0.999997 | 5.74627 |
91238e33-f4f0-4f77-9111-49c49e80e20a | jlpteaching/reversi | examples/race.cpp | #include <iostream>
#include <cilk/cilk.h>
using namespace std;
int global = 0;
void reducer(int i)
{
global += i;
}
int main(int argc, char* argv[])
{
cilk_spawn reducer(1);
cilk_spawn reducer(2);
cilk_sync;
cout << "global is " << global << endl;
return 0;
}
| TOOL | 0.996639 | 4.691919 |
1c254e31-26a9-4b32-8961-b5328245eeb7 | SevkiBekir/CEIT211 | Homework/Lab6/lab6_1.cpp | // *****************************************************
// * This example is about Lab6 HW *
// * Created by Sevki Bekir *
// * Date: May 18, 2015 *
// *****************************************************
// 1. Write a program to simulate e... | ALGO | 0.978235 | 4.650874 |
8031b86c-609d-485f-8ff1-a9e8b51d3c54 | hejiangda/PAT_Study | 2019/A1007_Maximum_Subsequence_Sum/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
scanf("%d",&n);
// 声明一个长度为 n +
vector<int> v(n);
// 最终要返回的左右索引
int leftindex=0,rightindex=n-1,
sum=-1,temp=0,tempindex=0;
for(int i=0;i<n;i++){
scanf("%d",&v[i]);
// 累积
temp = te... | ALGO | 0.999975 | 3.310826 |
80479243-0b95-40f8-873e-d1163583690f | pavelsimo/ProgrammingContest | uva/10913_Walking_on_a_Grid/P10913.cpp | /* @BEGIN_OF_SOURCE_CODE */
/* @JUDGE_ID: 10913 C++ "Dynamic Programming" */
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#include <cstring>
using namespace std;
const int MAXN = 102, INF = 0x3f3f3f3f;
int N, K, A[MAXN][MAXN];
bool seen[MAXN][MAXN];
... | ALGO | 0.99966 | 3.778935 |
838e7e53-be0a-4f58-9afa-8568246945ec | shreya12-git/100DaysOfCode | Day23.cpp | #include <bits/stdc++.h>
using namespace std;
bool checkPalindrome(string s)
{
string ss1;
string ss2;
for (int i = 0; i < s.length(); i++)
{
ss1 = s.substr(i) + s.substr(0, i);//aaaad,daaaa
int start1 = 0, end1 = ss1.length() - 1;
ss2=ss1;
while (start1 < end1)//daaaa
... | ALGO | 0.999988 | 4.308399 |
eb144932-74d2-4379-96db-d8ed67140a7f | league1991/Maya2Matlab | GeometryProcessing/src/eigen3/bench/quat_slerp.cpp | #include <iostream>
#include <Eigen/Geometry>
#include <bench/BenchTimer.h>
using namespace Eigen;
using namespace std;
template<typename Q>
EIGEN_DONT_INLINE Q nlerp(const Q& a, const Q& b, typename Q::Scalar t)
{
return Q((a.coeffs() * (1.0-t) + b.coeffs() * t).normalized());
}
template<typename Q>
EIGEN_DONT_INL... | ALGO | 0.998815 | 6.251058 |
e452b040-10e8-46f5-a9a6-8de6a37161a5 | EIGHTFINITE/dolphin | Source/Core/Core/HW/StreamADPCM.cpp | // Adapted from in_cube by hcs & destop
#include "Core/HW/StreamADPCM.h"
#include <algorithm>
#include "Common/ChunkFile.h"
#include "Common/CommonTypes.h"
namespace StreamADPCM
{
static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2)
{
s32 hist = 0;
switch (q >> 4)
{
case 0:
hist = 0;
... | ALGO | 0.994592 | 6.08967 |
ee59478b-c0de-4c65-97e4-508d7f26675d | satyamgupta0202/Interview-Preparation | 682-baseball-game/682-baseball-game.cpp | class Solution {
public:
int calPoints(vector<string>& ops)
{
int n = ops.size();
stack<int>st;
for(int i=0;i<n;i++)
{
if(ops[i]=="C")
{
st.pop();
}
else if(ops[i]=="D")
{
int a = st... | ALGO | 0.999899 | 5.86655 |
ca8c1a9c-7c17-4f61-9430-3c4dca16acb5 | dongxiaohuang/C-Exercise | Standard Template Library/Deques/main.cpp | #include <iostream>
#include <deque>
#include <string>
#include <algorithm>
using namespace std;
//A deque(pronounced "deck") is very similar to vector. It manages its elements with a dynamic array, provide random
// access and has almost the same interface as a vector
// difference between vector and deque is that:
/... | TOOL | 0.904276 | 5.462433 |
2392681e-0c4b-4229-b659-ef0524bca840 | MohdAqib8267/6-Companies_30_days_Challenges | 1480-running-sum-of-1d-array/1480-running-sum-of-1d-array.cpp | class Solution {
public:
vector<int> runningSum(vector<int>& nums) {
vector<int>ans;
int sum=0;
for(int i=0;i<nums.size();i++){
sum=sum+nums[i];
ans.push_back(sum);
}
return ans;
}
}; | ALGO | 0.999822 | 5.956523 |
94133814-97f4-48c2-8d01-d696a4beb12c | Tagore22/algorithmSolve | algorithmSolve/백준/2002.cpp | #include <iostream>
#include <queue>
#include <set>
using namespace std;
// Ǯ.
// Ǵ Ȳ ľϴ ̴.
// map Ǯ queue set ̿ؼ Ǯô.
// ڼ ּ .
queue<string> first, second;
set<string> check;
int N;
// 1. ٸ
// 1-1. ù° ̹ ϼ ְ ι° ߿Ѱϼ ִ.
// 1-2. ù° Ȯϰ ̶ ù° ѱ
// ʴٸ ι° ̶ üũϰ 1 ø, ι° ѱ.
// 2. üũϰ Ѵ Ѿ.
void MakeAnswer()... | ALGO | 0.999891 | 4.224529 |
d78e6d2a-a957-421b-82a1-0e1141e76613 | taehun0933/soma-PS | 11659/kth.cpp | #include <iostream>
using namespace std;
int N, M;
int arr[100001];
int sum[100001];
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> M;
for (int i{1}; i <= N; i++)
{
cin >> arr[i];
sum[i] = sum[i - 1] + arr[i];
}
while (M--)
{
int i, j... | ALGO | 0.999958 | 4.86413 |
a6b36d8d-e608-4356-b214-20f7f9452d3d | theoden42/code-store | pasts/simplystrangesort.cpp | #include <bits/stdc++.h>
using namespace std;
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::va... | ALGO | 0.999889 | 4.003141 |
66e085c5-d04d-4fc2-885a-fdee6b22001d | jeb26/LongIntegerADT | digit.cpp | #include <iostream>
int main()
{
int t = -1;
int digits = 0;
while(t)
{
t /= 10;
digits++;
}
std::cout << "number of digits is: " << digits << std::endl;
return 0;
} | ALGO | 0.997625 | 4.274412 |
d4252496-01ad-498b-b6ef-55fabec48cf7 | Jchaochao/leetcode | island perimeter.cpp | class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int n = grid.size();
if(n==0)
return 0;
int m = grid[0].size();
int result = 0;
for(int i = 0; i<n ; ++i)
for(int j = 0 ; j < m ;++j)
{
if(grid[i][j]=... | ALGO | 0.999926 | 5.897753 |
1a6242c3-0ba6-4077-afe9-333d73662af0 | dungprolhvn/PTIT-codes | C++/sap dat day so.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
int t; cin >> t;
int n;
while (t--)
{
cin >> n;
ll *arr = new ll[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
ll *rs = new ll[n];
fill_n(rs, n, -1)... | ALGO | 0.999956 | 4.308144 |
f8491e0b-4628-4378-9641-3836eac295d6 | GaisaiYuno/OI-Record-exe-deleted | Grade 10-12/2018 autumn/NOIP/NOIP2018提高组Day2程序包/answers/GD-0551/game/game.cpp | #include<stdio.h>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
int read()
{
int x=0,f=1;
char ch=getchar();
while(ch<'0' || ch>'9')
{
if(ch=='-') f=-1;
ch=getchar();
}
while(ch>='0' && ch<='9')
{
x=10*x+ch-'0';
ch=getchar();
}
return x*f;
}
const int INF=0x7fffffff;
... | ALGO | 0.999987 | 3.668192 |
7f174556-317a-4537-8f43-6f9673a09da9 | Aniket0304/tushar | square_root.cpp | //with more precision upto decimal points.
//we'll use or create another function.
#include <iostream>
using namespace std;
int sqrt(int arr[],int num){
int s=0, ans=0;
int e=num-1;
int mid=s+(e-s)/2;
for (int i=0;i<num;i++){
if ((mid*mid)>num){
e=mid-1;
}
else if((mi... | ALGO | 0.999866 | 3.847777 |
774edbb3-5755-41ce-b426-139053d30d3a | Shyamji07/Leetcode-Solutions | 0950-reveal-cards-in-increasing-order/0950-reveal-cards-in-increasing-order.cpp | class Solution {
public:
vector<int> deckRevealedIncreasing(vector<int>& arr) {
sort(begin(arr),end(arr));
vector<int>v(arr.size());
iota(v.begin(),v.end(),0);
vector<int>ans(arr.size());
for(int i=0;i<arr.size();i++){
ans[*v.begin()]=arr[i];
v.erase(v... | ALGO | 0.999994 | 5.939278 |
e3cb5a37-73ec-40a9-b1d6-39e41d65a870 | sohardforaname/ACM_ICPC_practice | codeforces/1090/1090M.cpp | #include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
int num[100005];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, e;
cin >> n >> e;
for (int i = 0; i < n; ++i)
cin >> num[i];
int ans = 1, cnt = 1;
for (int i = 1; i < n; ++i)
{
if (num[i] != num[i - 1]... | ALGO | 0.999762 | 3.328453 |
9dee3608-4b0d-4388-a686-356bf52dc631 | devcyjung/Exercism | solutions/cpp/nucleotide-count/2/nucleotide_count.cpp | #include "nucleotide_count.h"
#include <stdexcept>
namespace nucleotide_count {
auto count_opt(const std::string& strand) noexcept -> std::optional<std::map<char, int>> {
std::map<char, int> counter{{'A', 0}, {'C', 0}, {'G', 0}, {'T', 0}};
const auto& invalid = counter.end();
for (const auto& ch: strand)... | TOOL | 0.867682 | 7.581409 |
cdcf7741-c7ec-45ad-b9ac-02267eebf166 | mulani-arif/A2OJ-Ladder | 11/48_business_trip.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v;
int count=0;
for(int i=0;i<12;i++)
{
int x;
cin>>x;
v.push_back(x);
}
sort(v.rbegin(),v.rend());
int flag=0;
for(int i=0;i<12;i++)
{
count+=v[i];
if(count... | ALGO | 0.999915 | 3.755576 |
f6d10232-80c3-4657-bc28-ec50ddaa7969 | dddql/cpp | Luogu/P1425.cpp | #include <cstdio>
int main()
{
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
int t = (c * 60 + d) - (a * 60 + b);
printf("%d %d", t / 60, t % 60);
return 0;
} | ALGO | 0.999471 | 4.545164 |
f0edc24f-f94f-42b0-8599-3d25330ecc35 | hjiang13/LLMs-in-IR | POJ-104/25/131.cpp | #include <iostream>
using namespace std;
void increase (char []);
int main()
{
int N, sum = 0, i, j;
char num[100];
memset (num, '\0',100);
num[0] = '1';
cin >> N;
for (i = 0; i < N; i++)
increase (num);
i = 0;
while (num[i] != '\0') ++i;
for (j = i - 1; j >= 0; j--)
{
cout << num[j];
}
return 0;
}
int mid = 0;
voi... | ALGO | 0.99996 | 4.000812 |
91073c3f-4e64-42a3-907e-cc06dbb800a3 | muhammet-mucahit/Data-Structures-Course | KTU/DS_Codes_16_SP/VS 2013/09.3 Synonym Chaining/Hashing.cpp | //
// HASHING with SYNONYM CHANING
// Last Update : 12.12.2015
//
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#include <iostream>
using namespace std;
struct SinglyNode
{
char ingilizce[12];
char turkce[14];
SinglyNode* next; ... | TOOL | 0.882989 | 3.203038 |
6448d748-ec43-41dc-a643-290ded1c837c | dixitt5/CP-Solutions | C++/right_trianglepattern.cpp | #include <iostream>
using namespace std;
int main()
{
int n = 5;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= i; j++)
cout << "* ";
cout << endl;
}
return 0;
}
| ALGO | 0.999581 | 3.745715 |
bcaebcfe-9f2c-40eb-b5c2-d92e4d2da0b3 | Harshit-Mutalik/1BM21AI050 | topological_dfs.cpp | #include <bits/stdc++.h>
using namespace std;
class Graph {
int V;
list<int>* adj;
void topologicalSortUtil(int v, bool visited[],
stack<int>& Stack);
public:
Graph(int V);
void addEdge(int v, int w);
void topologicalSort();
};
Graph::Graph(int V)
{
this->V = V;
adj = new list<int>[V];
}
void G... | ALGO | 0.999987 | 5.366286 |
bcede9de-6573-42f0-8cd3-5de92cf7ab6d | RinCloud/TrickCatcher | Datasets/TrickyBugs/GenProgs/dpp_generated_progs_cpp/p03574/p03574_num6_parsed.cpp | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
vector<string> grid(H);
for (int i = 0; i < H; i++) {
cin >> grid[i];
}
vector<vector<int>> adjacent_count(H, vector<int>(W, 0));
for (int i = 0; i < H; i++) {
for (int j = 0; ... | ALGO | 0.999967 | 5.008857 |
7479e072-d3cd-42f0-8576-397d38dd1149 | PanayiotisKirkalas/MultiThreading | Lab11/Lab11_1/ServerProtocolCalc.cpp | #include "ServerProtocolCalc.h"
void calculator::ServerProtocol::print_message(const string& buff) {
bool flag = false;
for (int i = 0; i < MAXLINE && !flag; ++i) {
if (buff[i] == ' ')
cout << '_';
else if (buff[i] == '\n')
cout << "\\n";
else if (buff[i] == '\0') {
cout << "\\0";
flag = true;
}
... | WEB | 0.968078 | 4.781649 |
e70d2649-e021-454e-9053-e60ee72d61cf | ishandutta2007/codeforces | normie28/normal/22/C.cpp | #include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int64_t n,m,i,j,gd,needed,hol,remain,k,e,ee,minn,maxx,fail, last,top, countt=0,counts=0,page,removed=0,temp,op=0,pc[10001]; vector <int64_t> d;
int64_t gccd(int64... | ALGO | 0.999923 | 3.472951 |
c40044b4-35cc-4ac7-9e2e-105b116168a3 | HONGYU-LEE/TheWayToAlgorithm | CodingInterviewGuide/CD158/solution.cpp | # include <iostream>
using namespace std;
struct list_node{
int val;
struct list_node * next;
};
list_node * input_list(void)
{
int n, val;
list_node * phead = new list_node();
list_node * cur_pnode = phead;
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
scanf("%d", &val);
... | ALGO | 0.999984 | 4.206522 |
f06bfac0-a76c-4837-9dec-c80399c5e5cd | AdityaPrakash-26/Leetcode-Solutions | Aditya/0100-0999/231.power-of-two.cpp | /*
Accepted
1108/1108 cases passed (0 ms)
Your runtime beats 100 % of cpp submissions
Your memory usage beats 88.22 % of cpp submissions (5.7 MB)
*/
/*
* @lc app=leetcode id=231 lang=cpp
*
* [231] Power of Two
*/
// @lc code=start
class Solution {
public:
bool isInteger(double N){
// Convert float val... | ALGO | 0.996787 | 5.983838 |
3c2ef67b-a769-4509-ba50-5a5b09ac4a72 | EuclideanGeometryIsOverrated/Kappa | e.cpp | #include "e.hpp"
double factorial(const int &_in) { return(_in == 1 || _in == 0 ? 1 : factorial(_in - 1) * _in); }
double calcE(const int &_iterations){
double _r = 1;
for(int _i = 1; _i <= _iterations; _i++){
_r += (1 / factorial(_i));
}
return _r;
} | ALGO | 0.999602 | 3.913123 |
7f82e01a-6c39-4675-8e03-dd87715e0e39 | o-gent/ender3-profile | Marlin/src/module/planner_bezier.cpp | /**
* planner_bezier.cpp
*
* Compute and buffer movement commands for bezier curves
*/
#include "../inc/MarlinConfig.h"
#if ENABLED(BEZIER_CURVE_SUPPORT)
#include "planner.h"
#include "motion.h"
#include "temperature.h"
#include "../MarlinCore.h"
#include "../gcode/queue.h"
// See the meaning in the documentat... | ALGO | 0.99969 | 7.903678 |
c97bfcc0-6bd5-4927-bc68-4356d44871f7 | YashSuthar983/CodeForces | SakurakoAndKosuko.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int test;
cin >> test;
while(test--) {
int n;
cin >> n;
int moves = 1;
int dot=0;
while(n >= abs(dot))
{
if(moves % 2 == 1)
{
dot+=-abs... | ALGO | 0.999294 | 3.738107 |
8143147c-5fb9-4b60-aa56-25dec61ff476 | petewat/cp | applecatching.cpp | #include<iostream>
#include<stack>
#include<map>
#include<vector>
#include<string>
#include<unordered_map>
#include <queue>
#include<cstring>
#include<limits.h>
#include <cassert>
#include <cstdint>
#include<cmath>
#include<set>
#include<algorithm>
#include <iomanip>
#include<numeric> //gcd(a,b)
#include<bitset>
#defin... | ALGO | 0.999726 | 3.55805 |
7fabce2d-5633-46e5-8d23-61b326198b90 | jeete121/Coding | Programs/Practice/Prac/StackQueue/stack_using_linked_list.cpp | #include <bits/stdc++.h>
using namespace std;
class ListNode {
public:
int val;
ListNode* next;
ListNode() {
}
ListNode(int val) {
this->val = val;
this->next=NULL;
}
ListNode(int val, ListNode *next) {
this->val = val;
this->next = next;
}
};
cl... | ALGO | 0.998829 | 4.562438 |
e38aa7b9-de14-4e7d-ad2b-3d8176de70f5 | uses-123/DateStructure | 数据结构练习/数据结构分组任务/第一次/顺序表删除重复元素(初稿).cpp | #include <stdio.h>
#define LISTSIZE 100
#include<time.h>
typedef int DataType;
typedef struct {
DataType data[LISTSIZE];
int length;
} SeqList;
void GetData(SeqList &L, int number) {
for (int i = 0; i < number; i++) {
scanf("%d", &L.data[i]);
}
L.length = number;
}
int DelList(SeqList &L, i... | ALGO | 0.999318 | 3.297504 |
4b61d2b5-d76a-420a-bca2-02a4931d5989 | ehnryx/acm | wf2011/f.cpp | #include <bits/stdc++.h>
using namespace std;
#define nl '\n'
typedef long long ll;
typedef long double ld;
typedef complex<ld> pt;
typedef pair<int,int> pii;
const ll is_query = -(1LL<<62);
struct Line {
ll m, b;
mutable function<const Line*()> succ;
bool operator<(const Line&rhs) const {
if (rhs.b != is_... | ALGO | 0.999436 | 4.586174 |
7c44b427-69d3-42df-930a-706603ca0473 | nimsmgr/January-Meet | 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 |
fff6ef14-10c8-4614-a90b-c51ec9f15122 | Geek-Tekina/ReviseWithArsh_30_Days_6_Companies | Day12_Q1.cpp | class Solution {
public:
int magicalString(int n) {
queue<int>q;
q.push(2);
int cnt=1;
for(int i=2; i<n; ++i){
int num=q.front();
q.pop();
if(num==1){
cnt++;
}
int l;
if(q.back()==2){
... | ALGO | 0.99999 | 5.394176 |
a119ddc8-88dd-4e16-8b73-944383d5be18 | crettit2003/frameworks_av_aicp-q | media/utils/MemoryLeakTrackUtil.cpp | //#define LOG_NDEBUG 0
#define LOG_TAG "MemoryLeackTrackUtil"
#include <utils/Log.h>
#include "media/MemoryLeakTrackUtil.h"
#include <sstream>
#include <bionic_malloc.h>
/*
* The code here originally resided in MediaPlayerService.cpp
*/
// Figure out the abi based on defined macros.
#if defined(__arm__)
#define A... | TOOL | 0.879857 | 6.967525 |
9a460052-9b67-49bc-9671-91b33a78acb4 | gflachs/Alfred | arduino/lib/Alfred_eigene_Daten_v2_inferencing/src/edge-impulse-sdk/tensorflow/lite/micro/kernels/l2norm.cpp | #include "edge-impulse-sdk/tensorflow/lite/c/common.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/portable_tensor.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/integer_ops/l2normalization.h"
#include "edge-impulse-sdk/tensorflow/lite/kernels/internal/reference/l2normalization... | DATA | 0.901773 | 7.434498 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.