uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4279b4a6-4310-4643-88be-0f19ce3a9b71 | kanpuriyanawab/Data-Structures-KR | Graph/euler.cpp | // UNDIRECTED UNWEIGHTED GRAPH
// EULER's Path problem -> a figure that we can draw on paper without lifting
// our pen
#include <iostream>
#include <vector>
using namespace std;
void addEdge(vector<vector<int> >&G,int u,int v){
G[u][v] = 1;
G[v][u] = 1;
}
void printvec(vector<int>&v,int strt){
for (in... | ALGO | 0.99999 | 4.163963 |
4809ae2e-1e49-4142-9638-db5e10eda112 | xrayFan/xray_history | xr_3da/xrGame/explode_effector.cpp | #include "stdafx.h"
#include "explode_effector.h"
CExplodeEffector::CExplodeEffector(float time, float amp, float periods, float power)
: CCameraEffector(ECameraEffectorType(eExplode), time)
{
total = time;
max_amp = amp * power;
period_number = periods;
this->power = power;
}
BOOL CExplodeEffector::Pro... | TOOL | 0.85014 | 3.827165 |
9dce833b-4d62-415a-886e-986d76f799e4 | conradsoon/competitive_programming | kattis/solved/sequence.cpp | #include <bits/stdc++.h>
using namespace std;
/*
map<int,set<int>> cache;
cache.insert(make_pair(1,set<int>(1)));
set<int> sequence(int n){
int max_elements = -1;
int max_index;
for(int i = 1; i < n; i++){
if(n%i == 0){
if(cache.count(i)==0){
cache.insert(make_pair(i,sequ... | ALGO | 0.999989 | 4.877377 |
54c13f6b-164d-479a-848e-75bf10b786c2 | sarvex/leetcode-c-- | solution/1400-1499/1466.Reorder Routes to Make All Paths Lead to the City Zero/Solution.cpp | class Solution {
public:
int minReorder(int n, vector<vector<int>>& connections) {
unordered_map<int, vector<pair<int, bool>>> g;
for (auto& e : connections) {
int u = e[0], v = e[1];
g[u].push_back({v, true});
g[v].push_back({u, false});
}
vector<... | ALGO | 0.999971 | 5.599451 |
90c20908-a599-4602-bc56-1357789dc35a | Mohamed-Hossam/Problem-Solving | uva/uva - 10090.cpp | //In the name of Allah
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<iterator>
#include<cmath>
#include<string>
#include<sstream>
#include<cstring>
#include<ctype.h>
#include<iomanip>
#... | ALGO | 0.999311 | 3.310198 |
2777eefa-aa10-4681-9156-137a214d2e2f | suwitiki/suwitiki-ENGCE117-Programming | HW9/hw9.2/HW9.2.cpp | /*
ให้ผู้ใช้กรอกค่าเข้ามาเก็บในอาเรย์ จากนั้นให้ทำการแสดงค่าข้อมูล 2 แบบคือ "เรียงข้อมูลจากมากไปน้อย" และ "เรียงข้อมูลจากน้อยไปมาก"
Test case:
Input :
1
Input :
5
Input :
1
Input :
4
Input :
6
I... | ALGO | 0.999728 | 3.919433 |
b0531f81-42ae-42a3-a56a-7b94725d08e0 | Atharsh2910/Data_Structures-Lab | Data_Structures-Lab/lab 4/SinglyLinkedList.cpp | //Program to implement a ListADT using a singly linked list
#include <stdio.h>
#include<stdlib.h>
class SinglyLinkedList {
private:
struct Node {
int data;
struct Node* next;
};
struct Node* head;
public:
SinglyLinkedList() {head = NULL;}
void i... | ALGO | 0.99956 | 4.376016 |
a21941ad-ec0a-4c3c-9c55-878d6f1e68b4 | khalilrefai/mesh-viewer | include/igl/rigid_alignment.cpp | template <
typename DerivedX,
typename DerivedP,
typename DerivedN,
typename DerivedR,
typename Derivedt
>
IGL_INLINE void igl::rigid_alignment(
const Eigen::MatrixBase<DerivedX> & _X,
const Eigen::MatrixBase<DerivedP> & P,
const Eigen::MatrixBase<DerivedN> & N,
Eigen::PlainObjectBase<DerivedR> & R,
... | ALGO | 0.998327 | 5.899469 |
ced766cb-f22d-4a4f-9f84-79f841b8893d | fsy-juruo/noip-2021-js-answer | t2021/JS-0345/number/number.cpp | #include<bits/stdc++.h>
using namespace std;
const int N=10000005;
int y[N];
bool check(int a){
if(a%7==0) {
y[a]=1;
return false;
}
int b=a,c=a;
while(a){
int k=a%10;
if(k==7) {
y[b]=1;
return false;
}
a/=10;
}
for(int i=1;i<=b/2;i++){
if(c%i==0&&(y[i]==1||!check(i))) {
y[b]=1;
return f... | ALGO | 0.999865 | 3.939395 |
b19bc76f-d786-4ab1-88bc-af81bf889a51 | yapbenzet/Stanford_C106B_Programming_Abstractions_Course_2017 | Assignment_001.cpp | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <map>
using namespace std;
// Problem 1---------------------------------------------------------
//this version returns a new string
string CensorString1(string first, string second)
{
set<char> s;
for (unsigned i = 0;... | TOOL | 0.896547 | 3.766727 |
27ae9921-296f-4b97-9bd1-cc796a234de0 | M0rs-Ruki/DSA | String/58. Length of Last Word.cpp |
// 58. Length of Last Word
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int lengthOfLastWord(string s) {
if(s.empty()) return 0;
int count = 0;
int i = s.length() - 1;
// Step 1: Skip trailing spaces
while (i >=... | ALGO | 0.998453 | 5.724625 |
9d871454-92b6-44db-9540-227c3334ae7e | bmzhong/dev | luogu/luogu3/1678.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n, m, f[100001], x[100001];
long long ans = 0;
int solve(int x1)
{
int l = 0, r = m, mid;
while (l < r - 1)
{
mid = (l + r) / 2;
if (f[mid] == x1)
return 0;
else if (f[mid] > x1)
... | ALGO | 0.999982 | 4.079053 |
806a9656-f530-46b2-91a1-84a86ecb0ed3 | GouzzzGouzzz/Cpp | cpp09/ex02/PmergeMe.cpp | #include "PmergeMe.hpp"
PmergeMe::PmergeMe()
{
}
PmergeMe::~PmergeMe()
{
}
bool PmergeMe::input(char **ag, int ac)
{
std::vector<int> temp;
int nb;
for (int i = 1; i < ac; i++)
{
std::istringstream stream(ag[i]);
std::string parse = ag[i];
for (size_t i = 0; i < parse.size(); i++)
{
if (parse[i] != ... | ALGO | 0.999271 | 4.567423 |
e32fcef8-9eee-4c17-b10f-659bd29bf1bc | ongsiru/AlgorithmStudy | 2023-10-20/2023-10-20.cpp | //점화식으로 Dynamic Programming하는 문제인데 어려워서 Solution을 참고하였다.
#include <string>
#include <vector>
long long dp[100002] = { 1, 1, 3, 10, 23, 62, 170, };
long long sum[100002] = { 1, 1, 3, 11, 24, 65, 181, };
const int INF = 1000000007;
using namespace std;
int solution(int n) {
for (int i = 7; i <= n; i++) {
... | ALGO | 0.999974 | 4.464659 |
8a49fef6-1399-42ca-9ff4-027f5a29e1aa | aarindey/Leetcode-Solution-By-aarindey | minimum-falling-path-sum-ii/minimum-falling-path-sum-ii.cpp | class Solution {
public:
int minFallingPathSum(vector<vector<int>>& matrix) {
int n=matrix.size();
int ans=INT_MAX;
if(n==1)
return matrix[0][0];
if(n==0)
return 0;
for(int r=1;r<n;r++)
{
for(int c=0;c<n;c++)
{
i... | ALGO | 0.999985 | 6.285484 |
8520b0c2-4a08-47ae-9c1b-276470d62e69 | TaeMochi12/CPP | Cpp complete/oops/arr.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cout<<"Enter no. of elements:";
cin>>n;
int arr[n];
cout<<"Enter array elements"<<endl;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
cout<<"Elements in reverse order... | ALGO | 0.999311 | 4.31008 |
d45a0454-5040-41cf-96da-6249be06b055 | kreininmv/1-sem_MIPT | T00_EQUATION/T00EQUATION.cpp | #include <stdio.h>
#include <math.h>
#include <assert.h>
#include <stdlib.h>
#include <windows.h>
#define PRECISION 5e-4
#define SOLVE_ANY_SOLUTION 0x1E
#define TRUE 1
/* Check inaccuracy of 2 numbers.
* \param[in] first number - double a;
* \param[in] second number - double b;
* \param[... | ALGO | 0.999534 | 3.496917 |
aef43023-3ed5-4194-a411-c507a0d8ffbf | harsh70568/Daily_Problems_Solution | Vertical Traversal of Binary Tree - GFG/vertical-traversal-of-binary-tree.cpp | // { Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
};
// Utility function to create a new Tree Node
Node* newNode(int val)
{
Node* temp = new Node;
temp->data = val;
temp->left = NULL;
temp->right = NULL;
... | ALGO | 0.999978 | 6.342876 |
7a181af0-dae6-48fe-89d4-e0410f2e1c75 | bluesia0305/Coding_Problems | 프로그래머스/0/181839. 주사위 게임 1/주사위 게임 1.cpp | #include <string>
#include <vector>
using namespace std;
int solution(int a, int b)
{
int answer = 0;
if ((a * b) % 2)
return a * a + b * b;
else
{
if (!(a % 2) && !(b % 2))
return a > b ? a - b : b - a;
else
return 2 * (a + b);
}
} | ALGO | 0.999918 | 4.585681 |
924c829c-f052-4463-be47-e845a7bc531f | Jackarain/avhttp | boost/libs/compute/perf/perf_stl_search.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.984929 | 5.696832 |
db586d63-0e3f-44b2-8dce-aae5228dbdac | Inuyashaaaaa/IntroductionToAlgorithmicContests | codeforce/ed Round 82/A.cpp | #include<bits/stdc++.h>
#define LL long long
#define ms(s) memset(s, 0, sizeof(s))
#define REP(i, a, b) for(int i = (a); i < (b); i++)
#define INF 0X7fffffff
using namespace std;
int main() {
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(0);
... | ALGO | 0.9994 | 4.639783 |
665e6713-55e5-4bbe-aa4d-c85c516f8c1d | FlashSQL/mysql-with-nvdimm | storage/ndb/src/kernel/blocks/dbtux/DbtuxBuild.cpp | #include "Dbtux.hpp"
#define JAM_FILE_ID 373
struct mt_BuildIndxCtx
{
Uint32 indexId;
Uint32 tableId;
Uint32 fragId;
Dbtup* tup_ptr;
Dbtux::TuxCtx * tux_ctx_ptr;
NdbMutex * alloc_mutex_ptr;
};
Uint32
Dbtux_mt_buildIndexFragment_wrapper_C(void * obj)
{
return Dbtux::mt_buildIndexFragment_wrapper(obj);
}... | ALGO | 0.896226 | 6.249639 |
d4851599-4df7-438b-9674-6d8967b35116 | LovkiyZerg/LR3 | code/Task1/Task_1.cpp | #include <iostream>
void get_1_or_0(int&);
int main () {
setlocale(LC_ALL, "Russian");
int execute = 1;
do{
std::system("clear");
std::cout << "Используя цикл while вычислить N = ∑(i=1, n=30) (ai - bi)^2, где a и b определены по формуле:" << std::endl << "ai = i, если i нечётное(i/2 , если... | ALGO | 0.999077 | 3.478702 |
83d171be-16b1-4a79-bd9d-037bb1f1938f | sanjaykukreti136/leetcode-solutions | maximum-product-subarray/maximum-product-subarray.cpp | class Solution {
public:
int maxProduct(vector<int>& nums) {
int ans = INT_MIN;
int s = 1;
for(int i=0;i<nums.size();i++){
s*= nums[i];
ans = max(ans , s);
if(s==0){
s = 1;
}
}
s = 1;
for(int i = nums.siz... | ALGO | 0.999994 | 5.936631 |
6a3b9c6c-f8bf-4afc-a51a-3082ae5fb2f2 | Saimongu007/Code_Force-Problem | Black-Square.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a[4];
for(int i = 0; i<4; i++)
{
cin>> a[i];
}
string s;
cin>> s;
int sum = 0;
for(int i = 0; i<s.size(); i++)
{
if(s[i] == '1')
{
sum = sum + a[0];
}
else if(s[i] == ... | ALGO | 0.998898 | 3.979995 |
cdc8e60a-3acf-457b-99c5-21e933928368 | mayankpuvvala/Grinding_Leetcode | 67-add-binary/add-binary.cpp |
class Solution {
public:
string addBinary(string a, string b) {
string res;
int carry=0;
int i= a.length()-1,j=b.length()-1;
while(i>=0 || j>=0){
int sum=carry;
if(i>=0){
sum+=a[i--]-'0';
}
if(j>=0){
su... | ALGO | 0.99999 | 6.444053 |
a5437783-c427-4fee-92a8-43f8e930efcb | alexandrelea/oi-oj-codes | luogu/p1438/prog.cpp | #include <iostream>
#define int long long
using namespace std;
const int SIZE=1e5+10;
int n,m,a[SIZE],d[SIZE];
int rt,ch[SIZE*4][2],tag[SIZE*4],sum[SIZE*4],cnt;
void pushup(int co){
sum[co]=sum[ch[co][0]]+sum[ch[co][1]];
}
void pushdown(int co,int lf,int rt){
if(tag[co]==0) return;
int mi=lf+(rt-lf)/2;
... | ALGO | 0.999914 | 4.348254 |
cf65cc43-27d6-4208-b8ba-a37ce04ae683 | KrishMMavani/CodeForces | CodeForces/cdfrcs112A.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string a, b;
cin >> a >> b;
transform(a.begin(), a.end(), a.begin(), ::toupper);
transform(b.begin(), b.end(), b.begin(), ::toupper);
if (a == b)
{
cout<<0<<endl;
}
else if(a<b)
{
cout<<-1<<endl;
}
els... | ALGO | 0.99999 | 3.809975 |
135b22e5-82bc-41b2-9f74-6b764a8ed6be | karlsolomon/interviewPrep | sources/heap/isHeap.cpp | std::vector<int> numbers = {9, 6, 4, 1, 5, 1, 2, 3};
// Using std::is_heap to check if the numbers vector is a heap
bool isHeap = std::is_heap(numbers.begin(), numbers.end());
// Result: isHeap = true
// Using std::is_heap_until to find the first position where the heap property is violated
auto heapEnd = std::is_hea... | ALGO | 0.999523 | 5.865308 |
8ca3b27d-0321-44f3-9b85-6fef65ecca0e | volzkzg/sgu | 143.cpp | /*
*NAME:Long Live the Queen
*LANG:C++
*SOURCE:sgu143
*METHOD:树形DP,记录下每个节点为根节点时,他的儿子和他所能构成的最大值。
*TIMES:3
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 50000;
struct node{
int v,next;
}e[maxn];
int g[maxn],edgeNum,n,ans;
int father[maxn],f... | ALGO | 0.999952 | 3.647693 |
6122fdb0-c47b-47c8-96e1-d4e535d25f3b | fmorenovr/ComputerScience_UCSP | MCC203-Computacion_Grafica/Trabajo_2_Fast-Winding-Numbers/fast-winding-number-soups/libigl/include/igl/orient_outward.cpp | template <
typename DerivedV,
typename DerivedF,
typename DerivedC,
typename DerivedFF,
typename DerivedI>
IGL_INLINE void igl::orient_outward(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
const Eigen::PlainObjectBase<DerivedC> & C,
Eigen::PlainObjectBase... | ALGO | 0.999475 | 5.565805 |
4e00650a-c517-49c2-b2ea-e43eb7362587 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_139_13.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, h[30], a[30], count(0);
cin >> n;
for (int i = 0; i < n; i++) {
cin >> h[i] >> a[i];
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (h[i] == a[j]) {
count++;
}
}
}
cout << count;
return 0;... | ALGO | 0.999587 | 3.372435 |
7ddb69e9-4720-40dd-b067-9049959cfe1a | AnanyaSamanta09/450-DSA-solutions | Array/Union of two arrays.cpp | class Solution{
public:
//Function to return the count of number of elements in union of two arrays.
int doUnion(int a[], int n, int b[], int m) {
map<int,int>ma;
int i,c=0;
for(i=0;i<n;i++)
{
ma[a[i]]++;
}
for(i=0;i<m;i++)
{
ma[b[i]]++;
}
for(auto x:ma)
... | ALGO | 0.999878 | 4.710366 |
d156888e-4ff7-4010-9abd-b9e555fa805d | jungmin86/DataStructures | Lab_C++_3rd_자료구조_참고코드/Chapter9/Graph/DFSearch.cpp | #include "GraphType.h"
#include <iostream>
template<class VertexType>
void DepthFirstSearch(GraphType<VertexType> graph,
VertexType startVertex, VertexType endVertex)
// Assumes VertexType is a type for which the == and "<<"
// operators are defined
{
using namespace std;
StackType<VertexType> stack;
QueT... | ALGO | 0.998736 | 4.273071 |
8ef64217-18f5-4cf1-8d6f-644eb2e6e94a | ajay-1134/CODING | A_Presents.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
const int mod = 1000000007;
#define PI 3.
int find_index(int arr[],int n,int x){
for(int i=0; i<n; i++){
if(arr[i] == x){
return i;
}
}
return -1;
}
signed main()
{
ios_base::sync_with_stdio(0), cin.tie... | ALGO | 0.999986 | 4.0667 |
484f760c-f09f-409c-af14-079df55dbd63 | devin91/auboi5_realsense | vision_visp/visp_auto_tracker/flashcode_mbt/examples/complex.cpp | //command line parameters
#include "cmd_line/cmd_line.h"
//detectors
#include "detectors/datamatrix/detector.h"
#include "detectors/qrcode/detector.h"
//tracking
#include "libauto_tracker/tracking.h"
#include "libauto_tracker/threading.h"
#include "libauto_tracker/events.h"
//visp includes
#include <visp/vpImageIo.h... | TOOL | 0.941608 | 5.640683 |
fc81e113-f766-4658-a77e-77dfae59c33f | vadvido/Marlin-bugfix-2.1.x_copy | buildroot/share/PlatformIO/variants/MARLIN_BIGTREE_OCTOPUS_PRO_V1_F429/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
// Pin number
const PinName digitalPin[] = {
PA_0, //D0
PA_1, //D1
PA_2, //D2
PA_3, //D3
PA_4, //D4
PA_5, //D5
PA_6, //D6
PA_7, //D7
PA_8, //D8
PA_9, //D9
PA_10, //D10
PA_11, //D11
PA_12, //D12
PA_13, //D13
PA_14,... | CONFIG | 0.899081 | 3.640586 |
ac7bf5d5-358d-427c-8f76-ffe7fbbcd9a7 | gabitaniguchi/Competitive-programming | string/trie/TRYCOMP.cpp | #include <bits/stdc++.h>
using namespace std;
struct Trie{
int child[26];
int quantos = 0;
string best = "";
bool end = false;
Trie(){
fill(child, child+26, -1);
}
};
vector<Trie> trie(1);
map<string, int> freq;
void add_string(string const& s){
int v = 0;
for(auto ch: s){
... | ALGO | 0.999912 | 4.066867 |
7dadbdb5-11c2-4fbb-8369-4495a5168604 | filippobaroni/CompetitiveProgrammingCourse | wilbur_and_array.cpp | /*
We iterate over the array B and keep a counter incr, representing the
current value of the array at current position. The final value must
be B[i], so we add B[i]-incr to the current position; thus incr increases
by B[i]-incr, and the number of moves increases by abs(B[i]-incr). Note
that we do not need to keep the... | ALGO | 0.999907 | 4.255249 |
b83f1495-ba63-4b98-9d67-dbee1e81ddfe | satyamtiwari736182/CP | pepcoding/Level 3/Game Theory/4_First Move In A Nim Game.cpp | // Two players Alice and Bob are playing NIM Game with each other. Both are playing optimally.Alice starts the game. The task is to find the number of ways of playing 1st move for Alice to ensure a winning strategy for him if possible, otherwise print -1.
// 7
// 24 6 10 56 9 1 24 | ALGO | 0.99987 | 3.859252 |
4e197f5a-30b8-4d52-8cea-d3c09e022c42 | lilian-r/2024vldbss_storage | src/sql/engine/expr/ob_expr_func_partition_key.cpp | #define USING_LOG_PREFIX SQL_ENG
#include "sql/engine/expr/ob_expr_func_partition_key.h"
namespace oceanbase
{
using namespace common;
namespace sql
{
ObExprFuncPartKey::ObExprFuncPartKey(ObIAllocator &alloc)
: ObFuncExprOperator(alloc,T_FUN_SYS_PART_KEY, N_PART_KEY, MORE_THAN_ZERO, NOT_VALID_FOR_GENERATED_COL, N... | ALGO | 0.908226 | 7.121412 |
509bb8d1-5b1a-4d95-9e87-de342240dd34 | janmbuys/oxdp | src/third_party/eigen/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.871528 | 5.865374 |
80e84324-cca7-4a77-828f-04eb93b86ce9 | khushal-sahni/Code | Bit Magic/setKthBit.cpp | #include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n,k;
cin >> n >> k;
n = n | (1<<k);
cout << n << "\n";
}
}
| ALGO | 0.998976 | 3.828837 |
f6fa40ca-fe31-44d7-a43e-0c2b12a4c9d3 | Ash-codes18/Cpp_DSA | Programs/Leetcode/2751-sliding-subarray-beauty/2751-sliding-subarray-beauty.cpp | class Solution {
public:
vector<int> getSubarrayBeauty(vector<int>& nums, int k, int x) {
ios::sync_with_stdio(0);
cin.tie(0);
int n = nums.size();
int j=0, ngc=0;
map<int,int> mp;
vector<int> ans;
for(int i=0;i<k;i++){
if(nums[i]<0){
... | ALGO | 0.999964 | 4.867835 |
fe5f3a1f-869f-4260-b213-fce5e9c6dbd5 | karan-pawar-09/codeforces | B_Cycle_Hit.cpp | /*
author:Karan
created:26.07.2021 16:22:20
*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(ar) ar.begin(),ar.end()
#define endl '\n'
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout)... | ALGO | 0.999778 | 3.414051 |
405c81a5-3a3d-497c-9b00-d5ce74e9224c | StanleyJo-37/competitive-programming-chatbots-comprasion | submissions/gemini/sub64.cpp | #include <iostream> // Required for input/output operations (cin, cout)
#include <vector> // Required for std::vector to store numbers and permutations
#include <string> // Required for std::string to handle k-digit numbers as strings
#include <algorithm> // Required for std::sort and std::next_permutation
#include... | ALGO | 0.999886 | 5.409718 |
66388a88-5506-40e3-9469-25a1abfb400f | EduardoCalvo/CompetitivePrograming | LeetCode/78_Subsets.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
private:
void backTrack(vector<int> &subset, vector<vector<int>> &ans, const vector<int> &nums, const int &idx){
ans.push_back(subset);
for(int i = idx; i < nums.size(); i++){
subset.pus... | ALGO | 0.999817 | 5.684376 |
756d915f-a464-4090-b974-725a01a88ce8 | pangxiaowen/leetcode_practice | day_3/206_reverseList.cpp | #include <iostream>
struct Node
{
int val;
Node *next;
};
Node *reverse_list(Node *list)
{
Node *first = list->next;
Node *slow = list;
while (first != nullptr)
{
Node *tmp = first->next;
first->next = slow;
slow = first;
first = tmp;
}
list->next = nu... | ALGO | 0.99991 | 5.597549 |
5ffc8c46-304f-46a4-ba55-20562b034d06 | tushxr12/Contests | codechef/Starters_188/Train Even or Odd.cpp | #include<bits/stdc++.h>
using namespace std;
void solve()
{
int n;cin>>n;
vector<int> v(n);
for(int i = 0;i < n;i++)
{
cin>>v[i];
}
int oddSum = 0, evenSum = 0;
for(int i = 0;i < n;i++)
{
if(i%2 == 0)
evenSum += v[i];
else
oddSum += ... | ALGO | 0.999968 | 5.613747 |
d130e106-50c2-4bb2-8c20-1ea6b5f3b451 | DzakwanPw/131_ConditionalStatement | DZAKWAN.cpp | #include <iostream>
using namespace std;
//numeric nLuas, nPanjang, nLebar
float Luas, Panjang, Lebar;
void InputData()
{
//display "Masukkan Panjang:"
cout << "Masukkan Panjang : ";
//accept nPanjang
cin >> Panjang;
//display "Masukkan Lebarnya"
cout << "masukkan Lebarnya : ";
//accept n... | TOOL | 0.892041 | 3.307096 |
bd4f6a89-5314-428b-8c90-1c19545b16b9 | kanbang/chromium_ui | third_party/skia/src/pathops/SkDCubicToQuads.cpp | /*
http://stackoverflow.com/questions/2009160/how-do-i-convert-the-2-control-points-of-a-cubic-curve-to-the-single-control-poi
*/
/*
Let's call the control points of the cubic Q0..Q3 and the control points of the quadratic P0..P2.
Then for degree elevation, the equations are:
Q0 = P0
Q1 = 1/3 P0 + 2/3 P1
Q2 = 2/3 P1 ... | ALGO | 0.9976 | 3.754418 |
97c82abd-d946-4ab9-92b7-95be6842daf4 | typr7/practice | judge/hdu/OJ2037.cpp | /*Problem Description
“今年暑假不AC?”
“是的。”
“那你干什么呢?”
“看世界杯呀,笨蛋!”
“@#$%^&*%...”
确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。
作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、
超级女生,以及王小丫的《开心辞典》等等,假设你已经知道了所有你喜欢看的电视节目的转播时间表,你会合理安排吗?(目标是能看尽量多的完整节目)
Input
输入数据包含多个测试实例,每个测试实例的第一行只有一个整数n(n<=100),表示你喜欢看的节目的总... | ALGO | 0.999871 | 4.017204 |
cc045278-883a-4b9a-9c6c-1be4c413ab4b | TamimEhsan/CSES-Solutions | Advanced Graph Problems/Graph Girth.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<ll,ll>
#define F first
#define S second
const int N = 3000;
vector<int> adj[N];
int vis[N];
int parent[N];
int minCycle(int start,int n){
for(int i=0;i<=n;i++){
vis[i] = 0;
parent[i] = 0;
}
queue<int> q;
... | ALGO | 0.999826 | 4.021556 |
b1ca0317-4953-4afc-9dcf-a437e807dd0b | Eraikizpi/Eraikizpi-V2 | Repetier-Firmware/Repetier/HAL.cpp | #include "Repetier.h"
#include <compat/twi.h>
//extern "C" void __cxa_pure_virtual() { }
HAL::HAL()
{
//ctor
}
HAL::~HAL()
{
//dtor
}
uint16_t HAL::integerSqrt(long a)
{
// http://www.mikrocontroller.net/articles/AVR_Arithmetik#32_Bit_.2F_32_Bit
//-----------------------------------------------------------
... | TOOL | 0.89908 | 4.56437 |
e379283b-250e-4659-af1f-5b07683d23de | abdullah-124/xpsc | Week-13/day-5/detect_cycle.cpp | #include<bits/stdc++.h>
#define fastread() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define ll long long
using namespace std;
class Solution{
public:
//BFS
bool bfs(int src, int vis[],vector<int>adj[]){
queue<pair<int,int>>q;
q.push({src,-1});
vis[src] = 1;
while(!... | ALGO | 0.999863 | 5.160676 |
17b98d41-1206-47c4-a2df-71e84863686f | lazyboson/UVaSolutions | addall.cpp | #include <algorithm>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)
class Sol... | ALGO | 0.99941 | 4.845369 |
60f4b857-490c-4f56-92ab-f967e45cc704 | Alfred-Zhang/Leetcode | 007.cpp | #include <climits>
class Solution {
public:
int reverse(int x) {
long long res = 0;
do {
res = res * 10 + x % 10;
x /= 10;
} while (x != 0);
return (res > INT_MAX || res < INT_MIN) ? 0 : res;
}
}; | ALGO | 0.999957 | 5.591352 |
d2c8e9e9-d093-4aca-8ac2-09c0cc2682dd | yweijiang/WinObjC-Geocoding | Frameworks/Accelerate/blasCFloat.cpp | //The following 5 macros are used by the Eigen-BLAS header files.
#define SCALAR std::complex<float>
#define SCALAR_SUFFIX c
#define SCALAR_SUFFIX_UP "C"
#define REAL_SCALAR_SUFFIX s
#define ISCOMPLEX 1
#include "Eigen\blas\level1_impl.h"
#include "Eigen\blas\level1_cplx_impl.h"
#include "Eigen\blas\level2_impl.h"
#i... | TOOL | 0.985811 | 5.664164 |
93e0616a-2cf8-4799-8b9e-c406f0ac61c6 | ezequiel-lazarte/Facultad | Programacion Orientada a Objetos/Unidad 7/Teoria/Template.cpp | #include <iostream>
using namespace std;
int main() {
///Template en funciones
///funcion generica o plantilla
///ejemplo una funcion que busca el menor del vector
??? menor(const vector<???> &v) {
??? men = v[0];
for(size_t i=1;i<v.size();i++) {
if(v[i]<men)
men = v[i];
}
return men;
}
/// sepod... | ALGO | 0.980386 | 3.64617 |
b4d4f962-0986-4e58-87ef-2a8e75607b14 | dirkneuhaeuser/exercise-problems | graph/bipartite_and_cycle_check/kattis_amanda.cpp | #include"bits/stdc++.h" // using "" instead of <>, so it will search locally for the precompiled version first
using namespace std;
// int up to 2*10^9 (2^31-1)
typedef long long ll; // ll up to 9*10^18 (2^63 -1)
typedef unsigned long long ull; ... | ALGO | 0.999823 | 4.139849 |
58a64ddd-ee4b-4d51-a796-09274805a9a8 | divyanshu29jha/DSA | Binary Trees/104_Maximum-Depth-of-Binary-Tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | ALGO | 0.999993 | 7.139377 |
c34246d4-8365-4b83-a259-79b732f3f41b | yzcmf/Interview | LeetCode-Solutions/C++/random-point-in-non-overlapping-rectangles.cpp | // Time: ctor: O(n)
// pick: O(logn)
// Space: O(n)
class Solution {
public:
Solution(vector<vector<int>> rects) :
rects_(move(rects)),
gen_{(random_device())()} {
for (const auto& rect : rects_) {
const auto width = rect[2] - rect[0] + 1;
const auto height ... | ALGO | 0.99984 | 7.432671 |
013fc42f-6b66-4ff2-96a1-86447b15e0b3 | GyeongyeonAn/DataStructure | DataStructure/StackLinkedList.cpp | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef int element;
typedef struct stackNode
{
element data;
stackNode* link;
}stackNode;
stackNode* top;
void push(element item) //
{
stackNode* temp = (stackNode*)malloc(sizeof(stackNode));
temp->data = item;
temp->link = top;
top = temp;
}
element... | ALGO | 0.997452 | 3.397135 |
01575748-3939-42c9-8aa7-780b99184390 | ishandutta2007/codeforces | suiseiseki/normal/500/G.cpp | #include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
#define N_ 200010
#define INF 99999999999999999LL
vector<int>E[N_];
int n, Q;
int Dep[N_];
int par[18][N_];
void DFS(int node, int dep, int pp){
int i, x;
Dep[node] = dep;
par[0][node] = pp;
for (i = 0; i < E[node].size(); i++){
x... | ALGO | 0.999938 | 4.468998 |
df44240d-8a88-4b0b-8664-cad702a4697f | nicknamexyz/nicknamexyz | oop pract6.cpp.cpp | /*
Write C++ program using STL for sorting and searching with user-defined
records such as Person Record (Name, birth date, telephone no), item record
(item code, item name, quantity and cost)
*/
#include <iostream>
#include <algorithm>
using namespace std;
class student{
public:
int dob;
long tel;
string name... | TOOL | 0.999431 | 4.905495 |
ee5f683d-7deb-4877-9d87-996d4effe182 | 2002Bishwajeet/DSA_Practice_Question_And_Guides | HackerRank/Problem Solving/leftRotation.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<int> rotation(vector<int> v, int k)
{
int n = v.size();
vector<int> v1(n);
/*
suppose this is an array [1,2,3,4,5]
now we have to rotate it to left by the number given by k
say if k = 2
then we have to rotate it to l... | ALGO | 0.999936 | 3.872977 |
ab405d42-939d-446a-95fd-37a74fdb1f94 | dwip-nandi/CodeForces | B_AGAGA_XOOORRR.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> arr(n + 1);
for (int i = 1; i <= n; i++)
cin >> arr[i];
vector<int> pre(n + 1, 0);
for (int i = 1; i <= n; i++)
pre... | ALGO | 0.999905 | 4.334159 |
b108c488-4d60-4140-adf9-315311364451 | FinkThePanda/codingRoadmap | P2-simple-data-structures/src/hash_tabel.cpp | #include "../include/hash_tabel.hpp"
#include <iostream>
HashTable::HashTable(int size) : size(size), table(size) {}
int HashTable::hashFunction(int key) const {
return key % size;
}
void HashTable::insert(int key, int value) {
int index = hashFunction(key);
table[index].push_back({key, value});
}
bool ... | ALGO | 0.941539 | 5.889635 |
6b877315-8456-42a3-9d3d-80bdd4767b56 | raincross7/code-similarity | codes/train_code/problem372/problem372_408.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
int main() {
ll n; cin>>n;
long double a=sqrt(n);
ll b=a/1;
ll ans;
rep(i,n){if(n%(b-i)==0){ans=b-i;break;}}
... | ALGO | 0.999888 | 3.356525 |
a9481205-0176-483b-a8d7-e253aad6d4da | darion-yaphet/ClickHouse-25.5.3.75-stable | src/Client/BuzzHouse/Generator/FuzzConfig.cpp | #include <Client/BuzzHouse/Generator/FuzzConfig.h>
#include <ranges>
#include <IO/copyData.h>
#include <Common/Exception.h>
#include <Common/formatReadable.h>
namespace DB
{
namespace ErrorCodes
{
extern const int BUZZHOUSE;
}
}
namespace BuzzHouse
{
using SettingEntries = std::unordered_map<String, std::function<v... | CONFIG | 0.939311 | 7.778083 |
84c91490-ca7a-48ea-80fb-e092a99c942f | matteogilioli/llvm-17.0.6 | src/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/is_partitioned.pass.cpp | // <algorithm>
// template <class InputIterator, class Predicate>
// constexpr bool // constexpr after C++17
// is_partitioned(InputIterator first, InputIterator last, Predicate pred);
#include <algorithm>
#include <functional>
#include <cstddef>
#include <cassert>
#include "test_macros.h"
#include "te... | TEST | 0.933211 | 7.260751 |
6133fcb9-39b7-45ae-a6f6-0f86545fd57b | savirsingh/atcoder-solutions | abc292/C.cpp | // code by savir singh
// C - Four Variables
#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long
#define pii pair<int, int>
const int MM = 101;
int n;
int get_num_ways(int x) {
int count = 0;
for (int i = 1; i <= sqrt(x); i++) {
if (x % i == 0) {
int j = x / i;
... | ALGO | 0.999909 | 4.251901 |
4547bd7f-4b5a-4d0a-8702-d54664bd5bc3 | HohyunKim-kr/c-_homework | 20230110/Level7_8.cpp | #include<iostream>
int main()
{
int arr[3][3] = { {3,4,1},{2,1,4},{3,3,0} };
int even = 0;
int odd = 0;
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 3; j++)
{
if (arr[i][j] % 2 == 0)
{
even++;
}
else
{
odd++;
}
}
}
std::cout << "¦ :" << even << std::endl;
std::cout << "Ȧ :"... | ALGO | 0.999825 | 4.617882 |
37166400-b9b0-4111-ad04-b1b89890f000 | shreyatpandey/Coding-Challenges | C++/Link List/Delete A Node :- GivenPosition-GivenNode-GivenValue.cpp | #include<iostream>
using namespace std;
class Node
{
public:
int Value;
Node* next;
Node(int val)
{
Value = val;
next = nullptr;
}
};
void AppendNode(Node** head,int Value)
{
Node* newNode = new Node(Value);
if ( *head == nullptr)
{
*he... | ALGO | 0.999895 | 4.632702 |
677e796f-1a17-4298-af74-6c2ddae793a6 | clarammdantas/Online-Jugde-Problems | online_judge_solutions/gifts.cpp | //gifts -codeforces div2-A
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> nums;
for(int i = 0; i < n; i++){
int x;
cin >> x;
nums.push_back(x);
}
vector<int> realOrder;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if((i + 1) == nums.at(j)){
... | ALGO | 0.99998 | 3.948453 |
18bb4965-2c15-4952-9918-918b67e0616f | sarvex/leetcode-simula | solution/0100-0199/0189.Rotate Array/Solution.cpp | class Solution {
public:
void rotate(vector<int>& nums, int k) {
int n = nums.size();
k %= n;
reverse(nums.begin(), nums.end());
reverse(nums.begin(), nums.begin() + k);
reverse(nums.begin() + k, nums.end());
}
}; | ALGO | 0.99999 | 6.18748 |
9952609c-fd8a-4a6d-a774-756764bab4bd | hardware-fab/vespa | soft/common/drivers/common/utils/eigen/bench/perf_monitoring/gemv.cpp | #include "gemv_common.h"
EIGEN_DONT_INLINE
void gemv(const Mat &A, const Vec &B, Vec &C)
{
C.noalias() += A * B;
}
int main(int argc, char **argv)
{
return main_gemv(argc, argv, gemv);
}
| ALGO | 0.923177 | 4.484408 |
0d88e772-038e-407d-854f-6d951cecfcae | kongonggong/Programming.in.th_CPP | 0004.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
bool c=0,C=0;
string s;
cin >> s;
for(int i=0;i<s.length();i++)
{
// cout << int(s[i]) <<" ";
if(c==1&&C==1) break;
if(int(s[i])>=97) c = 1;
else if(int(s[i])<=90) C = 1;
}
if(c==1 && C==1) cout <<"Mix... | ALGO | 0.999728 | 3.779585 |
6e94ced5-9c45-46fe-888b-c6632b3b7056 | snishal/coding-practice | leetcode-30-days-challenge/backspace_string_compare.cpp | // Solution 1
class Solution {
private:
string build(string S){
string SNew;
stack<char> s;
for(const char& ch : S){
if(ch == '#'){
if(!s.empty()){
s.pop();
}
}else{
s.push(ch);
}... | ALGO | 0.999875 | 6.467192 |
65cdc00d-a975-47eb-ab9a-c7d80a3b10da | ytqqwer/Learning-Game-AI-Programming-with-Lua | 1336OS_Code/src/bullet_collision/src/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp | #include "btConvex2dConvex2dAlgorithm.h"
//#include <stdio.h>
#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"
#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/Collisio... | ALGO | 0.999878 | 6.651969 |
2d177aad-0042-4c85-a2da-7660f0e5959b | ColdCode0214/LeetCode_local | 5960-将标题首字母大写.cpp | class Solution {
public:
string capitalizeTitle(string title) {
int lens=title.size();
if(lens<=2)
{
for(int i=0;i<lens;i++)
title[i]=tolower(title[i]);
return title;
}
string s2="";
int temp=0, index=0;
while(index<lens... | ALGO | 0.999434 | 5.581168 |
e8fbdcb3-363c-4c2c-b554-2cbbc5785320 | kubaskubas/fmomon | lekcja2/main.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
using namespace std;
vector<double> d_weX;
vector<double> d_weY;
struct punkt{
double x, y;
};
vector<punkt> pkt;
int main()
{
ifstream we("wuz2-zad-1-punktytxt.txt");
punkt p[100];
int i = 0;
while (!we.eof())
{
... | ALGO | 0.979575 | 3.896075 |
16a75c05-9f82-4f2b-bec5-102f13dd12f1 | ISIR-SYROCO/GHController | examples/test_kuka/main_4tasks.cpp |
#include <iostream>
#include <Eigen/Eigen>
#include "kukafixed.h"
//#include "kukafree.h"
#include "orcisir/OrthonormalFamily.h"
#include "orcisir/ISIRController.h"
#include "orcisir/Solvers/OneLevelSolver.h"
#include "orc/control/Feature.h"
#include "orc/control/FullState.h"
#include "orc/control/ControlFrame.h"
... | ALGO | 0.998266 | 3.117599 |
d9310006-205f-43e3-ae18-9f0d28475fce | ikshvaku01/DSA | REPOSITORY/QUESTIONS LIBRARY/COMPETITIVE CODING/CODECHEF/0000-1000 Beginner Level/PALL01.cpp | #include <iostream>
using namespace std;
int checkPalindrome(string str)
{
for (int i = 0; i < (str.length()) / 2; i++)
{
if (str[i] != str[str.length() - i - 1])
return false;
}
return true;
}
int main()
{
int k;
cin>>k;
while(k--)
{
string s;
cin>>s;
(checkPa... | ALGO | 0.999838 | 4.037745 |
e51daeb9-d315-4616-b409-c7d72bf69dc7 | BrunoLad/coding-challenges | Uri Online Judge - beecrowd/1153 - Simple Factorial.cpp | // simple factorial
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = n - 1; i > 0; i--)
{
n *= i;
}
cout << n << endl;
return 0;
}
| ALGO | 0.999977 | 5.06984 |
a3208235-228b-46dc-a249-6ed24c5b1208 | YanfeiORNL/EP10x | third_party/eigen/doc/examples/TemplateKeyword_simple.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace Eigen;
void copyUpperTriangularPart(MatrixXf& dst, const MatrixXf& src)
{
dst.triangularView<Upper>() = src.triangularView<Upper>();
}
int main()
{
MatrixXf m1 = MatrixXf::Ones(4,4);
MatrixXf m2 = MatrixXf::Random(4,4);
std::cout << "m2 before copy:"... | TOOL | 0.987566 | 5.210898 |
f0771d28-0a1f-43ef-a305-27baa605d237 | Arshita-k/DSA_C_plus_plus | Graphs/RottenOranges.cpp | // Input: grid = [[2,1,1],[1,1,0],[0,1,1]]
// Output: 4
// Input: grid = [[2,1,1],[0,1,1],[1,0,1]]
// Output: -1
//0 means cell is empty, 1 means cell has fresh orange whereas 2 means rotten orange
#include <bits/stdc++.h>
using namespace std;
int orangesRotting(vector<vector<int>>& grid) {
int rows=grid.size();... | ALGO | 0.999883 | 6.345298 |
99181e37-37cc-47fd-885e-8dead0e37e77 | alexrusev03/LeetCode-Problems | C++/1104. Path In Zigzag Labelled Binary Tree.cpp | class Solution {
public:
vector<int> pathInZigZagTree(int label) {
vector<int> res;
res.push_back(label);
for(int i = log2(label); i>0; i--){
label=pow(2,i-1)+pow(2,i)-label/2-1;
res.push_back(label);
}
reverse(res.begin(),res.end());
return re... | ALGO | 0.999979 | 5.457628 |
2237b4f6-f26c-474f-90fd-a2016931e3e2 | ishandutta2007/codeforces | tute7627/normal/1342/C.cpp | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define P... | ALGO | 0.999348 | 3.474026 |
4f45c9f8-48ee-4b73-916b-7a51b1fd8519 | ISTE-SS-24-DSA/Asmita_230905100 | week 1/question 7.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int i;
vector<int> v;
int n,val;
cout<<"Type the number of elements in the vector: "<<endl;
cin>>n;
for(i=0;i<n;i++){
//accepting user inputs as elements in vector
cout<<"enter the value... | ALGO | 0.999689 | 4.510103 |
55fc997e-b76d-4a02-967f-90486ecc465b | julliet27/Past_solved_problem | YetAnotherArrayRestoration.cpp | #include<bits/stdc++.h>
#define ll long long int
#define u int
#define endline "\n"
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
const int mod=1e9+7;
int main(){
fast_cin();
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output... | ALGO | 0.999825 | 3.961339 |
ae8f011d-545c-4957-8447-85c5e4b629a1 | NikhilKD/DSA-Leetcode | 2000-minimum-speed-to-arrive-on-time/2000-minimum-speed-to-arrive-on-time.cpp | class Solution {
public:
bool f(int mid,vector<int>& dist, double hour){
double x=0;
for(int i=0;i<dist.size();i++){
x+=((double)dist[i]/(double)mid);
if(i!=dist.size()-1){
x=ceil(x);
}
}
// cout<<mid<<" <<x<<endl;
return x<... | ALGO | 0.999945 | 5.137334 |
1e84684e-6bc9-4c8c-b9a3-7557261835a2 | castrovictor/Practicas-ED | Práctica 3 - Implementación de pilas/src/Pila_max_Cola.cpp | #include<iostream>
#include<cassert>
#include<Pila_max_Cola.h>
using namespace std;
PilaMax& PilaMax::operator=(const PilaMax& otra){
pila = otra.pila;
}
int PilaMax::getUsed() const {
return pila.num_elementos();
}
bool PilaMax::empty() const {
return pila.vacia();
}
void PilaMax::push(int elem) {
... | ALGO | 0.945369 | 4.715654 |
7a9c65bc-7d55-43b4-8e4b-ffed5338a340 | vusec/stickytags | llvm-project/mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp | #include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/Dialect/Utils/IndexingUtils.h"
#include "mlir/Dialect/Vector/IR/VectorOps.h"
#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
#include "mlir/Dialect/Vector/Utils/VectorUtils.h"
#include "mlir/IR/BuiltinTy... | TOOL | 0.952209 | 7.255338 |
889b0f8b-19ab-427b-95c0-20b27a435da9 | nikhil-admal/mdstresslab | unit_tests/testLDADSW/testLDADSW.cpp | /*
* main.cpp
*
* Created on: Nov 3, 2019
* Author: Nikhil Admal
*/
#include "MethodLdad.h"
#include <string>
#include <iostream>
#include <tuple>
#include <fstream>
#include "BoxConfiguration.h"
#include "calculateStress.h"
#include "Grid.h"
#include "typedef.h"
#include "../compareStress.cpp"
int main()
{... | ALGO | 0.991297 | 3.700915 |
6f50c530-1efd-4f4c-9b02-e481536b04d7 | Amylo-jh/baekjoon | 21000s/21573.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n, m;
string str;
cin >> n >> m >> str;
if(str == "freeze")
{
cout << min(n, m);
}
else if(str == "heat")
{
cout << max(n, m);
}
else if(str == "auto")
{
cout << m;
}
... | ALGO | 0.995117 | 3.585495 |
e56af0cc-2d95-4d32-9df1-c5de30825184 | AgnieszkaDelmaczynska/algorithms-and-data-structures | Project3_List-based_FIFO_queue/AISD_Projekt3/AISD_Projekt3/AISD_Projekt3_bez_klasy.cpp | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string>
using std::string;
void ADD_BEG(int given_value);
void ADD_END(int given_value);
void DEL_BEG();
void DEL_END();
void PRINT_FORWARD();
void PRINT_BACKWARD();
void PUSH(int given_value);
void POP();
void PRINT_QUEUE();
vo... | ALGO | 0.999381 | 4.421517 |
8034dcdd-2a30-432b-b639-38f063b65a88 | Bart-coding/leetcode | 509. Fibonacci Number/Fibonacci_DynamicProgramming.cpp | class Solution {
public:
int calculateFib(int n, unordered_map<int,int> &map) {
if (map.find(n) != map.end()) //n exists in map
return map[n];
map[n] = calculateFib(n-1, map) + calculateFib(n-2, map);
return map[n];
}
int fib(int n) {
unordered_map<i... | ALGO | 0.999954 | 6.531817 |
7d3d9dcd-9d2f-4ec3-aec5-0fef88e03210 | dhanashree0107/training_assignment | 18th_june/wild_char.cpp | /*
Wild character
Date: 14/06/2021
*/
#include<iostream>
using namespace std;
void func(string &str,string &new_str,int &str_index,int &patt_index){
new_str =new_str + str[str_index];
str_index++;
patt_index++;
}
int main(){
string str,patt;
cout<<"Enter the string: ";
cin>>str;
cout<<... | ALGO | 0.999842 | 3.726438 |
48bbff5e-e51a-4d47-99dc-d7ce38270387 | AFIFAHSYZ/lect5Q1 | lect5Q1/Source.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int num = 0;
int number;
while (num < 100)
{
cin >> number;
cout << sqrt(number);
}
return 0;
} | ALGO | 0.998938 | 3.411845 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.