uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
44533a43-baaa-4f2d-a737-06d5e3f8d3ee | Ducmljaja/website123 | ctdlgt/lab3/bai1.cpp | #include <iostream>
#include <string>
#include <cctype> // isdigit, isalpha
#include <cmath> // pow
using namespace std;
// -------------------- CẤU TRÚC STACK ----------------------
struct Node {
char data;
Node* next;
};
class Stack {
private:
Node* top;
public:
Stack() {
top = nullptr... | ALGO | 0.99995 | 5.022593 |
8176508d-6168-4b9a-afd9-66e9a786bb61 | naumazeredo/competitive-programming | codeforces/223B.cpp | #include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define cl(x, v) memset((x), (v), sizeof(x))
#define gcd(x,y) __gcd((x),(y))
#ifndef ONLINE_JUDGE
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define _ ... | ALGO | 0.999995 | 3.692378 |
b8ddfad2-db6b-4745-bc21-bf044a3ee813 | hjiang13/LLMs-in-IR | POJ-104/71/1146.cpp | #include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
int n,i,j,k,l;
int a[13]; //mei gei yue de tian shu//
int b[201]; //nian fen//
int c[201],d[201],sum[201]; //diyigeyuefen di er ge//
cin >> "%d",&n);
for(l=1; l<=n; l++){
sum[l]=0; }
for(i=1; i<=n; i++){
cin >> "%d %d %d",&b[i],&c[i],&d[i]);
... | ALGO | 0.999984 | 3.296531 |
6e7e1c7c-516b-4508-8870-c211312ab071 | Zhaochenyangll/C | 3.cpp | #include<stdio.h>
int main()
{
int i,j,a[3][3],sum=0;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
if(i==j||i==2-j) sum+=a[i][j];
}
}
printf("The sum of the diagonal elements is %d\n",sum);
return 0;
}
| ALGO | 0.999701 | 3.538177 |
a9487682-ec05-44e3-9496-721b9cbaa635 | Shiba0228/CPE-UVA- | uva11005.cpp | //cheapest base
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
//function f:將十進制數字 a 轉換為進制 b 表示的數字,並存儲在 arr 中
//使用 tmp[] 暫存轉換後的每一位(從低位到高位)。
//通過 a % b 取餘數,得到在進制 b 下的最低位,然後除以 b 繼續處理,直到 a < b
//最後將 tmp 中的數字逆序存入 arr,因為 tmp 存儲的是從低位到高位,而 arr 需要從高位到低位。
int f(int a, int b, int arr[], int &cnt) ... | ALGO | 0.999697 | 4.355846 |
2ffec3c8-1314-419a-a7ce-90ea332936d5 | 2mulin/brushQuestion | LeetCode/algorithm/1801_1900/1817_active.cpp | /**
* @date 2022/1/20
* @author 2mu
* @brief medium 查找用户活跃数
*
* 一、哈希表
* 使用哈希表模拟,set类型 哈希表去重。
*
* 时间复杂度:O(n)
* 空间复杂度:O(n)
*/
#include <iostream>
#include <string>
#include <vector>
#include <unordered_set>
#include <unordered_map>
using namespace std;
std::vector<int> findingUsersActiveMinutes(std::vector... | ALGO | 0.999375 | 5.57064 |
b9467e48-fb05-420a-b6e0-0207e86b4add | xdandroid/frameworks_base | media/libstagefright/codecs/aacdec/calc_sbr_anafilterbank.cpp | /*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef AAC_PLUS
#include "calc_sbr_anafilterbank.h"
#include "qmf_filterbank_coeff.h"
#include "analysis_sub_band.h"
#include "aac_mem_f... | ALGO | 0.99953 | 3.567931 |
414b7400-6e83-4df1-aa59-7a7422eadb94 | ishandutta2007/codeforces | dreamoon_love_aa/normal/1177/A.cpp | /*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).be... | ALGO | 0.999907 | 3.21606 |
0f0ceee5-c17a-4a5f-bf0b-0fddc89e1bb9 | Sahib61003/DSA_Leetcode | March_questions/scramble_string.cpp | //Problem: Scramble String
//Link: https://leetcode.com/problems/scramble-string/
//Code:
class Solution {
public:
unordered_map<string, bool> mp;
bool isScramble(string s1, string s2) {
if(s1 == s2)
return true;
string key = s1 + "*" + s2;
if(mp.count(key))
retu... | ALGO | 0.999973 | 6.396464 |
4eb33796-74d2-416e-a939-01886d65d00b | chiyanYang/CrackingTheCodes | CrackingTheCodes/Chapter8/8_3/8_3.cpp | #include "8_3.h"
// Magic Index
void test8_3()
{
int resultIdx = -1;
//vector<int> curVector { -2, -1, 0, 1, 2, 3, 4, 5, 8 };
vector<int> curVector{ -2, -1, -1, -1, 2, 4, 4, 4, 8 };
//resultIdx = MagicIndexBS(curVector, 0, 8);
resultIdx = MagicIndexBS_NonDistinct(curVector, 0, 8);
if (resultIdx == -1)
{
cou... | ALGO | 0.998512 | 4.437847 |
468e8ec4-500b-45d3-857d-d02ac59a09dd | JediChou/jedichou-study-algo | standard-cpp/cpp-PeaStaringOutCpp/ch04/program0407.cpp | // Starting Out with CPP.pdf, page 164
// Description:
// This program average 3 test scores. The braces
// were indavertently left out of the if statement.
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
const int HIGH_SCORE = 95; // A high socre is 95 or greater
int score1, score2, sc... | ALGO | 0.881674 | 4.497177 |
a24d76c3-602a-48cb-8060-83546e2ba124 | Mobink980/Network-on-Chip | src/systemc/tests/systemc/misc/user_guide/chpt11.4/mean.cpp | /*****************************************************************************
mean.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************
... | ALGO | 0.999378 | 4.597202 |
5bc8e4bb-b3c5-4ea5-96dd-a126207e88ae | alex1craig/cosc-77 | ext/eigen/failtest/qr_int.cpp | #include "../Eigen/QR"
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
#define SCALAR int
#else
#define SCALAR float
#endif
using namespace Eigen;
int main()
{
HouseholderQR<Matrix<SCALAR,Dynamic,Dynamic> > qr(Matrix<SCALAR,Dynamic,Dynamic>::Random(10,10));
}
| TEST | 0.909178 | 3.076401 |
e5adb1f9-833a-4dde-9a00-37823af7c7fd | priyyankka/coursera-data-structures-and-algorithms | Algorithms on Graphs/week3_paths1/2_bipartite/bipartite.cpp | #include <iostream>
#include <vector>
#include <queue>
using std::vector;
using std::queue;
int bipartite(vector<vector<int> > &adj) {
//write your code here
// Create a color array to store colors assigned to all veritces.
// Vertex number is used as index in this array. The value '-1'
// of colorArr[i] is ... | ALGO | 0.999979 | 5.312789 |
f2764c1c-aaf2-43df-9d98-e1d00b43b7d5 | muhammet-mucahit/My-C-Studies | Others/3.cpp | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
void mySubtract(const int *,const int *,int *);
int main()
{
int myVar1=30;
int myVar2=10;
int myVar;
mySubtract(&myVar1,&myVar2,&myVar);
printf("CIKARMA ISLEMI SONUCU : %d",myVar);
}
void mySubtract(const int *param1,const int *param2,int *param3)
{
*p... | ALGO | 0.98623 | 3.537335 |
2b501ad8-c6f2-4fca-ae8a-6b2faf535bc6 | vovabatsyk/ITStep-cpp2 | Project/_string.cpp | #include "_string.h"
String::String() {
str = nullptr;
str = new char[size + 1];
str[size] = '\0';
}
String::String(const char sym)
{
size = 2;
this->str = new char[size];
this->str[0] = sym;
this->str[1] = '\0';
}
String::String(const char* str) {
int length = strlen(str) + 1;
this->str = new char[length];... | TOOL | 0.971992 | 3.941611 |
3ac7e445-7168-4a2a-be15-c7caad44d7ee | LingzheZhao/Positioning-and-Navigating-Lab-Undergraduate-Training | Dev Video Registration/Image Registration/src/libOrsa/homography_model.cpp | /**
* @file homography_model.cpp
* @brief Homography matrix model
* @author Pascal Monasse, Pierre Moulon
*
* Copyright (c) 2011,2020 Pascal Monasse
* Copyright (c) 2011 Pierre Moulon
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the G... | ALGO | 0.998236 | 6.89544 |
027e7477-407d-4205-b506-0a5156efe6b1 | garrykevin-ep/Algorithm-Code-Library | Data Structure C++/pair in set/a.cpp | using namespace std;
#include <bits/stdc++.h>
#define foreach(i,n) for(__typeof((n).begin())i =(n).begin();i!=(n).end();i++)
#define rep(i,n) for(__typeof(n) i=0; i<(n); i++)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define ins insert
#define ff first
#define ss second
#define ll long... | ALGO | 0.99699 | 3.030427 |
976f1312-8bd1-4247-bc0f-863a517a11a7 | krishnakumar5399/100DaysOfCode | DAY 32/BinarySearch_2D_matrix.cpp | #include<bits/stdc++.h>
using namespace std;
bool binarySearch(vector<vector<int>>arr,int target){
int n = arr.size() ; // it is denoted row size ;
int m = arr[0].size() ; // it is denoted col size ;
int s = 0 ;
int e = n*m-1 ;
// let virtually convert 2d vector in mind 1d and search simple bi... | ALGO | 0.999928 | 4.751294 |
b6791cf2-1130-427f-9436-c1575eb191ad | franky90237/LeetCode | Easy_326. Power of Three.cpp | //2022-04-20
//time : O(log(3)(n))
//space : O(1)
class Solution {
public:
bool isPowerOfThree(int n)
{
if(n<=0) return false;
while(n%3==0)
{
n=n/3;
}
return n==1;
}
};
//2022-04-20
//1162261467=3^19
//3^19 is biggiest pow... | ALGO | 0.999639 | 6.001139 |
3c2cdc36-7448-40a6-ac5a-ad976f53c409 | Blue-Silvers/NewParticulSystem | ParticulSystem/ballsPool.cpp | #include "ballsPool.h"
ballsPool::ballsPool()
{
}
sf::Color ballsPool::GetColor(float t)
{
const float r = sin(t);
const float g = sin(t + 0.33f * 2.0f * M_PI);
const float b = sin(t + 0.66f * 2.0f * M_PI);
return { static_cast<uint8_t>(255.0f * r * r),
static_cast<uint8_t>(255.0f * g * g... | TOOL | 0.92 | 4.434712 |
73ba1cd5-c1fa-430f-b109-197818bbb957 | jailsonevora/leetcode-problem-set | Graph/Topological Sort/DFS+Stack/802.FindEventualSafeStates.cpp | #include <iostream>
#include <stack>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
// check cycle in for each path
bool hasCycle(int u, vector<vector<int>>& graph, vector<int> &visited){
if(visited[u] == 1) // viseted
return false;
// processing curr... | ALGO | 0.999997 | 5.587147 |
d55ced91-df57-4729-bb66-3726b752ceea | meilleur777/Competitive_Programming | BOJ/cpp/2752.cpp | #include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> intp;
void init_code() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", ... | ALGO | 0.999853 | 3.477103 |
765c4211-9ad9-44df-9f19-ffec38517b15 | BeanSamuel/cpp_practice | codeforces/4A.cpp | /*
Question: A. Watermelon
Link: https://codeforces.com/problemset/problem/4/A
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define F first
#define S second
#define EB emplace_back
#define PB push_back
#define si... | ALGO | 0.99985 | 5.289988 |
810e6660-2dcc-49b5-8398-8378bd2aaada | raincross7/code-similarity | codes/train_code/problem390/problem390_6.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
ll a, b;
cin >> a >> b;
if (a == b) {
cout << 2 * a - 2 << endl;
continue;
... | ALGO | 0.999928 | 3.823437 |
9cfd544f-f7e6-46f2-8cda-c2c4f38c9fcd | patil-kaushal/DAA-Lab | Knapsack.cpp | #include<iostream>
using namespace std;
void knapsack(int n,float weight[],float profit[],float capacity) // Function to solve knapsack problem
{
float x[20],tp=0;
int i,j,u;
u=capacity;
for(i=0;i<n;i++) // Initial... | ALGO | 0.999982 | 4.466929 |
92d981ca-af42-4815-a9a8-82ba2bbe53f5 | jocic/jocic | libraries/opencv/4.8.0/samples/cpp/tutorial_code/Histograms_Matching/calcHist_Demo.cpp | /**
* @function calcHist_Demo.cpp
* @brief Demo code to use the function calcHist
* @author
*/
#include "opencv2/highgui.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>
using namespace std;
using namespace cv;
/**
* @function main
*/
int main(int argc, char** argv)
{
... | ALGO | 0.924747 | 6.791678 |
f157166e-bde7-4708-8ce7-ac2b865baba8 | ming-ki/Cpp-practice | 8th-practice/GenericSwap.cpp | #include <iostream>
using namespace std;
template <class T1, class T2>
void mcopy(T1 src[], T2 dest[], int n) {
for (int i = 0; i < n; i++) {
dest[i] = (T2)src[i];
}
}
int main() {
int x[] = { 1,2,3,4,5 };
double d[5];
char c[5] = { 'H','e','l','l','o' }, e[5];
mcopy(x, d, 5);
mcopy(c, e, 5);
for (int i =... | ALGO | 0.984902 | 3.833504 |
55b7cff2-4013-47a6-829c-dcd41f2ebcb5 | 10K-K10/Basic-Coding | AlgoImplemtation/KadaneAlgo.cpp | #include<iostream>
using namespace std;
int kadane(int arr[], int ln)
{
int max=0,present=0;
for(int i=0;i<ln;i++)
{
present+=arr[i];
if(present<0)
present=0;
else if(max<present)
max=present;
}
return max;
}
int main()
{
int ln;
cin>>ln;
int arr[ln];
for(int i=0;i<ln;i++)
cin>>arr[i];
int maxsub... | ALGO | 0.999923 | 3.883161 |
0d360154-55cd-471a-82d0-691d94f8e5bd | JanathonL/LeetCode | solutions/187-Repeated DNA Sequences.cpp | // 187. Repeated DNA Sequences
// 简单的方法是直接用一个hashmap把所有的子串进行计数,然后大于1次的输出
// 还可以用hash值进行字符串编码
// hash = hash<<2 | hashvalue(str[i]);
class Solution {
public:
vector<string> findRepeatedDnaSequences(string s) {
unordered_set<int> myset;
if(s.size()<10) return vector<string>();
vector<string> ... | ALGO | 0.998349 | 5.209519 |
8ab23991-73a2-4f6f-84a5-8bfdfd6a3256 | snykiotcubedev/arangodb-3.7.6 | 3rdParty/boost/1.71.0/libs/compute/perf/perf_set_difference.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include <boost/compute/system.hpp>
#include <boost/compute/algorithm/set_difference.hpp>
#include <boost/compute/container/vector.hpp>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}... | ALGO | 0.966737 | 5.842721 |
bd60d0ab-f64c-4b16-805c-73ee8e2a3e8f | Braulinh0/ACOIIN-Problems-and-Solutions | Semana 2/cpp/b.cpp | #pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define f float
#define endl '\n'
void usaco(string filename) {
freopen((filename + ".in").c_str(), "r", stdin);
freopen((filename + ".out").c_str(), "w", stdout);
}
int main() {
ios::sync_with_stdio(0);
cin.... | ALGO | 0.987185 | 3.682536 |
65802554-bb5d-4436-978d-587389feb2d6 | joker-eph/llvm-project-with-mlir | llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | #include "ELFObjcopy.h"
#include "Buffer.h"
#include "CopyConfig.h"
#include "Object.h"
#include "llvm-objcopy.h"
#include "llvm/ADT/BitmaskEnum.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "l... | TOOL | 0.884033 | 6.42491 |
e1c8c18d-dc82-43fe-96c8-2fb18b754856 | ManishRB21/Programs | number pattern/pattern50.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int num=1;
for(int i=n;i>=1;i--){
for(int j=i;j<n;j++){
cout<<j;
}
for(int j=1;j<=i;j++){
if(i==j)
cout<<"0";
}
for(int j=n-1;j>=i;j--){
cout<<j;
}
cout<<endl;
}
}
| ALGO | 0.999981 | 3.316227 |
0c364904-c643-4f4f-b951-3ad051fd52f5 | Syed-Hamza-Ali-Shah-SE/course-work | datastructures-and-algortihm/binary-trees/task-2/task-10.2.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* left;
Node* right;
};
Node* createNode(int value) {
Node* newNode = new Node();
newNode->data = value;
newNode->left = newNode->right = nullptr;
return newNode;
}
void countNodesByDegree(Node* root, int& degree0, int& ... | ALGO | 0.999924 | 6.631322 |
b5078ad7-0097-4435-9085-fc879125b68c | sarvex/leetcode-emoji-code | lcof2/剑指 Offer II 023. 两个链表的第一个重合节点/Solution.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* getIntersectionNode(ListNode* headA, ListNode* headB) {
ListNode* cur1 = headA;
ListNode* cur2 = headB;
... | ALGO | 0.998959 | 5.292139 |
b580000f-369e-4b68-a1f1-96e5efc6437e | didwjddyd/SynapSoft-Quiz | Quiz5/main.cpp | /*
* Quiz 5: 숫자 목록을 이용해 만든 두 자연수 합의 최솟값
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/*
* 숫자 목록 벡터를 규칙에 따라 벡터 3개로 나눔
*
* 나누는 규칙
* 1. 0은 zeros 벡터로 이동
* 2. 0이 아닌 경우
* 2-1. a와 b의 원소 갯수가 다른 경우: 둘 중 원소 갯수가 작은 벡터로 이동
* 2-2. a와 b의 원소 갯수가 같은 경우: 둘 중... | ALGO | 0.999936 | 5.315912 |
394b0046-7f49-4902-bec2-f41b4de11a51 | Vishvam10/CP-Problems | CodeForces/467a/main.cpp | #include <iostream>
int main() {
int n;
int ans = 0;
std::cin >> n;
for (int i = 0; i < n; i++) {
int a, b;
std::cin >> a;
std::cin >> b;
if (b - a >= 2) {
ans++;
}
}
std::cout << ans << std::endl;
return 0;
}
| ALGO | 0.999228 | 4.547744 |
67adce48-a752-454b-91b6-664d2472aa98 | Hasin-Ishrak/CodeFolio | vscode(c++)/borze.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cin>>s;
for(int i =0; i<s.size();i++)
{
if(s[i]=='.')
{
cout<<'0';
}
else if(s[i]=='-' && s[i+1]=='.')
{
cout<<'1';
i++;
}
else{
cout<... | ALGO | 0.999671 | 3.311661 |
7439f817-8c87-4e80-b252-79901c9b411e | anusha2009/leetCodeSubmissions | 27-remove-element/remove-element.cpp | class Solution {
public:
int removeElement(vector<int>& nums, int val) {
int j=0;
for(int i=0;i<nums.size();i++) {
if(nums[i]==val) {
continue;
}
else{
nums[j]=nums[i];
j++;
}
}
return j;
}
}; | ALGO | 0.999632 | 6.000809 |
b7dc0bcf-012f-4fe1-8015-b3bc05acbf23 | sarvex/leetcode-elm | solution/0600-0699/0663.Equal Tree Partition/Solution.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.99994 | 6.199681 |
d13c0b18-a0c4-49e4-a193-777f9456d703 | rumangerst/algorithm_engineering | u3/axpy/axpy.cpp | // A simple example to try to get lots of Flops on
// Intel Xeon Phi co-processors.
#include <cstdlib>
#include <chrono>
#include <iostream>
#define FLOPS_ARRAY_SIZE (1024*1024)
//#define MAXFLOPS_ITERS 100000000
#define MAXFLOPS_ITERS 1000000
#define LOOP_COUNT 1024*1024
// Floating pt ops per inner loop iterati... | ALGO | 0.997712 | 5.116511 |
bd45c77b-76df-4524-8089-4fd4e71b7796 | jawdan-dev/LeetCode | Solutions/2285.MaximumTotalImportanceOfRoads.cpp | class Solution {
public:
long long maximumImportance(int n, vector<vector<int>>& roads) {
// Speed thingies.
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
// Get city connection count.
vector<long long> cityConnections(n, 0);
const int r = roads.size();
for (int i = 0; i < r; ... | ALGO | 0.999458 | 5.529118 |
060939eb-a89b-431e-8957-58ebc6f7691d | ozu-201/graph-puzzle-game-blackstonecan | src/General/AbstractGraph.cpp | //
// Created by Olcay Taner YILDIZ on 15.05.2023.
//
#include <climits>
#include "AbstractGraph.h"
#include "../Array/DisjointSet.h"
#include "../List/Graph/Edge.h"
AbstractGraph::AbstractGraph(int vertexCount) {
this->vertexCount = vertexCount;
}
Path *AbstractGraph::initializePaths(int source) const {
Pat... | ALGO | 0.996365 | 6.236051 |
656bb0d6-683c-46b1-9a41-fcb700396781 | iains/LLVM-7-branch | compiler-rt/test/fuzzer/AbsNegAndConstantTest.cpp | // abs(x) < 0 and y == Const puzzle.
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
if (Size < 8) return 0;
int x;
unsigned y;
memcpy(&x, Data, sizeof(x));
memcpy(&y, Data + sizeof(x), siz... | ALGO | 0.923432 | 5.294782 |
2aeda810-3218-4804-aaa8-6dbc35b12995 | Yesk0/KBTU_ADS_24-25 | LAB4/i.cpp | #include <iostream>
#include <map>
using namespace std;
int main() {
int Q;
cin >> Q;
map<int, int> bst; // A map to simulate a BST with multiplicity
while (Q--) {
string command;
int X;
cin >> command >> X;
if (command == "insert") {
// Insert X: increme... | ALGO | 0.99969 | 5.81946 |
7beea670-c783-4639-9083-f8f55f76322f | Apphle/C_programming | 2학기/RL_circuit/RL_circuit/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
double dt = 0.1; // ð
double t_end = 5.0; // ùķ̼ ð
double R, L, V;
double calculate_current(double I, double t)
{
double dI_dt = (V - R * I) / L;
return I + dI_dt * dt;
}
int main()
{
printf("R (resistance): ");
scanf("%lf", &R);
printf("L (... | ALGO | 0.997992 | 3.766869 |
d222474b-cd0b-47f6-b539-ed707ed5dec1 | Asitkumar6205/-CrackYourInternship | 08-Trees/01-diameter_of_binary_tree.cpp | class Solution {
public:
int height(TreeNode* root){
if(root==NULL)
return 0;
return 1+max(height(root->left),height(root->right));
}
int diameterOfBinaryTree(TreeNode* root) {
if(root==NULL)
return 0;
int o1=height(root->left)+height(root->right);
... | ALGO | 0.999785 | 6.574351 |
b253ddb0-f12a-4366-acf7-ba913a72c627 | ishandutta2007/codeforces | krijgertje/normal/516/E.cpp | #include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <list>
#include <cassert>
#include <ctime>
#include... | ALGO | 0.9999 | 3.239894 |
bb193ce8-a741-4258-b3e8-f416b3ee33a7 | Project-LegionOS-old/frameworks_av | media/codecs/amrwb/dec/src/pvamrwbdecoder.cpp | /*
------------------------------------------------------------------------------
Filename: pvamrwbdecoder.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
----------------------------------------------------------------------... | ALGO | 0.998697 | 4.140666 |
26a4733a-d72f-4f88-aa71-f34504260b67 | chung-nguyen/gamejam_gc_turbo_2019 | engine/frameworks/cocos2d-x/tools/simulator/libsimulator/lib/ProjectConfig/SimulatorConfig.cpp |
#include "SimulatorConfig.h"
#include <sstream>
SimulatorConfig *SimulatorConfig::_instance = NULL;
SimulatorConfig *SimulatorConfig::getInstance()
{
if (!_instance)
{
_instance = new SimulatorConfig();
}
return _instance;
}
SimulatorConfig::SimulatorConfig()
{
_screenSizeArray.push_back... | CONFIG | 0.941744 | 4.28234 |
40c16464-66e7-4edd-8d23-1530859bc617 | helloobaby/llvm_msvc | clang/lib/Tooling/Inclusions/HeaderAnalysis.cpp | #include "clang/Tooling/Inclusions/HeaderAnalysis.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/HeaderSearch.h"
namespace clang::tooling {
namespace {
// Is Line an #if or #ifdef directive?
// FIXME: This makes headers with #ifdef LINUX/WINDOWS/MACOS marked as non
// self-contained and is probably no... | TOOL | 0.858698 | 7.783246 |
2b122354-b054-4953-9dd4-a64e7b8e4f5b | minho65/ProblemSolving | minho/LastStudy/BOJ_Private/2101_QueueBasic.cpp | #include <iostream>
#include <stack>
#include <string>
using namespace std;
class Queue{
private:
int *data;
int idx_front;
int idx_back;
int len;
public:
Queue(int x);
int empty();
void push(int x);
void pop();
int front();
int b... | ALGO | 0.998595 | 4.157836 |
4d3b548e-2df3-4a7d-a61f-cfc12c8cfee2 | mpfeifer1/Euler | 015.cpp | #include <iostream>
using namespace std;
long int factorial(int movesNeeded, int sideLength);
int main() {
int sideLength = 20;
int movesNeeded = 2 * sideLength;
long int permutations = factorial(movesNeeded, sideLength);
cout << permutations << " different paths" << endl;
}
long int factorial(int... | ALGO | 0.999792 | 4.670493 |
0240ec63-a5ce-44e5-9527-15b979612a70 | LSH3333/PS | baekjoon/7569.cpp | #include <vector>
using namespace std;
#include <iostream>
#include <algorithm>
#include <queue>
int M,N,H;
int tomato[101][101][101];
int mark[101][101][101];
int dh[6] = {0, 0, 0, 0, 1, -1};
int dr[6] = {-1, 0, 1, 0, 0, 0};
int dc[6] = {0, 1, 0, -1, 0, 0};
queue<vector<int>> q;
int idx = 1;
void print() {
bool... | ALGO | 0.999857 | 4.319125 |
ae1bb7d4-1955-4705-937e-1bf682adf5de | jonggeunpark/selfstudy | baekjoon/cpp/string/BOJ_10809.cpp | //Baekjoon online judge
//10809
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s;
int alp[26];
fill_n(alp, 26, -1);
cin >> s;
for (int i = 0; i < s.size(); i++)
if (alp[s.at(i) - 97] == -1)
alp[s.at(i) - 97] = i;
for (int i = 0; i < 26; i++)
cout << alp[i] << " ";
retu... | ALGO | 0.999844 | 3.708868 |
fcd667c7-9e1e-4db7-9125-b96cfe89e287 | jeetsavsani1173/LeetCode-Solution | Maximum Bipartite Matching - GFG/maximum-bipartite-matching.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int maximumMatch(vector<vector<int>>&G){
int m = G.size();
int n = G[0].size();
int match[n];
memset(match, -1, sizeof(match));
int res = 0;
for (int i = 0; i... | ALGO | 0.999979 | 6.637504 |
8cfe75ea-0865-4573-a67f-b47fa14d2364 | greenbeanpie/OI-training | NOIP2023-ZJ/ZJ-0363/tribool/tribool.cpp | #include<bits/stdc++.h>
#define DEBUG puts("en en shui ye mei kan de qi ni");
using namespace std;
inline int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')w=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9')
{
s=(s<<3)+(s<<1)+(ch^48);
ch=getchar();
}
return s*w;
}
inline void pr... | ALGO | 0.999843 | 4.629738 |
226599bf-8d3d-4672-a5dc-8377a61eb5c8 | qbit-glitch/data_structures_and_algorithms | divide_and_conquer/binary_search/straight_binary_search.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
int straightBS(vector<int>& a, int low, int high, int x){
while(low <= high) {
int mid = (low + high)/2;
if (x < a[mid]) {
high = mid - 1 ;
}
else if(x > a[mid]) {
low = mid + 1;... | ALGO | 0.999849 | 5.588393 |
68866aeb-da1f-4252-9edf-2b0d7ce16103 | sahil-kumar-yadav/DSA | 15_Graphs/Hello World YT/cycle-detection-in-directed-using-dfs.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
void addEdge(vector<int> adjList[], int u, int v)
{
adjList[u].push_back(v);
}
void printGraph(vector<int> adjList[], int v)
{
for (int i = 0; i < v; i++)
{
cout << i << " -> ";
for (auto it : adjList[i])
... | ALGO | 0.999939 | 5.408485 |
63422a30-4fcd-41fe-bcf7-1d6b431613ca | SaikatDeb12/CP | A_Johnny_and_Ancient_Computer.cpp | // Author: Saikat_deb | Created: 2025-06-09 22:48
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
// C:\msys64\mingw64\include\c++\11.2.0\ext\pb_ds\detail\resize_policy
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
// l... | ALGO | 0.999554 | 4.803224 |
c95040da-ea5e-401d-ade9-b5af1ab0333b | RidwanSupon/Problem-Solving | practice problem/Lab-code-cpp/private get set.cpp | #include<iostream>
using namespace std;
class hello{
private:
int a,b;
public:
void setter(int x,int y){
a=x;
b=y;
}
int get(){
return a+b;
}
};int main(){
hello ob1,ob2;
int n,m;
int e,f;
cout<<"Input two number:";
cin>>n>>m;
cout<<"Input another two nu... | ALGO | 0.998711 | 3.522161 |
6ef90873-6934-49e3-9bce-4064bfb4e569 | debabrota1604/onlineJudgeProgs | leetCode/p1046_LastStoneWeight.cpp | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
class Solution {
public:
int lastStoneWeight(vector<int>& stones) {
int max1 = stones[0], max2 = stones[1];
if(sizeof(stones)>1){
for(auto i=stones.begin();i!=stones.end();i++){
if (*i > max1){
... | ALGO | 0.997349 | 4.835656 |
4919408f-43c6-4d2b-a69e-47eddc74c38f | remysys/llvm-riscv-backend | llvm-project/llvm/tools/llvm-xray/xray-stacks.cpp | #include <forward_list>
#include <numeric>
#include "func-id-helper.h"
#include "trie-node.h"
#include "xray-registry.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormatAdapters.h"
#include "llv... | TOOL | 0.985445 | 7.583074 |
390b3905-abb5-4075-a7b3-87508f71eca2 | Mi-Kram/HseAlgorithms | set7/d/main.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
struct Point {
int x;
int y;
};
bool dfs(size_t u, const std::vector<std::vector<int>>& graph, std::vector<bool>& visited, std::vector<int>& match);
int main() {
int n, m, a, b;
std::cin >> n >> m >> a >> b;
std::vector<std::stri... | ALGO | 0.999433 | 4.639 |
930b8cad-28b9-43bb-a6ff-e96aac3401ed | aolo2/Radiosity | Pathtracer/radiance.cpp | #include <glm/glm.hpp>
#include "radiance.h"
#include "constants.h"
#include "sampler.h"
glm::vec3 simple_rt(const point &here, const glm::vec3 &towards,
const utils::scene &scene, unsigned int depth) {
if (depth > constants::max_bounces) {
return glm::vec3(0.0f);
}
if (here.m... | ALGO | 0.996019 | 6.571955 |
d7a87ee9-f117-41ec-94ab-2cb01782af7f | ayeshowcode/OOP-Lab | lab-8/Task5.cpp | #include <iostream>
using namespace std;
class Box
{
protected:
float price;
int capacity;
public:
Box(float price, int capacity) : price(price), capacity(capacity) {}
int getCapacity()
{
return capacity;
}
float getCost()
{
return price;
}
};
class SmallBox : public... | TOOL | 0.96302 | 5.308325 |
ed34646f-a50a-4bc0-9505-382204180faa | 2018007956/Coding-Test-Study | week2/더맵게_KH.cpp | #include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int solution(vector<int> scoville, int K) {
priority_queue<int, vector<int>, greater<int> > pQ;
int answer = 0;
int first = 0;
int second = 0;
for(int i=0; i<scoville.size(); i++){
pQ.push(scovil... | ALGO | 0.99984 | 5.379721 |
e187df4d-08e4-4704-9732-d0f44ac758c3 | Yannnnnnna/Algorithm-training | 09Cupidity/LC605.cpp | //
// Created by WYR on 2025/4/8.
//
#include <bits/stdc++.h>
using namespace std;
bool canPlaceFlowers(vector<int>& flowerbed, int n) {
if(flowerbed.size()== 0 )return n== 0;
int len = flowerbed.size();
int cnt = 1; //0的个数 默认花坛左边有一个0
int ans = 0;
for (int i = 0; i < len; ++i) {
if(flowerbed... | ALGO | 0.999997 | 5.579325 |
992d9e64-6fee-4fdd-995a-2e3a9638a13d | sinian666/codes_41_14 | cpp_副本12/chapter_computational_complexity/worst_best_time_complexity.cpp | /**
* File: worst_best_time_complexity.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 生成一个数组,元素为 { 1, 2, ..., n },顺序被打乱 */
vector<int> randomNumbers(int n) {
vector<int> nums(n);
// 生成数组 nums = { 1, 2, 3, ..., n }
for (int i = 0; i < n; i++) {
n... | ALGO | 0.998029 | 5.246295 |
fec424b4-470c-4e30-b4fe-30fc9b75eff9 | PiperBetle/MyCode | 查找特定的值.cpp | #include<iostream>
using namespace std;
int a[10001];
int main()
{
int ans,n,find,i;
ans=-1;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
cin>>find;
for(i=1;i<=n;i++)
{
if(find==a[i])
{
ans=i;
break;
}
}
cout<<ans;
return 0;
}
| ALGO | 0.999907 | 4.066119 |
58a3993e-55c9-4462-adb6-2ccdc57050d2 | sfthkr/CppProjects | vector/vector_crtp.cpp | #include <algorithm>
#include <array>
#include <initializer_list>
#include <iostream>
template <typename Expression>
class Vector_Base
{
public:
auto operator[](std::size_t i) const;
};
template <typename Expression>
auto Vector_Base<Expression>::operator[](std::size_t i) const
{
return static_cast<Expression c... | ALGO | 0.983194 | 4.760077 |
6fe9f363-893b-4787-8b41-4a8da2d67116 | ishandutta2007/codeforces | eecs/normal/1119/G.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int n, m, sum, hp[maxn], rem[maxn];
int main() {
scanf("%d %d", &n, &m);
for (int i = 1; i <= m; i++) {
scanf("%d", &hp[i]);
rem[i] = (sum += hp[i]) % n;
}
rem[m] = n, sort(rem + 1, rem + m + 1);
printf("%d\n",... | ALGO | 0.999987 | 3.425101 |
6e1f7e84-3ceb-4a3b-ba6a-6ff77dcc2c93 | 1468362286/Algorithm | CodeForces/987E/14315493_AC_795ms_7840kB.cpp | #include <iostream>
#include <string>
using namespace std;
const int maxn = 1000010;
int n;
int a[maxn];
int c[maxn];
int lowbit(int x){return x&(-x);}
void update(int x)
{
while(x<=n)
{
c[x]++;
x+=lowbit(x);
}
}
int query(int t)
{
int sum=0;
while(t)
{
sum+=c[t];
t-=lowbit(t);
}
return sum;
}
int m... | ALGO | 0.999935 | 3.72489 |
48e9f463-bc8e-49f8-9355-3a4d16e40042 | harshch1803/Algorithms | Sorting Algorithms/Counting Inversions/CountingInversions.cpp | #include<iostream>
#include<fstream>
using namespace std;
unsigned long int n=100000;
void merge_countInv(int *a,int low,int mid,int high,unsigned long long int &count);
void mergeSort(int *a,int low,int high,unsigned long long int &count)
{
int mid = (low+high)/2;
if(low<high)
{
mergeSort(a,low,mid,count);
... | ALGO | 0.997545 | 3.485069 |
78454e04-fdbd-4f55-a283-fbcb073436ae | lattalab/slove-problem | Star 2/uva245.cpp | // accepted
# include <iostream>
# include <string>
# include <vector>
# include <algorithm>
using namespace std;
int main()
{
string s;
vector<string> v;
// 輸入有多行 -> 分好幾個getline
while(getline(cin,s) && s != "0")
{
s += "\n"; // 換行也納入,不然會錯
string temp = "";
int num=0;
... | ALGO | 0.999653 | 4.06067 |
396cef37-d3dd-4b3b-8c78-396730811c2c | ansungho22/algorithm-practice | [프로그래머스]체육복/소스.cpp | //ü
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int solution(int n, vector<int> lost, vector<int> reserve) {
int answer = 0;
vector<int> student;
for (int i = 0; i < n; i++)
{
student.push_back(1);
}
for (auto i : reserve) {
student[i - 1]++;
... | ALGO | 0.99981 | 4.388079 |
6932a8bc-a847-4d76-8943-309244e161f9 | CaedusSolo/CP | Easy/Implementation/TimeToDuel.cpp | // https://codeforces.com/problemset/problem/2109/A
#include <bits/stdc++.h>
using namespace std;
void solve()
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++)
cin >> a[i];
auto c0 = find(a.begin(), a.end(), 0);
auto c1 = find(a.begin(), a.end(), 1);
bool valid = ... | ALGO | 0.999597 | 4.906827 |
79c13b25-c6ff-4fed-8b71-ede992978c5b | RahulLodhi12/Unthinkable | Count_prime_range_sum_digits_prime.cpp | // Count all prime numbers in a given range whose sum of digits is also prime
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n){
if(n==1 || n==0){
return false;
}
for(int i=2;i<=n/2;i++){
if(n%i == 0){
return false;
}
}
return true;
}
int summ(int... | ALGO | 0.999908 | 5.703518 |
03e84f32-7301-4e1a-b3bf-9ea82d2b0822 | libai7/C-Homework | Chapter05/T5_08.cpp | /*
*FileName: T5_08.cpp
*Author: ʷ
*E-mail: <EMAIL>
*Date: Mar 13th,2022
*College: School of Computer Science and Information Engineering
*Function: һеС
*/
#include<iostream>
using namespace std;
int main()
{
const int INF = 0x7fffffff;//int
cout << "Ҫֵĸ " << endl;
int n,min=INF,num;
cin >> n;
... | ALGO | 0.99979 | 3.482836 |
3a23e61a-46f2-4373-9411-66370bad26f1 | shivam5643/Striver_SDE_Sheet_challenge_2023 | PartialBST.cpp | #include <bits/stdc++.h>
/*************************************************************
Following is the Binary Tree node structure
class BinaryTreeNode
{
public :
T data;
BinaryTreeNode<T> *left;
BinaryTreeNode<T> *right;
BinaryTreeNode(T data) {
this ... | ALGO | 0.999987 | 6.651056 |
348f8fbc-f537-4872-b1c8-52110776743a | sinian666/code_102_5 | cpp_副本56/chapter_sorting/quick_sort.cpp | /**
* File: quick_sort.cpp
* Created Time: 2022-11-25
* Author: Krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 快速排序类 */
class QuickSort {
private:
/* 元素交换 */
static void swap(vector<int> &nums, int i, int j) {
int tmp = nums[i];
nums[i] = nums[j];
nums[j] = tmp;
}
... | ALGO | 0.999966 | 5.600534 |
66f24425-e31a-4bd8-8f45-503e6d5d66c5 | SmileYik/AlgorithmProblem | uva/1606 - Amphiphilic Carbon Molecules.cpp | #include <iostream>
#include <vector>
#include <map>
using namespace std;
int sovle() {
map<int, map<int, int>> points;
int n, x, y, z;
cin >> n;
while (n--) {
if (!points.count(x)) {
points[x] = map<int, int>();
}
points[x][y] = z;
}
}
int main() {
return 0;
}
| ALGO | 0.93525 | 3.182698 |
1f6ac64b-4e7d-40cc-bda4-fff4a4c1fe69 | ishandutta2007/codeforces | peterr/normal/1337/B.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
{
int x, n, m;
cin >> x >> n >> m;
bool ans = false;
for (int i = 0; i <= n; i++)
{
if (x <= 10 * m)
... | ALGO | 0.999625 | 4.110732 |
9d617f30-2da3-4752-b55e-147f64273f4a | yangpyeong522/Algorithm_1year | a-88/a-88/a-88.cpp | #include <iostream>
#include <string>
using namespace std;
int messilen[10000];
long long mk;
void messi(int n,int m) {
if (m > 5 && m <= 13) {
if (m == 6) {
cout << "Messi Messi Gimossi";
}
else {
string a = "Messi Gimossi";
cout << a[m-1];
}
return;
}
else if (m <= 5) {
string a = "Messi";
... | ALGO | 0.999892 | 4.062867 |
d75ff2ea-8986-467f-9d5c-b78593e6795f | Amitkumar-007/face_recognition | opencv-master/modules/dnn/src/ocl4dnn/src/ocl4dnn_inner_product.cpp | #include "../../precomp.hpp"
#include "../include/common.hpp"
#include "../include/ocl4dnn.hpp"
#include "../include/math_functions.hpp"
namespace cv { namespace dnn { namespace ocl4dnn {
template<typename Dtype>
OCL4DNNInnerProduct<Dtype>::OCL4DNNInnerProduct(OCL4DNNInnerProductConfig config)
{
bias_term_ = conf... | ALGO | 0.975236 | 6.624504 |
95fc7083-ed8e-4a8b-9ada-980392a22be9 | alexandraback/datacollection | solutions_5639104758808576_1/C++/cleverzys/solution.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <set>
#include <map>
#include <list>
#include <limits>
#include <queue>
#include <stdexcept>
#include <iomanip>
#include <sstream>
using namesp... | ALGO | 0.999924 | 3.456515 |
697102d2-410b-486d-8c0a-01f35a165d73 | Prithvirajbilla/AlgorithmCoding | CatsOnTheLineDiv2.cpp | // BEGIN CUT HERE
// END CUT HERE
#line 5 "CatsOnTheLineDiv2.cpp"
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
class CatsOnTheLineDiv2
{
public:
string getAnswer(vector <int> position, vector <int> count, int time)
{
$CARETPOSITION$
... | ALGO | 0.999446 | 3.902844 |
b0381f32-7524-4644-9838-8a5310e6c16f | anagorko/zpk2014 | home/ekwiatowska/z8/main.cpp | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
#include <stdio.h>
#include<allegro5/allegro.h>
#include<allegro5/allegro_image.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
const int screen_w = 800;
const int screen_h = 600;
const float FPS = 60.0;
class Vect
{
... | ALGO | 0.98163 | 3.841868 |
6386ae71-86c9-4ef0-8bb4-9de224bffcc9 | zhangwj0101/codestudy | algorithm/HDU-ACM/HDU_ACM_C++/1017.cpp | ////////////////////System Comment////////////////////
////Welcome to Hangzhou Dianzi University Online Judge
////http://acm.hdu.edu.cn
//////////////////////////////////////////////////////
////Username: devil_momo
////Nickname: Lucifer
////Run ID:
////Submit time: 2008-06-17 16:26:48
////Compiler: Visual C++
///////... | ALGO | 0.999454 | 4.156754 |
7a82e88e-e242-4832-92dc-24afdaf2ff60 | Gnaroshi/practice-algorithm-solvedac | With_Levels/Gold/Gold_4/14502.cpp | // problem: 연구소
// id: 14502
// tag:
// time taken:
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int n, m, ans, safs;
... | ALGO | 0.999492 | 5.493651 |
2f67f5ff-adb2-4ca1-81fc-b4bf20b75f6e | Kaulwarmythri/DSA | 0334-increasing-triplet-subsequence/0334-increasing-triplet-subsequence.cpp | class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int n = nums.size(), first = nums[0], sec = INT_MAX;
for(int i=0; i<n; i++) {
if(nums[i] <= first)
first = nums[i];
else if(nums[i] <= sec)
sec = nums[i];
... | ALGO | 0.99996 | 5.980319 |
414cb424-37be-4cb9-b594-692e06f33cab | ValentinVPK/FMI | DataStructuresAndAlgorithms/Exams/7-Exam/2-Task/2-Task.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
struct Edge
{
int fromNode;
int toNode;
int weight;
Edge(int from, int to, int weight)
{
this->fromNode = from;
this->toNode = to;
this->weight = weight;
}
};
int main()
{
int nodes... | ALGO | 0.999982 | 4.643763 |
909f64b1-6d78-49ae-a177-c5e2134dacfa | AnuragPatel1/Codeforces-Problem | B_Make_AP.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long int
void solve() {
int a,b,c; cin >> a >> b >> c;
b = b * 2;
if(b == (a+c)){
cout << "YES" <<endl;
}
else if(b < (a+c)){
if((a+c)%b == 0) cout << "YES" << endl;
else cout << "NO" << endl;
}
... | ALGO | 0.99992 | 4.538029 |
ffa890bc-82bf-4c75-a48d-5007931eb2d0 | KUMARANKIT3012/Leetcode | Minimum Window Substring.cpp | class Solution {
public:
string minWindow(string s, string t) {
unordered_map<char, int> need, window;
for (char c : t) need[c]++;
int left = 0, right = 0;
int valid = 0;
int start = 0, minLen = INT_MAX;
while (right < s.size()) {
char c = s[right];
... | ALGO | 0.999993 | 6.802505 |
380d8532-c237-40ae-af7b-c5179ffb422b | omarmorle/codeforces | 975A.cpp | #include <bits/stdc++.h>
int n;
std::set<std::string> set;
char str[1007];
int main()
{
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf(" %s", str);
int len = int(strlen(str));
std::sort(str, str + len);
len = int(std::unique(str, str + len) - str);
str[len] = ... | ALGO | 0.999812 | 4.273967 |
af441824-4393-44b3-95a5-e140d9e825f8 | hanszap/computonube | SolucionSumaArreglosParalela_Hansel_Zapiain/SolucionSumaArreglosParalela_Hansel_Zapiain.cpp | // SolucionSumaArreglosParalela_Hansel_Zapiain.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <omp.h>
#define N 10000
#define chunk 5000
#define mostrar 50
void imprimeArreglo(float* d);
int main()
{
std::cout << "Sumando Arreglos en Parale... | ALGO | 0.999801 | 4.528009 |
256688f3-0d8a-4f23-bd84-9da37d5594a6 | KhaledHegazy222/Problem-Solving | UVA/10490/main.cpp | #include <bits/stdc++.h>
#define all(a) a.begin(),a.end()
#define fast cin.tie(0),ios::sync_with_stdio(0),cout.tie(0)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
vector<ll> factorize(ll n){
vector<ll>ret = {1};
for(ll i = 2;i * i <= n;i++){
if(n % i == 0){
... | ALGO | 0.997082 | 4.517607 |
11067cba-4561-4da2-9868-f967398b9606 | gimme02/gem5-src | src/systemc/tests/systemc/misc/v1.0/dash2/pulse.cpp | /*****************************************************************************
pulse.cpp -- Implementation of the pulse generator.
Original Author: Ali Dasdan, Synopsys, Inc.
*****************************************************************************/
/*****************************************************... | TOOL | 0.960696 | 6.370359 |
2188cbbd-cba3-4397-ae3e-668de78980f6 | skyisgreen/Data-structure-exercise | 3.4 贪吃蛇 001.cpp | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#define High 20 // Ϸߴ
#define Width 40
// ȫֱ
int moveDirection; // Сƶλãҷֱ1234ʾ
int food_x,food_y; // ʳλ
int book[High][Width] = {0}; // ά洢ϷжӦԪ
// 0Ϊո0-1Ϊ߿#-2ΪʳF1Ϊͷ@1Ϊ*
void gotoxy(int x,int y) //ƶ(x,y)λ
{
HANDLE handle = GetStdHan... | TOOL | 0.997684 | 3.335237 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.