uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
864526c5-28a0-4b79-9544-9b58c09ad733 | M-Awwab-Khan/Competitive-Programming | B_Random_Teams.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
#define f first
#define s second
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vect... | ALGO | 0.999972 | 4.64729 |
24dfdc81-a4ce-4412-92dd-1b4e91156449 | dipterix/RBCI2000 | inst/include/BCI2000Interface/shared/utils/Expression/ExpressionParser.cpp | /* A Bison parser, made by GNU Bison 3.7.5. */
/* C LALR(1) parser skeleton written by Richard Stallman, by
simplifying the original so-called "semantic" parser. */
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
especially those whose name start with YY_ or yy_. They are
private impleme... | TOOL | 0.898258 | 5.583537 |
3c9c06d8-cbc0-4255-b719-2d59bd6e3fe9 | tushar-kamra/Data-Structures-and-Algorithms | cpp/dynamic programming/minPalindromicCutMemo.cpp | // #include<iostream>
// #include<vector>
// #include<climits>
// using namespace std ;
// bool isPalin(string s, int si, int ei){
// int left = si ;
// int right = ei ;
// while(left < right){
// if(s[left] != s[right]){
// return false ;
// }
// left++;
// rig... | ALGO | 0.999896 | 5.672853 |
4fe20512-153e-410e-8fe0-5e9d22d4e41b | maxzhuma/mutab | src/count_mutab.cpp | #include <Rcpp.h>
using namespace Rcpp;
// Function to create a summary table for a data frame
// [[Rcpp::export]]
DataFrame create_mr_count_table(DataFrame df, int countValue) {
// Get the number of rows and columns in the data frame
int nRows = df.nrow();
int nCols = df.length();
// Create a vector to sto... | TOOL | 0.992738 | 7.282662 |
f559a753-b68a-4638-a82e-95e429087e01 | craftzbay/e-olymp | 7000-7999/7834 - Two biggest - Два наибольших - Два найбільших.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, a[101];
cin >> n;
for (int i = 0; i < n; ++i) cin >> a[i];
sort(a, a + n);
cout << a[n - 1] + a[n - 2];
return 0;
}
| ALGO | 0.999656 | 3.824169 |
2bad2ffa-c957-4666-8559-a0433bd153ca | sajin-ss/OS_Lab | FINAL ITEMS/2.cpp | #include <iostream>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
using namespace std;
int isPrime(int n)
{
if (n==1)
return 0;
for (int i = 2; i <= n/2; ++i)
{
if (n%i==0)
return 0;
}
return 1;
}
int main(int argc, char const *argv[])
{
int pipefd[2];
if (pipe(pipefd) == -1)
{
... | ALGO | 0.999709 | 3.900054 |
68f99ac3-5949-4926-a2f7-56a8d8f71dca | YamaguchiKoki/rasen | section8/binary_tree/example.cpp | include<bits/stdc++.h>
using namespace std;
#define MAX 10000
#define NIL -1
/**
* 二分木:子の次数が2で一定である木構造
*/
struct Node { int parent, left, right };
Node T[MAX];
int n, D[MAX], H[MAX];
void setDepth(int u, int d) {
if (u == NIL) return;
D[u] = d;
setDepth(T[u].left, d + 1);
setDepth(T[u].right, d + 1... | ALGO | 0.999866 | 3.910337 |
f165c2e0-a569-4adf-947c-58ef4f62ffc1 | pronad1/Problem_Solving_Part1 | godsend.cpp | //Author : PROSENJIT MONDOL
#include<bits/stdc++.h>
#define lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower);
#define upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper);
using namespace std;
const int inf = 3e5;
using ll=unsigned long long ;
ll mod = 10e9 + 7;
//-------------------------------... | ALGO | 0.999893 | 4.000677 |
9143e0d6-9680-4112-8627-45d65ae7790f | chocolatemelt/misc | RPI/LLVM-Compiler-Case-Study/lib/Support/Process.cpp | #include "llvm/ADT/StringExtras.h"
#include "llvm/Config/config.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
using namespace llvm;
using namespace sys;
//===-------------------------------------------------------------------... | TOOL | 0.958611 | 7.497957 |
c633dd20-448f-4d97-997b-35943cff634e | dsiroky/conan-boost | boost_1_65_1/libs/context/example/fibonacci.cpp | #include <cstdlib>
#include <iostream>
#include <memory>
#include <boost/context/continuation.hpp>
namespace ctx = boost::context;
int main() {
int a;
ctx::continuation c=ctx::callcc(
[&a](ctx::continuation && c){
a=0;
int b=1;
for(;;){
c=c.resume()... | TOOL | 0.918889 | 4.814583 |
507559ed-c479-430b-bc36-51a1bc299d7f | Gokulraj-123/CSA0356-Data-Structures | s2_17_merge_sort.cpp | #include <stdio.h>
void merge(int arr[], int left, int middle, int right) {
int n1 = middle - left + 1;
int n2 = right - middle;
int L[n1], R[n2];
for (int i = 0; i < n1; i++)
L[i] = arr[left + i];
for (int j = 0; j < n2; j++)
R[j] = arr[middle + 1 + j];
int i = 0, j = 0, k ... | ALGO | 0.999965 | 4.841798 |
a5088c11-e131-4664-a00e-f2ccb0132183 | alekyoanda/pbp-flutter-lab | counter_7/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.998675 | 6.785645 |
59ef0418-2604-446f-ac80-88feb35cddbe | mohammedowez/Ds-and-algo | Intervals/57. Insert Interval.cpp | Example 1:
Input: intervals = [[1,3],[6,9]], newInterval = [2,5]
Output: [[1,5],[6,9]]
Example 2:
Input: intervals = [[1,2],[3,5],[6,7],[8,10],[12,16]], newInterval = [4,8]
Output: [[1,2],[3,10],[12,16]]
Explanation: Because the new interval [4,8] overlaps with [3,5],[6,7],[8,10].
class Solution
{
public:
vecto... | ALGO | 0.999972 | 6.000628 |
ec1fd3bc-7d8f-4350-b0d9-7a897ba6bc9a | ishandutta2007/codeforces | fengzhengwei/normal/1586/C.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
char gc(){static char buf[1<<16],*s,*t;if(s==t){t=(s=buf)+fread(buf,1,1<<16,stdin);if(s==t)return EOF;}return *s++;}
//#define getchar gc
int read()
{
char c;
int w=1;
while((c=getchar())>'9'||c<'0')if(c=='-')w=-1;
int ans=c-'0';
while((c=getchar())... | ALGO | 0.99988 | 3.799792 |
a0723126-13f8-4e3c-b9a2-1b70efb53e49 | our-bright-future/junkpark-algorithm | cpp/boj/1065.cpp | #include <iostream>
#include <string.h>
int solution(int n);
int main() {
using namespace std;
cin.tie(NULL);
cin.sync_with_stdio(false);
int x;
cin >> x;
cout << solution(x) << '\n';
return 0;
}
int solution(int n){
if (n < 100){
return n;
} else {
int cnt = 0;
... | ALGO | 0.99881 | 3.936628 |
7ac6997d-97c0-4c3f-a5eb-d64eb6d201d7 | RedwanPlague/cses_problems | Graph-Algorithms/Labyrinth.cpp | // https://cses.fi/problemset/task/1193/
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> pii;
int n, m;
vector<string> grid, par;
#define DR 4
int dx[DR] = {+1, -1, 0, 0}... | ALGO | 0.999993 | 4.568342 |
8119d420-7768-4f63-8621-d42c2e443992 | linneszyx/CP-Problems | Medium/Job Sequencing Problem/job-sequencing-problem.cpp | //{ Driver Code Starts
// Program to find the maximum profit job sequence from a given array
// of jobs with deadlines and profits
#include<bits/stdc++.h>
using namespace std;
// A structure to represent a job
struct Job
{
int id; // Job Id
int dead; // Deadline of job
int profit; // Profit if job... | ALGO | 0.999908 | 5.907334 |
3bac7c7a-5d9a-4b63-8148-76718dd3d406 | yudongyeop/programming | 백준/DFS와 BFS/벽 부수고 이동하기.cpp | #include <iostream>
#include <queue>
#include <tuple>
#include <utility>
#include <string>
using namespace std;
int map[1000][1000];
int visit[1000][1000][2];
int dx[] = {0,1,0,-1};
int dy[] = {1,0,-1,0};
typedef tuple<int,int,int> t;
int N,M;
int bfs(void) {
queue<t> q;
q.push(make_tuple(0,0,true));
visit[0][0... | ALGO | 0.999976 | 4.413894 |
a4c2a624-e255-47c2-a1bb-fd058d5fee88 | satse13/LeetCode | algoritmia/63.cpp | #include<iostream>
#include<vector>
using namespace std;
class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int n = obstacleGrid.size();
int m = obstacleGrid[0].size();
if (obstacleGrid[n - 1][m - 1] == 1)
return 0;
vector<vecto... | ALGO | 0.999755 | 5.896087 |
740b65a9-6834-4601-9569-0123276b8a91 | rohan492/dsa | Greedy/Jump Game.cpp | class Solution {
public:
bool canJump(vector<int>& nums) {
int n = nums.size();
int goal = n - 1;
for (int i = n - 2; i >= 0; i--) {
if (i + nums[i] >= goal) {
goal = i;
}
}
return goal == 0;
}
}; | ALGO | 0.999982 | 6.351713 |
9d1bc9cc-b34d-4106-8087-8c3029c9ff66 | sunnylpu/sunny-code | c++ programming/class practice/area_of_circle.cpp | #include <iostream>
#include <cmath>
using namespace std;
class Circle {
private:
double radius;
public:
Circle(double r) {
radius = r;
}
double calculateArea() {
return M_PI * radius * radius;
}
void displayArea() {
cout << "The area of the circle is: " << calculateA... | TOOL | 0.990382 | 5.024777 |
a39f9015-9fa2-4766-94de-7565e8082648 | Sachinrodies/Tle-eliminators-sheets | B_Difference_of_GCDs.cpp | #include <iostream>
#include <vector>
#include <cmath>
#include <stack>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <unordered_map>
#include <numeric>
#include <climits>
#include <map>
#include <unordered_set>
using namespace std;
#define ll long long
void solve()
{... | ALGO | 0.999936 | 3.220902 |
6862cc7c-4c81-4c7d-a079-a74ad80ece02 | hk19960522/Code | UVa/UVa 855.cpp | #include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while ( t -- )
{
int n,m,p;
cin >> n >> m >> p;
int X[50000] = {0},Y[50000] = {0};
for (int i=0;i<p;i++)
cin >> X[i] >> Y[i];
nth_element... | ALGO | 0.999662 | 3.56068 |
06e87701-2230-4355-b766-4905940aa6ea | Agneeshz/DSA | CP/CODEFORCES/1A.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
long long int n,m,a,x,y;
cin>>n>>m>>a;
if(n%a==0)
x=n/a;
else
x=(n/a+1);
if(m%a==0)
y=m/a;
else
y=(m/a+... | ALGO | 0.999873 | 3.283588 |
2865546a-7f79-4490-a4ad-8f47e23f5774 | tienit150198/ACM | Contest/Contest01/E/main.cpp | #include "bits/stdc++.h"
#define ll long long int
#define MOD 1000000007
#define MN 100005
using namespace std;
ll n;
ll a[MN];
ll S;
int main(){
//freopen("01.in", "r", stdin);
//freopen("01.ans", "w", stdout);
cin >> n;
cin >> S;
for (int i = 0; i < n; i++){
cin >> a[i];
}
ll res = 0;
ll sum = 0;
int j ... | ALGO | 0.999787 | 3.224505 |
caa6b32f-31d9-4e97-b39b-b80e53758d12 | ishandutta2007/codeforces | hloya_ygrt/normal/1662/L.cpp | #include <bits/stdc++.h>
using namespace std;
inline void md(vector<int>& f, int x, int y) {
for (; x < f.size(); x = (x | (x + 1))) {
f[x] = max(y, f[x]);
}
}
inline int mx(const vector<int>& f, int x) {
int mx = -228'228;
for (; x >= 0; x = (x & (x + 1)) - 1) {
mx = max(mx, f[x]);
}
return mx;
... | ALGO | 0.999986 | 4.594095 |
f858cd2f-8db9-4339-ba8d-f1b2d6e72ad0 | chizzyjpg/Aprendiendo_a_Programar | EDA/segundoParcial2021.cpp | #include <iostream>
using namespace std;
struct nodoAB
{
int info;
nodoAB *izq, *der;
};
typedef nodoAB *AB;
AB crearArbol(int, AB, AB);
void imprimir(AB);
AB cortarArbol(AB &, int);
int maxAlturaPerfecto(AB);
int main()
{
AB Arbol = new nodoAB;
Arbol = crearArbol(11, crearArbol(5, NULL, NULL), crea... | ALGO | 0.999673 | 4.502872 |
e37f6eda-6c22-4cd0-85cd-3693fe9d1a2f | originalrin/C-- | Tic Tac Toe/sigma.cpp | //from this point on projects files will use sigma bc im too lazy to make new ones :p
#include <iostream>
#include <vector>
#include "sigma.h"
using namespace std;
//originalrin was here :P
int main(){
int s1 = 0, s2 = 0;
bool game_over = false;
char curr_player = 'X';
greet();
while (!game_o... | ALGO | 0.999062 | 4.855289 |
2dd33cde-31af-46ac-8eb6-56d7e7bdbe4f | tynnp/CP-Practice | UPCODER/LTCB-84.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
double a, b;
cin >> a >> b;
if (a == 0) {
if (b == 0) cout << 1;
else cout << 0;
} else {
if (b == 0) cout << 0;
else cout << -b / a;
}
return 0;
} | ALGO | 0.998096 | 4.079744 |
556900bb-9859-40be-94d6-16da3e68a9cb | LauraKoraeva/CPP | module_2_lesson_3/5_Bubble_wrap.cpp | /*Массивы и Указатели в C++
Урок 3. Двумерные массивы и алгоритмы над ними*/
//Задание 5. Пупырка
#include <iostream>
#include <limits>
#include <numeric>
bool correctInput(int input)
{
if (std::cin.fail() || std::cin.peek() != '\n' || input < 0 || input > 11)
{
std::cerr << "Incorrect input.\n";
... | ALGO | 0.937449 | 3.812519 |
256a96a0-ab0e-4cf4-8041-e143c095e546 | fearlessfollowing/titan | src/eigen-3.3.1/test/sparse_permutations.cpp | static long int nb_transposed_copies;
#define EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN {nb_transposed_copies++;}
#define VERIFY_TRANSPOSITION_COUNT(XPR,N) {\
nb_transposed_copies = 0; \
XPR; \
if(nb_transposed_copies!=N) std::cerr << "nb_transposed_copies == " << nb_transposed_copies << "\n"; \
VERIFY( (#XPR... | TEST | 0.904576 | 6.254961 |
54cba7e8-30fa-4db3-bbf2-8c097931e193 | JinRIIS/Custom-QGC | libs/eigen/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.973107 | 5.772194 |
84ee7dd5-d2ad-42ea-8e83-71d5c9463f80 | PAnand007/Learn-C_plus_plus | DSA/Recursion/factorial.cpp | #include<iostream>
using namespace std;
int factorial(int n){
if(n==0) return 1;
return n*factorial(n-1);
}
int main(){
cout<<"Enter factorial"<<endl;
int n;
cin>>n;
cout<<factorial(n);
return 0;
} | ALGO | 0.999591 | 3.341194 |
9e236546-715e-4412-a888-9987ad63d1fd | ishandutta2007/codeforces | maksim1744/normal/1137/A.cpp | /*
08.03.2019 12:07:06
*/
#include <bits/stdc++.h>
using namespace std;
#ifdef HOME
#define TAG_LENGTH 45
#define LR_LEFT left
#define LR_RIGHT right
#define LR_VALUE value
#define LR_SECOND_VALUE mn
#include "C:/C++ libs/print.cpp"
#define showl cout << endl;
#define shows cout << string(5, ' ') + string(TAG_LE... | ALGO | 0.999996 | 3.770832 |
ad147c02-f3d7-49ae-ad31-df98b3ff38c8 | sonhl0723/algorithm | BOJ/10819.cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
vector<int> v;
cin >> N;
while(N--){
int a;
cin >> a;
v.push_back(a);
}
sort(v.begin(), v.end());
int sum = 0;
... | ALGO | 0.99985 | 4.226307 |
7c8c637b-3907-4c58-a315-6015501802d0 | andraantariksa/competitive-programming-answer | urionlinejudge/2057.cpp | /*input
24 48 3
*/
#include <iostream>
int a, b, c, tot;
int main(int argc, char const *argv[]){
std::cin>>a>>b>>c;
tot = a+b+c;
while(tot >= 24){
tot-=24;
}
while(tot < 0){
tot+=24;
}
std::cout<<tot<<std::endl;
return 0;
} | ALGO | 0.999736 | 3.706755 |
0668011b-8d46-4f98-a4fa-4c0d62f09184 | jochongs/codetree-TILs | 240223/알파벳에 따른 평가/evaluation-by-alphabet.cpp | #include <iostream>
using namespace std;
int main() {
// 여기에 코드를 작성해주세요.
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
char uppercaseAlphabet;
cin >> uppercaseAlphabet;
if(uppercaseAlphabet == 'S') {
cout << "Superior";
return 0;
}
if(upperca... | ALGO | 0.883107 | 3.706674 |
971b1fb9-e68d-45f3-93d8-74f07eb1709d | onyx6838/algorithm | Cau Truc Du Lieu & Giai Thuat/Internet/From Best/SingleListSV-Hai CNTT/appsv.cpp | //#include<iostream>
//#include"singleList.cpp"
//#include"Node.cpp"
//#include"student.cpp"
//#include"singleListItr.cpp"
#include<iostream>
#include"SLIST.cpp"
#include"conio.h"
#include"Node.cpp"
#include"student.cpp"
#include"SLItr.cpp"
using namespace std;
class studentApp
{
private:
SingleList<sinhvien> sv;
... | TOOL | 0.989937 | 3.106922 |
76f0d7d1-4339-4be7-b2a0-fdea084db372 | Mindjolt2406/Competitive-Programming | Codeforces/GYM/2020-2021_ICPC_NERC_Southern_And_Volga_Regional_Contest/D.cpp | #include<bits/stdc++.h>
// g++ -std=c++17 -Wl,-stack_size -Wl,0x10000000 main.cpp
#define mt make_tuple
#define mp make_pair
#define pu push_back
#define INF 1000000001
#define MOD 1000000007
#define EPS 1e-6
#define ll long long int
#define ld long double
#define fi first
#define se second
#define all(v) v.begin(),v.e... | ALGO | 0.999712 | 4.104797 |
d844d2a2-c773-46b2-9f6a-bf030974c5e2 | RedBlueBird/competitive-programming | Codeforces/Division-3/710/B-PartialReplacement.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> tiii;
#define ff first
#define ss second
const ll mod = 1e9+7;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
// freopen("../input.txt", "r", stdin);
// freopen("../output.txt", "... | ALGO | 0.99952 | 3.805869 |
1bcd4425-b7b0-4b8a-91cc-97715634d4d1 | hank891008/LeetCode | 0671-second-minimum-node-in-a-binary-tree/0671-second-minimum-node-in-a-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.999991 | 5.918417 |
27fd808a-05c2-4d03-adeb-548c26b43876 | corner-case123/KaliLinux | sublime/soln.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
using LL = long long;
void setIO(const string io = "a") {
freopen("a.in", "r", stdin) ;
freopen("a.out", "w", stdout) ;
}
void pre()
{
fastio ;
}
void customSwap(int& a, int& b)
{
if (&a==&b) retur... | ALGO | 0.999835 | 4.466724 |
b034c760-a11d-4bb5-95fc-4a8724181ab1 | ishandutta2007/codeforces | zdolny_kaczor/normal/98/A.cpp | #include<bits/stdc++.h>
using namespace std;
#define PII pair<int,int>
#define f first
#define s second
#define VI vector<int>
#define LL long long
#define MP make_pair
#define LD long double
#define PB push_back
#define PLL pair <LL, LL>
#define ALL(V) V.begin(),V.end()
#define abs(x) max((x),-(x))
#define PDD pair<LD... | ALGO | 0.999884 | 3.448534 |
c87d8b5a-2753-41af-8014-a6927e227d5f | VivekHero/SE-SEM_4-DSAL | 21182_DSAL_Assignment_12.cpp | #include <iostream>
#include <fstream>
#include <iomanip>
#define size 10
using namespace std;
class Student{
int roll;
string name;
string address;
public:
Student(){
roll = 0;
name = "";
address = "";
}
void setdata(int r, string n, string a){
roll = r;
name = n;
address = a;
}
int getRoll(){... | TOOL | 0.889492 | 3.902572 |
e1e67c1d-b1ca-44a1-bb31-034f69a4370d | KeepCodeing/AlgorithmRecords | AcWing/算法基础/最短路及拓扑排序/Dijkstra数组邻接表.cpp | #include <iostream>
#include <queue>
using namespace std;
// ֮ǰдvectorе㲻һûýṹˣ
// priority_queueʽҲȨֵȣо
// ѭ˸ӣ峤BFS
const int N = 100010, INF = 0x3FFFFFFF;
// ¼˸wȨ
int head[N], e[N], ex[N], w[N], idx = 0;
void add(int k, int val, int wei) {
e[idx] = val, w[idx] = wei, ex[idx] = head[k], head[k] = idx++;
}
// һpair涥Ȩֵ... | ALGO | 0.999975 | 4.682908 |
bcff5a3e-80f0-445d-8953-9c35cc441625 | vedantagnihotri9/Strivers_SDE_Sheet_Challenge | Linked List 2/31. Intersection of Two Linked Lists.cpp | Node* findIntersection(Node *firstHead, Node *secondHead)
{
//Write your code here
int cnt1=1, cnt2=1;
Node *temp1=firstHead, *temp2=secondHead;
while(temp1!=NULL || temp2!=NULL)
{
if(temp1!=NULL)
{
temp1=temp1->next;
cnt1++;
}
if(... | ALGO | 0.999946 | 4.384386 |
15daf827-d744-4d0a-b7db-87298aacccfb | AndiA76/SDCND05_Motion_Planning_and_Decision_Making | project/starter_files/eigen-3.3.7/lapack/lu.cpp | #include "common.h"
#include <Eigen/LU>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(getrf,(int *m, int *n, RealScalar *pa, int *lda, int *ipiv, int *info))
{
*info = 0;
if(*m<0) *info = -1;
else if(*n<0) ... | ALGO | 0.999376 | 5.798193 |
8619088d-6d10-43d2-9720-605813d72ece | akashiitj/dsaprogram | sample.cpp | #include<bits/stdc++.h>
using namespace std;
struct node
{
node *left;
node *right;
int val;
};
node *nn(int x1)//return new node
{
node *n=new node;
n->left=NULL;
n->right=NULL;
n->val=x1;
return n;
}
node* bst_to_list(node* root)
{
if (root == NULL)
return root;
if ... | ALGO | 0.999968 | 4.459677 |
7cac364f-0fd1-494b-9b67-9a4a51206ecc | Rexpeng1209/2023aaia3 | week15/week15-5.cpp | class Solution {
public:
ListNode* myReverse(ListNode* l1) {
vector<int>a;
while(l1 != nullptr){
a.push_back( l1->val);
l1 = l1->next;
}
ListNode* ans = new ListNode();
ListNode* now = ans;
int N = a.size();
for(int i=N-1;i>=0;i--){
... | ALGO | 0.999948 | 5.806477 |
47096d69-b452-4399-b27e-4cdc0338cc7e | tejaram15/submitted-solutions | Untitled1.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string str("ab"),st("bc");
int t,n,cnt1=0,cnt2=0;
vector<int> v1,v2;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
str=str+st;
//cout<<str;
cnt1=0;
cnt2=0;
for(int i=0;i<str.length();i++)
{
v1.push_back(i+1);
for(int j=0;j<str.length();j... | ALGO | 0.999879 | 3.119423 |
3de21af3-136f-4159-95fc-ea0c446d6b30 | zilongshanren/CutTheRope-x | CutTheRopeDemo/libs/Box2D/Rope/b2Rope.cpp | #include <Box2D/Rope/b2Rope.h>
#include <Box2D/Common/b2Draw.h>
b2Rope::b2Rope()
{
m_count = 0;
m_ps = NULL;
m_p0s = NULL;
m_vs = NULL;
m_ims = NULL;
m_Ls = NULL;
m_as = NULL;
m_gravity.SetZero();
m_k2 = 1.0f;
m_k3 = 0.1f;
}
b2Rope::~b2Rope()
{
b2Free(m_ps);
b2Free(m_p0... | ALGO | 0.997403 | 6.401562 |
29c6ddc3-18c1-4866-bf0c-3a110d415935 | sth6197/Datastructure | Class1th (Single Linked List)/Source.cpp | #include <iostream>
using namespace std;
template <typename T>
class SingleLinkedList
{
private:
int size;
struct Node
{
T data;
Node* next;
};
Node* head;
public:
SingleLinkedList()
{
size = 0;
head = nullptr;
}
void PushFront(T data)
{
... | ALGO | 0.992262 | 5.61547 |
6356fc5b-13d6-4808-93d9-4af10487edcf | KalshuCodes/Previous-Codes-and-Solves-Competitive | A1_Consistency_Chapter_1.cpp | #include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define priority_queue < ll, std::vector<ll>, std::greater<ll> > mnheap; // mnheap.push(), mnheap.top(), mnheap.pop()
#define REP(i,a,b) for (auto i = a; i != b; i++)
#define ll long... | ALGO | 0.999831 | 4.62427 |
e9e4f89b-35e4-4d2c-8008-ec7fc0c4b9d5 | BoleynSu/CompetitiveProgramming | archives/problemset/acm.timus.ru/1049.cpp | /*
PROGRAM: $PROGRAM
AUTHOR: Su Jiao
DATE: 2010-3-26
DESCRIPTION:
$DESCRIPTION
*/
#include <iostream>
using std::cin;
using std::cout;
#include <fstream>
using std::ifstream;
using std::ofstream;
#include <sstream>
using std::stringstream;
using std::endl;
#include <vector>
using std::vector;
#include <string>
using st... | ALGO | 0.999888 | 4.166001 |
54d3c68c-e50e-4253-a2bb-3ba1bba905f0 | BenjaminNguyen437/TaskManagement | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
acf3f2b9-b45d-4d64-a691-5dbe06c176ae | YashSuthar983/CodeForces | 1791.C_PrependAndAppend.cpp | #include<bits/stdc++.h>
#include<chrono>
#define ll long long
using namespace std;
using namespace std::chrono;
int solve (int len)
{
int s=0;
int e=len-1;
string str;
cin>>str;
if(s==e)
{
return 1;
}
while(s<e)
{
if... | ALGO | 0.999794 | 4.278996 |
50cbaef9-0888-4817-93e9-9ee7e9c60e33 | pmnyc/Data_Engineering_Collections | Programming_Projects/R Projects/gbm/src/laplace.cpp | #include "laplace.h"
CLaplace::CLaplace()
{
mpLocM = NULL;
}
CLaplace::~CLaplace()
{
if(mpLocM != NULL)
{
delete mpLocM;
}
}
GBMRESULT CLaplace::ComputeWorkingResponse
(
double *adY,
double *adMisc,
double *adOffset,
double *adF,
double *adZ,
double *adWeight,
bool *af... | ALGO | 0.999941 | 6.070915 |
a8a2e325-a7ea-4907-96de-eecc4bc14f91 | ishandutta2007/codeforces | yfzcsc/normal/1037/F.cpp | #include<bits/stdc++.h>
#define mod 1000000007
#define maxn 1001000
using namespace std;
typedef pair<int,int> pii;
int dp[maxn],n,K,ans,sum0;
pii a[maxn];
set<int>st;
int cal(int len){
return dp[len];
}
void ins(int x){
auto it=st.insert(x).first;
int l=it==st.begin()?0:*prev(it);
int r=next(it)==st.end()?n+1:*nex... | ALGO | 0.999946 | 3.998528 |
b833f455-3dc5-4d99-bbc2-c98a71e34264 | PranavKumar5258/c- | bit_manipulation/set_kth_bit.cpp | /**
* @file
* @brief Implementation to [From the right, set the Kth bit in the binary
* representation of N]
* (https://practice.geeksforgeeks.org/problems/set-kth-bit3724/1/) in an
* integer.
*
* @details
* Given a number N and a value K. From the right, set the Kth bit in the binary
* representation of N. Th... | ALGO | 0.999474 | 6.643258 |
9be6e44f-6246-4fd6-ab5e-a940f83ff99b | akshays1ngh/DAA-LAB-PROGRAMS | Week 12/subset_sum(backtracking).cpp | #include <iostream>
using namespace std;
void subset(int idx,int arr[],int t,int ans[],int &k,int n,int s){
if(idx==n){
if(s==t){
for(int i=0;i<k;i++)
cout<<ans[i]<<" ";
cout<<endl;
}
return;
}
s+=arr[idx];
ans[k++]=arr[idx];
subse... | ALGO | 0.999944 | 3.923131 |
80ffc6f6-cb33-4ebe-808e-6eacd69a5faf | uwplse/rake | benchmarks/hexagon/halide/mean/src/mean_generator.cpp | #include "Halide.h"
#include "../../hannk/common_halide.h"
using namespace Halide;
using namespace Halide::ConciseCasts;
namespace hannk {
class Mean : public Generator<Mean> {
public:
Input<Buffer<uint8_t>> input_{"input", 4};
// The bounds of the region to reduce. This pipeline is
// implemented as a ... | ALGO | 0.998836 | 6.634671 |
c5afb328-b8de-4ddf-bfe2-ba18a565861e | plkristina/Contest | 1/task11.cpp | # include <iostream>
using namespace std;
int main(){
int a, b, c;
cin >> a >> b >> c;
if (abs(a - b) > abs(a - c)) {
cout << "C " << abs(a - c);
}
else {
cout << "B " << abs(a - b);
}
return 0;
}
| ALGO | 0.999866 | 4.307442 |
db2ea81b-2c4d-4ea8-a566-c4562844f6ca | wenqf11/LeetCode | C++/59. Spiral Matrix II/main.cpp | #include <iostream>
#include "solution.h"
int main()
{
Solution s;
vector<vector<int>> num = { };
s.generateMatrix(3);
system("pause");
return 0;
} | ALGO | 0.992759 | 4.051458 |
35ac6367-1a2f-46ce-aecd-8f6d4bebeb48 | 1838641320/newbee_code_store | 20.9/codeforces 2C Commentator problem 模拟退火.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define mem(a,b) memset(a,b,sizeof a)
using ll=long long;
using namespace std;
const int maxn=1e5+9;
const double eps=1e-6;
mt19937 rd(time(0));
struct point{
double x,y,r;
}p[3];
double cal(double x,double y){
double d[3]={},res=0;
rep(i,0,3) d[i]=hypo... | ALGO | 0.999833 | 3.380825 |
492d8635-8bc7-480c-9f6b-71bfb42f7b20 | Huey-ZhangHaiyu/-offer | code/acwing42栈的压入弹出.cpp | /*
输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序。
假设压入栈的所有数字均不相等。
例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。
注意:若两个序列长度不等则视为并不是一个栈的压入、弹出序列。若两个序列都为空,则视为是一个栈的压入、弹出序列。
*/
//用一个栈去模拟就好了
//因为操作比较唯一
//当前压入与预计的输出相同,则当前元素必定要pop,如果不同则只能把下一个元素压进来
class Solution {
public:
bool isPopOrder(vector... | ALGO | 0.999526 | 5.827138 |
10c90685-79d3-47f9-9f66-83daa60ff632 | mangwonKing/Algorithm-Solve | 프로그래머스/0/120868. 삼각형의 완성조건 (2)/삼각형의 완성조건 (2).cpp | #include <bits/stdc++.h>
using namespace std;
int solution(vector<int> sides) {
int answer = 0;
int mx = max(sides[0],sides[1]);
int mn = min(sides[0],sides[1]);
for(int i = 1; i <= mx; i++)
{
if(mx < i + mn)answer++;
}
int sum = sides[0] + sides[1];
for(int i = mx+1; i < sum; ... | ALGO | 0.999033 | 4.377423 |
666e7e63-d127-416d-a7e2-2ff4f8a39962 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_7881_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
vector<int> g[N];
int vis[N], dfn[N], low[N], gcnt, ln, fa[N], p[N];
stack<int> s;
void tarjan(int x) {
dfn[x] = low[x] = ++gcnt;
vis[x] = 1;
s.push(x);
for (int i = 0; i < g[x].size(); i++) {
int to = g[x][i];
... | ALGO | 0.999947 | 4.535593 |
888a6f8d-2670-4279-a081-38b1ea94233b | peng-yq/the-way-to-find-a-job | leetcode/c++/129_sum_root_to_leaf_numbers.cpp | // https://leetcode.cn/problems/sum-root-to-leaf-numbers
#include <bits/stdc++.h>
using namespace std;
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, Tr... | ALGO | 0.999987 | 6.358769 |
6e435746-c48d-4f90-b4f9-62218ef48993 | iliyian/codeforces.com | 1917/B.cpp | #include <bits/stdc++.h>
#define int long long
using namespace std;
void solve() {
int n;
cin >> n;
set<char> s;
int ans = 0;
for (int i = 0; i < n; i++) {
char c;
cin >> c;
s.insert(c);
ans += s.size();
}
cout << ans << '\n';
}
signed main() {
ios::sync_with_stdio(false); cin.tie(0);
... | ALGO | 0.999876 | 4.697983 |
16dac6fb-2eda-442d-8584-5f9118d06392 | VC6378/Leetcode | 1020-number-of-enclaves/1020-number-of-enclaves.cpp | class Solution {
public:
int numEnclaves(vector<vector<int>>& grid) {
int m=grid.size();
int n=grid[0].size();
queue<pair<int,int>> q;
vector<vector<int>> vis(m,vector<int>(n,0));
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
if(i==0 or j==0 or i==m-... | ALGO | 0.999974 | 6.285275 |
a2677d86-8a37-45ee-be02-3d21bd247f39 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_4554_1.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const int oo = 1e9;
int n;
int a[105];
int sum;
int ans;
int main() {
cin >> n;
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
sum += a[i];
}
sort(a, a + n);
if ((double)sum / (double)n >= 4.5) return cout << 0, 0;
for (int i =... | ALGO | 0.999966 | 3.645176 |
2ce9768b-c9d9-4128-bc63-81ec3485bd59 | shivratangupta/GeeksForGeeks-Practice-Solutions | Binary_Array_Sorting.cpp | /*
Given a binary array A[] of size N. The task is to arrange array in increasing order.
Note: The binary array contains only 0 and 1.
Input:
The first line of input contains an integer T, denoting the testcases. Every test case contains two lines, first line is N(size of array) and second line is space separated el... | ALGO | 0.999875 | 6.021981 |
acbd0002-75a0-4265-b9ad-81b2bacd3e14 | Mostafa-Moin26/DSA | Array/Medium/Spiral Matrix.cpp | // Problem lin ----->
https://leetcode.com/problems/spiral-matrix/description/
// Solution
class Solution {
public:
vector<int> spiralOrder(vector<vector<int>>& matrix) {
int n = matrix.size();
int m = matrix[0].size();
int left = 0, right = m - 1;
int top = 0, bottom = n - 1;
... | ALGO | 0.999996 | 6.678544 |
4bbcea31-e564-41e1-af3d-90fbb1a543c5 | Tama4649/18gou | old_engines/engines/2016-mid-engine/2016-mid-search.cpp | #include "../../shogi.h"
#ifdef YANEURAOU_2016_MID_ENGINE
// -----------------------
// やねうら王2016(mid)設定部
// -----------------------
// 開発方針
// やねうら王classic-tceからの改造。
// 探索のためのハイパーパラメーターの完全自動調整。
// パラメーターを自動調整するのか
// 自動調整が終われば、ファイルを固定してincludeしたほうが良い。
//#define USE_AUTO_TUNE_PARAMETERS
// 読み込むパラメーターファイル名
// これがd... | ALGO | 0.998596 | 5.487296 |
688cc282-aa31-4d59-90a8-b793d0d5a175 | neharika2004/DSA_ | Stacks/usingArr.cpp | #include<iostream>
using namespace std;
class Stack{
public:
int top;
int*arr;
int size;
Stack(int size){
this->size=size;
arr=new int(size);
top=-1;
}
void push(int element){
if(size-top > 1){
top++ ;
arr[top]=element;
}
else{
... | ALGO | 0.988379 | 4.517313 |
daff681d-c4e0-48b5-a9a9-d340a1ea6a74 | morsalin80/algo_DS | miscellanous/DP(novice)/lcs/uva_10066.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
int n1,n2;
int dp[110][110];
ll arr1[110];
ll arr2[110];
void lcs()
{
for(int i=1;i<=n1;i++)
{
for(int j=1;j<=n2;j++)
{
if(arr1[i]==arr2[j])
{
dp[i][j] = dp[i-1][j-1]+1;
}
... | ALGO | 0.999914 | 4.356435 |
49451e94-cea7-4df8-b1b7-46f46eec343c | felipesdias/Extractor-URI-Online-Judge | URI-EN/BEGINNER/1178 - Array Fill III.cpp | // Author: Felipe Souza Dias <<EMAIL>>
// Name: Array Fill III
// Level: 1
// Category: BEGINNER
// URL: https://www.urionlinejudge.com.br/judge/en/problems/view/1178
#include <bits/stdc++.h>
using namespace std;
int main() {
double n;
cin >> n;
for(int i=0; i<100; i++) {
printf("N[%d] = %.4lf\n", i, n);... | ALGO | 0.9994 | 3.695433 |
86befcd8-6d15-41ab-bb5a-d778e2ff0db7 | HeapStackTree/leetcode | src/medium/146_LRU_Cache.cpp | #include <unordered_map>
#include <iostream>
using namespace std;
struct DLinkedNode {
int key, value;
DLinkedNode *prev;
DLinkedNode *next;
DLinkedNode(): key(0), value(0), prev(nullptr), next(nullptr) {}
DLinkedNode(int _key, int _value): key(_key), value(_value), prev(nullptr), next(nullptr) {}... | ALGO | 0.997659 | 6.701765 |
99246cc7-f9a7-4be5-a664-78fa8e5eaf4b | kapishgupta99/DSA | 1480-running-sum-of-1d-array/1480-running-sum-of-1d-array.cpp | class Solution {
public:
vector<int> runningSum(vector<int>& nums) {
vector<int>runsum(nums.size());
runsum[0]=nums[0];
for(int i=1;i<nums.size();i++){
runsum[i]= runsum[i-1]+nums[i];
}
return runsum;
}
}; | ALGO | 0.999785 | 6.109918 |
6465117a-d380-4c4b-a3e2-c5c5d93d1298 | NikitaInozemtsev/AOD | n01-practice13.cpp |
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
bool orientalgraph = 1; // ориентированный граф или нет
int elems = 1;
struct Bond;
struct Node {
string name;
Bond* ways;
int bondcount;
};
struct Bond {
int way;
Node* child;
};
void SetBond(string parentname, Node... | ALGO | 0.988911 | 3.957887 |
a9b36ea4-9cf6-446d-be06-aea0b5b3cbad | halogenOS/android_packages_apps_OTAUpdates | jni/boost_1_57_0/libs/icl/example/partys_height_average_/partys_height_average.cpp | /** Example partys_height_average.cpp \file partys_height_average.cpp
\brief Using <i>aggregate on overlap</i> a history of height averages of
party guests is computed.
In partys_height_average.cpp we compute yet another aggregation:
The average height of guests as it changes over time. This is... | ALGO | 0.951215 | 6.947585 |
1acdcb6b-211c-432a-90a4-8f24e93b20cf | nmp9981/coding_daily_2023 | 20230314_13549.cpp | #include <iostream>
#include <queue>
using namespace std;
int n,k;
const int maxi = 200001;
bool visit[maxi];
//입력
void input() {
cin >> n>>k;
}
//숨바꼭질
void HideAndSeek() {
queue<pair<int, int>> q;
q.push({ n,0 });
visit[n] = true;
while (!q.empty()) {
int x = q.front().first;
int cnt = q.front().second;
... | ALGO | 0.999936 | 4.34892 |
a2ad06a9-db6a-400e-99d0-0c64f8e458a7 | aelmaar/cpp-module-09 | ex02/PmergeMe.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* PmergeMe.cpp :+: :+: :+: ... | ALGO | 0.999805 | 5.29735 |
ef9a8c26-0a3b-40a2-bd4b-0b2603d2c23d | PXOSP-ROM/android_frameworks_av | media/codecs/amrwb/dec/src/isf_extrapolation.cpp | /*
------------------------------------------------------------------------------
Filename: isf_extrapolation.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
-------------------------------------------------------------------... | ALGO | 0.999583 | 5.451385 |
a67f7d8e-6c42-4057-9642-acb0b022f0d0 | JerryNYang/cfx | cProgramBok/6.17.cpp | //6.17
// using nested loops to calculate a Fibonacci Series
#include <iostream>
using namespace std;
int main()
{
const int numsToCalculate = 5;
cout << "This program will calculate " << numsToCalculate
<< " Fibonacci Numbers at a time" << endl;
int num1 = 0, num2 = 1;
char wantMore = '\0';
cout << num... | ALGO | 0.999541 | 3.821668 |
c24bb4ec-3cbc-4c5a-9fb7-01736489e595 | codeAntu/LeetCode-problems | cpp/reverse-nodes-in-k-group.cpp | #include <utility>
#include "math.h"
using namespace std;
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:
pair<ListNode *, ListNode *> reverse(Li... | ALGO | 0.999988 | 5.670377 |
52a8cc9d-94f3-4e06-b87a-848552dd56a4 | Eunkyung99/algorithm | src/Programmers/Hash/hash3.cpp | #include <string>
#include <vector>
#include <iostream>
#include <unordered_map>
using namespace std;
int solution(vector<vector<string>> clothes) {
int answer = 1;
unordered_map <string, int> um;
for(int i=0; i<clothes.size(); i++){
string types = clothes[i][1];
um[types]+=1;
}
... | ALGO | 0.981607 | 5.20956 |
5f2023e0-1056-4f48-b4a0-66200d26f111 | wuxinrantj/Coding | LeetCode/114.二叉树展开为链表/test.cpp | #include "../binarytree.h"
#include <iostream>
#include <algorithm>
using namespace std;
//递归
class Solution {
public:
void flatten(TreeNode* root) {
if (root == nullptr) return;
flatten(root->left);
flatten(root->right);
if (root->left != nullptr) {
auto pre = root->lef... | ALGO | 0.999889 | 5.395095 |
e70cb07d-5a47-4fdc-a7f8-f469124b1399 | 19cmogush/Search-Engine | search_engine/search2/txt_parser.cpp | #include <iostream>
#include <fstream>
#include <stdexcept>
#include <cctype>
#include "txt_parser.h"
#include "util.h"
void TXTParser::parse(std::string filename, std::set<std::string>& allSearchableTerms, std::set<std::string>& allOutgoingLinks)
{
// Attempts to open the file.
std::ifstream wfile(filename.c_... | TOOL | 0.861746 | 4.551023 |
7d380c56-c10b-4fe7-8fd8-6b762ce727b0 | Eeman1113/Leetcode | Problems/52.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
// dp[i] := the maximum sum subarray ending in i
vector<int> dp(nums.size());
dp[0] = nums[0];
for (int i = 1; i < nums.size(); ++i)
dp[i] = max(nums[i], dp[i - 1] + nums[i]);
return ranges::max(dp);
}
}; | ALGO | 0.999173 | 6.683877 |
07bb8a3b-f968-4c03-ae5a-cc942d4105e1 | AakashKT/analytic_ss_cpu | src/integrators/directlighting.cpp | // integrators/directlighting.cpp*
#include "integrators/directlighting.h"
#include "interaction.h"
#include "paramset.h"
#include "camera.h"
#include "film.h"
#include "stats.h"
namespace pbrt {
// DirectLightingIntegrator Method Definitions
void DirectLightingIntegrator::Preprocess(const Scene &scene,
... | ALGO | 0.97159 | 6.591317 |
775988c1-13dc-4f6e-8d4d-95210ba2519d | carlosqp-UGR/Sistemas-Concurrentes-y-Distribuidos-21-22 | Practica4/ejecutivo1-compr.cpp | // -----------------------------------------------------------------------------
//
// Sistemas concurrentes y Distribuidos.
// Práctica 4. Implementación de sistemas de tiempo real.
//
// Archivo: ejecutivo1.cpp
// Implementación del primer ejemplo de ejecutivo cíclico:
//
// Datos de las tareas:
// ------------
/... | TOOL | 0.997362 | 4.568264 |
a5702e58-ed7b-4adc-bd32-2487e2b976e4 | AmaanShaikh04/Programming | C/Radix_sort.cpp | #include <stdio.h>
int getMax(int arr[],int n)
{
int max=arr[0];
int i;
for (i=1;i<n;i++)
if(arr[i]>max)
max=arr[i];
return max;
}
void countSort(int arr[],int n,int exp)
{
int op[n];
int i,c[10]={0};
for (i=0;i<n;i++)
c[(arr[i]/exp)%10]++;
for (i=1;i<10;i++)
... | ALGO | 0.999905 | 4.699059 |
70978f50-8f4a-4493-8f8e-375f1c0eb319 | TonuruRikkon/Tin-VL | ReNhanh/TAMGIAC.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if(a+b+c != 180) cout<<"0"<<endl;
else
{
if(a==b&&b==c) cout<<"DEU"<<endl;
else {
if(a==b||b==c||a==c) cout<<"CAN";
if(a==90||b==90||c==90) cout<<"VUONG"<<endl;
}... | ALGO | 0.998317 | 4.536215 |
ed6fc1ba-cd7f-463d-ba20-757a4b9d169e | MelkorOJ/wssd_cech | wssd/WssdStats.cpp | #include "WssdStats.h"
template<typename T, int D, int K>
void WssdStats<T,D,K>::PrintStats(const KWSSD(T,D,K)& wspd) const
{
double maxAlpha = 1.5*double(1<<20);
int steps = 1000;
PrintAlphaStats(wspd, steps, maxAlpha);
}
template<typename T, int D, int K>
void WssdStats<T,D,K>::PrintAlphaStats(const KW... | ALGO | 0.927437 | 5.586794 |
1f5bb352-cfd0-42ba-bf8d-b1ef9ede3e8f | saga-gis/saga-gis | saga-gis/src/tools/terrain_analysis/ta_preprocessor/Pit_Router.cpp | //---------------------------------------------------------
#include "Pit_Router.h"
///////////////////////////////////////////////////////////
// //
// //
// //
///////////////////////////////////////////////////////////
//----------------------------------------------------... | ALGO | 0.955772 | 3.471041 |
bce4dd79-29f6-4a20-9a65-1523a994d0b5 | wrench786/LightOj-Accepted-Solutions | 1113 - Discover the Web.cpp | #include <bits/stdc++.h>
#define wrench786 ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define PI (acos(-1.0))
using namespace std;
int main(){
// wrench786
#ifndef ONLINE_JUDGE
clock_t tStart = clock();
freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
... | ALGO | 0.990766 | 3.652655 |
08563cf0-489a-4d9d-9b2d-eda9495d0bbb | swilene/42_piscineCPP | cpp09/ex01/main.cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: ... | ALGO | 0.947426 | 4.808066 |
0e95a975-a5d8-41a6-a261-0445f2290bcd | hjiang13/LLMs-in-IR | POJ-104/90/2151.cpp | #include <iostream>
using namespace std;
int f(int m,int n)
{
if(n<=0)
return 0;
if(n==1)
return 1;
if(m<n)
return f(m,n-1);
return f(m,n-1)+f(m-n,n);
}
int main()
{
int m[20],n[20],t,i,k[20];
cin >> "%d",&t);
for(i=0; i<t; i++)
{
cin >> "%d%d",&m[i],&n[i]);
k[i]=f(m[i],n[i]);
}
for(i=0; i<t; i++)
cout << "%d\n",k[i]);... | ALGO | 0.999979 | 3.671226 |
99905208-9207-4bdc-a6bd-fbe1a85dbaf3 | navid-hasan26/Problem-Solving | HackerRank/HR-A Very Big Sum.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long n, sum(0);
cin >> n;
unsigned long long arr[n];
for (size_t i = 0; i < n; i++)
{
cin >> arr[i];
sum += arr[i];
}
cout << sum << endl;
return 0;
} | ALGO | 0.998557 | 3.908112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.