uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
4b5783b2-f466-4931-8d31-936a422bcd73 | atomickashyap/Problem-Set-DSA | 0100-same-tree/0100-same-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.999981 | 6.276365 |
fdd00aeb-62c7-4f20-8c12-6292a1a25472 | Shalini-Tigga/Leetcode-solutions | 3024-Type-of-Triangle.cpp | class Solution {
public:
string triangleType(vector<int>& nums) {
ranges::sort(nums);
if (nums[0] + nums[1] <= nums[2])
return "none";
if (nums[0] == nums[1] && nums[1] == nums[2])
return "equilateral";
if (nums[0] == nums[1] || nums[1] == nums[2])
return "isosceles";
return "sc... | ALGO | 0.999824 | 5.986511 |
b33a13ac-86ce-466b-a730-ed1ede978d80 | jasonhmx/Jason-leetcode | 543.diameter-of-binary-tree.cpp | /*
* @lc app=leetcode id=543 lang=cpp
*
* [543] Diameter of Binary Tree
*/
// @lc code=start
/**
* 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), le... | ALGO | 0.999919 | 6.714827 |
ffeb45dc-bc69-4cfc-868f-ade6e1e522a4 | StoneCAU/Coding_Test | 프로그래머스/1/12906. 같은 숫자는 싫어/같은 숫자는 싫어.cpp | #include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
vector<int> solution(vector<int> arr)
{
vector<int> answer(arr);
answer.erase(unique(answer.begin(), answer.end()), answer.end());
return answer;
} | ALGO | 0.999173 | 4.999321 |
509a860a-6040-4745-bd1f-749e464d5caf | Bevij/ICA-1 | helpers.cpp | #include "header.h"
#include "helpers.h"
// entire file consists of smaller helper functions, in order to make inputs more consistent
/******************************************************************************************************
* AGILE SPECIFIC FUNCTIONS
************************************************... | TOOL | 0.914313 | 3.965505 |
75cd8060-6b44-4b47-938e-36a988c722f9 | HaeChan-Jeon/baekjoon | solution/step_by_step_solving/9_divisors_multiples_and_primes/1978/main.cpp | #include <iostream>
#include <cmath>
int main() {
int a;
std::cin >> a;
int b, c, count = 0;
for (int i = 0; i < a; i++)
{
std::cin >> b;
if (b == 1)
{
continue;
}
c = 1;
for (int j = 2; j <= std::sqrt(b); j++)
{
... | ALGO | 0.999891 | 4.634987 |
2abf4bc2-381d-4297-b707-ec34dbba4a2d | Yash5588/leetcode | 3809-properties-graph/properties-graph.cpp | class DisjointSet{
public:
vector<int> parent, size;
DisjointSet(int n) {
parent.resize(n,0);
size.resize(n,1);
for(int i = 0;i < n;i++) parent[i] = i;
}
int findUPar(int node) {
if(parent[node] == node) return node;
return parent[node] = findUPar(parent[node]);
... | ALGO | 0.999985 | 5.87076 |
e380444a-1b22-48b0-a2f1-c2708eda71ae | shailjaaaa/NEWCPP | practice13.cpp | #include<iostream>
using namespace std;
int main()
{
int i,j;
int dia=0,up=0,low=0;
int arr[3][3];
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
cout<<"Element of "<<i<<" and "<<j<<":";
cin>>arr[i][j];
}
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j+... | ALGO | 0.99942 | 3.904161 |
7fbd16fd-9a3a-4e39-83fa-b3ee941dbdc8 | yunsangq/algo | algo/방번호.cpp | #include <stdio.h>
int main() {
int map[11] = { 0 }, m_max = 0;
char s[1000005] = { 0 };
fgets(s, 1000000, stdin);
for (int i = 0; i < 1000000; i++) {
if (s[i] == '\n')
break;
if (s[i] - '0' == 6 && map[6] > map[9])
map[9]++;
else if (s[i] - '0' == 9 && map[9] > map[6])
map[6]++;
else
map[s[i... | ALGO | 0.99883 | 3.386046 |
25baba85-7116-4711-b645-ef51c60c97ab | daneshvar-amrollahi/SGU | 116.cpp | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,begin,end) for (int i=begin;i<=end;++i)
#define pb push_back
typedef long long ll;
bool ispr(int n)
{
if (n==1)
return 0;
if (n==2)
return 1;
if (n%2==0)
return 0;
for (int i = 3 ; i * i <= n ; i+=2)
if (n%i==0... | ALGO | 0.999974 | 3.618464 |
dfaafab7-17a1-4419-a608-9e6a7fade31d | sweetie-bot-project/sweetie_bot_rt_control | motion/sweetie_bot_kinematics/src/kinematics_inv_trac_ik-component.cpp | #include "kinematics_inv_trac_ik-component.hpp"
#include <cmath>
#include <algorithm>
#include <rtt/Component.hpp>
#include <kdl/chainiksolvervel_pinv.hpp>
#include <kdl/chainiksolvervel_wdls.hpp>
#include <sweetie_bot_orocos_misc/message_checks.hpp>
#include <sweetie_bot_orocos_misc/joint_state_check.hpp>
using s... | TOOL | 0.97764 | 5.776229 |
4ced705f-b163-4048-ae23-c4c95419b993 | pch6828/PS_Algorithm | LeetCode/ALGORITHM/smallest_string_with_a_given_numeric_value.cpp | class Solution
{
private:
bool canMakeString(int n, int k)
{
return n * 26 > k;
}
public:
string getSmallestString(int n, int k)
{
string ans;
while (canMakeString(n - 1, k - 1))
{
ans.push_back('a');
n--;
k--;
}
if... | ALGO | 0.999934 | 5.325227 |
a1a6bb58-645c-47e7-8dff-9f9f5014b995 | minhchauU23/leetcode | cpp0314.cpp | #include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
int n;
cin >> n;
cin.ignore();
map<string,int> mp;
string s;
for(int i = 0; i < n; i++){
getline(cin, s);
mp[s]++;
}
cout << mp.size();
return 0;
}
| ALGO | 0.981716 | 3.646259 |
66f0216e-5ea9-49c2-851e-7805da59e634 | JANN4TUL-FERDOUS/Codeforces-Solutions | jannatul.cse7.bu/contest/1879A.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
const int N=2e5+7;
ll mod=1e9+7;
ll ax[8]={0,0,-1,+1,-1,-1,1,1};
ll ay[8]={-1,1,0,0,-1,1,-1,1};
ll kx[8]={2,2,-2,-2,1,1,-1,-1};
ll ky[8]={1,-1,1,-1,2,-2,2,-2};
const ll len=180;
vector<ll>v[N];
... | ALGO | 0.999694 | 3.307757 |
faf7a122-fa62-400d-a1db-45e0c24921de | itoatoi/baekjoon | baekjoon/baekjoon/9996.cpp | /*
선영이는 이번 학기에 오스트레일리아로 교환 학생을 가게 되었다.
호주에 도착하고 처음 며칠은 한국 생각을 잊으면서 즐겁게 지냈다. 몇 주가 지나니 한국이 그리워지기 시작했다.
선영이는 한국에 두고온 서버에 접속해서 디렉토리 안에 들어있는 파일 이름을 보면서 그리움을 잊기로 했다.
매일 밤, 파일 이름을 보면서 파일 하나하나에 얽힌 사연을 기억하면서 한국을 생각하고 있었다.
어느 날이었다. 한국에 있는 서버가 망가졌고, 그 결과 특정 패턴과 일치하는 파일 이름을 적절히 출력하지 못하는 버그가 생겼다.
패턴은 알파벳 소문자 여러 개와 별표(*) 하... | ALGO | 0.999807 | 5.570674 |
c62f16ba-32dd-4a91-9ffa-714de98b769a | javagovindsharma/leetscode | lcof/面试题06. 从尾到头打印链表/Solution2.cpp | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
vector<int> reversePrint(ListNode* head) {
if (!head) {
return {};
}
vector<int> ans = reversePr... | ALGO | 0.998703 | 5.511551 |
5eea10b6-2042-4e07-8c1e-94fd1a0617b8 | khhitish/Leetcode-GFG | Search Pattern (Z-algorithm) - GFG/search-pattern-zalgorithm.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
#define ll long long
class Solution
{
private:
vector<ll> z_func(string& s)
{
ll n = s.size();
vector<ll> z(n);
for(ll i=0,l=0,r=0;i<n;i++)
{
if... | ALGO | 0.999292 | 5.539609 |
17e22a1c-b251-49b9-93de-8534fc2f1308 | yangbinbin123/Assembly-Language | Quiz-Assembly language/0540137_q1/q1/Irvine/examples/ch12/VisualCPP/FindArray/findArr.cpp | // findArr.cpp
// Implements a linear search of an array of
// long integers.
#include "findarr.h"
bool FindArray( long searchVal, long array[], long count )
{
for(int i = 0; i < count; i++)
array[i] *= searchVal;
return false;
}
| ALGO | 0.997549 | 3.659251 |
efd86782-a8c8-4881-9f8e-098c21735b32 | afsulthon/competitive-programming | eolymp/8987_Character_replacement.cpp | #include <cstdio>
#include <cstring>
using namespace std;
int main()
{
char str[1005];
fgets(str, 1005, stdin);
for (int i = 0; i < strlen(str); i++)
if (str[i] == 'a')
printf("b");
else if (str[i] == 'b')
printf("a");
else
printf("%c", str[i]);
... | ALGO | 0.999833 | 3.255971 |
a1bfad6e-6341-4157-a984-5c667376d5f9 | ishandutta2007/codeforces | igori/normal/1490/A.cpp | const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef complex<double> c... | ALGO | 0.999915 | 3.764768 |
6ea31c43-3f69-44f5-87b6-23e5eb2e6dab | kuldeep-97/DSA_CPP | 01_C++/L08 Hard Pattern/Hp.cpp | #include <iostream>
using namespace std;
int main()
{
int n = 5;
for (int i = 1; i <= n; i++)
{
// Print space
for (int s = 1; s <= n - i; s++)
{
cout << " ";
}
// than star
for (int j = 1; j <= i; j++)
{
cout << "*";
... | ALGO | 0.999831 | 4.319304 |
b175d151-39ef-44b8-b241-1290bbc93c91 | dinhtai1104/ctdl_gt_D18 | Contest1/Solve/1.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define get(n) ll n; cin>>n
#define set_arr(a,n); ll a[n]; for(int i=0;i<n;i++)cin>>a[i];
#define set_vect(a,n); vector<ll>a(n); for(int i=0;i<n;i++)cin>>a[i];
#define sort_arr(a,n) sort(a,a+n)
#define sort_vect(a) sort(a.begin(),a.end())
#define btSpee... | ALGO | 0.99982 | 5.424321 |
f13cecc2-6119-4629-aa99-3d9c88a9a7b9 | DIYElectronicsZA/DIYE-Prusa-i3 | Firmware/Premium/Marlin/vector_3.cpp | #include <math.h>
#include "Marlin.h"
#ifdef ENABLE_AUTO_BED_LEVELING
#include "vector_3.h"
vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, vector_3 right)
{
return vector_3(left.y * right.z - left.z * ri... | TOOL | 0.856382 | 5.630929 |
99045f4d-c8fe-4a83-aca9-ebcf7d1e69fd | tthheusalmeida/URI_Online_Judge | C++/2137.cpp | #include <bits/stdc++.h>
using namespace std;
int main () {
int num;
while (cin >> num) {
vector<int> v;
int insert;
for (int i = 0; i < num; i++) {
cin >> insert;
v.push_back(insert);
}
sort(v.begin(), v.end());
for (int i = 0; i < num; i... | ALGO | 0.999318 | 4.74577 |
45d6eae7-5f83-4900-9c97-1bc5d6b6a8b5 | ishandutta2007/codeforces | shmilyty/normal/1521/D.cpp | #pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read()
{
bool flag=1;
int x=0;
char c=getchar();
while(c<'0'||c>'9')
{
if(c=='-')
flag=0;
c=getchar();
}
while(c>='0'&&c<='9')
{
x=(x<<1)+(x<<3)+c-'0';
c=getchar();
}
return (flag?x:~(x-1));... | ALGO | 0.999863 | 3.977273 |
c34e6173-5cd2-446a-be0b-dfcd2b85c27d | priojeetpriyom/competitive-programming | codeforces/432 B. Football Kit adhoc.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
// freopen("myOutput.txt","w",stdout);
//freopen("myInput.txt",")
int n;
int HOME[100001],AWAY[200001],home,away,awayOrder[200001];
scanf("%d",&n);
for(int i=0; i<100001; i++)
{
HOME[i]=0;
}
for(int i=0; i<n; i++)
... | ALGO | 0.999634 | 3.594192 |
b12dc32e-1076-49ed-94c8-37ad07497712 | fengjiachen/leetcode | 050_099/53_Maximum_Subarray/main.cpp | #include <iostream>
#include <vector>
using namespace std;
int maxSubArray(vector<int>& nums) {
int len = (int) nums.size();
int s = nums[0],m = nums[0];
for(int i=1;i<len;i++){
if(s<0 && nums[i]>s){
s = nums[i];
}else if(s>=0){
s = s+nums[i];
}
if(s>m... | ALGO | 0.999979 | 4.877978 |
eb554979-5e78-4056-9c3a-032463682321 | brandomagnani/SoftHamiltonian_old | HASsoftware/HAS.cpp | /*
Squishy sampler project, the RATTLE Accelerated Sampler approach.
See main.cpp for more information.
*/
#include <iostream>
#include <blaze/Math.h> // numerical linear algebra and matrix/vector classes
#include <random> // for the random number generators
#include <cmath> // define... | ALGO | 0.999825 | 3.778116 |
8574dbd7-a40f-4f01-9e1a-21360e584db0 | alexandraback/datacollection | solutions_5636311922769920_1/C++/stetsyk/main.cpp | #include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
ll bin_pow(ll a, int n){
ll res = 1;
while(n){
if(n & 1) res *= a;
n >>= 1;
a *= a;
}
return res;
}
int ma... | ALGO | 0.999764 | 3.845644 |
791206dc-e7bf-4580-91b7-d5bce437c730 | S488U/college | BCA/SEMESTER_2/OOPS Lab/Part B/PB_3.cpp | /*Write a program to accept two strings and using operator overloading perform the
following.
a. Concatenation of two strings.
b. Comparison of two strings alphabetically.
*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
class string {
char str[20];
public:
void getdata() {
... | ALGO | 0.998846 | 4.695088 |
13acd863-245a-4f75-9100-ac701d4dc825 | Sirireddykatta/Emotion-based-music-player | opencv/sources/samples/cpp/calibration.cpp | #include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <cctype>
#include <stdio.h>
#include <string.h>
#include <time.h>
using namespace cv;
using namespace std;
const char * usage =
" \nexample command line for c... | TOOL | 0.871553 | 5.806235 |
7a5fb8fe-8a77-4d81-9df0-d1023def240e | Jaygaur99/DS-Algo-Practice | Coding Minutes/Graph/Solutions/45-Make Largest Island.cpp | #include<bits/stdc++.h>
using namespace std;
int cnt,n,dx[4]={1,-1,0,0},dy[4]={0,0,1,-1};
vector<pair<int,int>>vec;
void dfs(int x,int y,vector<vector<int>>&grid, vector<vector<int>>&visit)
{
if(x<0 || y<0 || x>=n || y>=n || grid[x][y]==0 || visit[x][y]==1)
{
return;
}
cnt++;
visit[x][y]=1;... | ALGO | 0.999848 | 5.129508 |
6db12847-536b-447b-9503-5149df9ab3b5 | harshagl2002/OpenMP | tests/student_benchmarks.cpp |
#include "naivelinalg.h"
#include "basic.h"
#include "multiply.h"
#include "transpose.h"
#include "openmp.h"
#include <random>
#include <chrono>
#include <ctime>
#include <thread>
#include <benchmark/benchmark.h>
static void STUDENT_Example_benchmark(benchmark::State& state) {
int N = state.range(0);
int til... | TOOL | 0.979477 | 3.935534 |
22e2e3c4-8995-4b48-90e6-596e46951b3a | angelramos1/Fractals | src/Fractal3D.cpp | #include "Fractal3d.h"
Fractal3D::Fractal3D(ofEasyCam* cam) : cam(cam){
}
Fractal3D::~Fractal3D() {
mesh.clear();
}
vec3 Fractal3D::centerOf(vector<vec3>& points) {
vec3 result;
for (vec3 v : points) {
result += v;
}
result /= points.size();
return result;
}
void Fractal3D::draw... | TOOL | 0.907125 | 5.692663 |
806faacb-fde9-4b63-a581-703609207179 | prateeksharma21/Competitive-Programming | Contest/Codeforces/Codeforces Round #730 (Div. 2)/A.cpp | #ifdef Prateek
#include "Prateek.h"
#else
#include <bits/stdc++.h>
using namespace std;
#define debug(...) 42
#endif
#define int ll
#define all(c) begin(c),end(c)
using ll = long long;
const int MOD = 1e9+7, N = 1e5 + 10;
void test(){
int a, b;
cin >> a >> b;
cout << abs(a - b) << ' ';
if (a == b) ... | ALGO | 0.999838 | 4.743464 |
4570f61b-8aa1-4b09-81e8-9beb39b20322 | thangitus/LeetCode-Solution | C++/Two Pointers/Two Sum II - Input array is sorted.cpp | #include <bits/stdc++.h>
using namespace std;
/**
* https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
*/
class Solution {
public:
vector<int> twoSum(vector<int> &nums, int target) {
int left = 0, right = nums.size() - 1;
while (left < right) {
int sum = nums[left] + nu... | ALGO | 0.999975 | 6.475075 |
fc028680-be71-4964-8d2f-bfdeb502d934 | efrencortes315/projectEuler | p1.cpp | #include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
int main(){
int sum=0;
for(int i=1; i<1000; i++){
if(i%3==0 || i%5==0){
sum = sum + i;
}
}
cout << sum << endl;
return 0;
}
| ALGO | 0.999761 | 3.96236 |
b2442f1f-5940-470b-8e3e-330023a5d456 | NailN-rgb/FEM1D | assembling/details/fe_method.cpp | #include "../fe_method.h"
FEM::FEM(Equation eq, UniformMesh mesh, int elem_order, int quad)
{
this->eq = eq;
this->mesh = mesh;
this->elements_order = elem_order;
this->quad = quad;
this->solution = new float[mesh.n];
int dof = 2 * elements_order;
K_local.resize(dof, std::vector<float>(do... | ALGO | 0.991665 | 4.051051 |
cbd617da-f20f-4324-93f4-8027f6f1248b | ishandutta2007/codeforces | monyura/normal/551/C.cpp | #include <iostream>
#include <iomanip>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <bitset>
#include <memory>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <string>
#include <cstring>
#include <fstream>
#include <functional>
#include <stack>
#include ... | ALGO | 0.999988 | 3.515296 |
89b7f317-dc8a-4352-932e-75e22d9dfd64 | ishandutta2007/codeforces | tutis/normal/1174/C.cpp | /*input
100
*/
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<int>divs[n + 2];
for (int i = 2; i <= n; i++)
{
for (int j = 2 * i; j <= n; j += i)
divs[j].push_back(i);
}
int a[n + 2];
fil... | ALGO | 0.99976 | 3.452465 |
090ac444-21c6-4da7-ad4a-859ac1d51da4 | Yores24/Daily-DSA | 1052-grumpy-bookstore-owner/1052-grumpy-bookstore-owner.cpp | class Solution {
public:
int maxSatisfied(vector<int>& customers, vector<int>& grumpy, int minutes) {
int n=grumpy.size();
int ans=0;
for(int i=0;i<n;i++){
if(grumpy[i]==0)
ans+=customers[i];
}
int uns=0;
for(int i=0;i<minutes;i++){
... | ALGO | 0.999811 | 6.327533 |
f424e713-0e50-4d6a-b6b8-529e8e808ee0 | Arevy/LFA | NFA/main.cpp |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int q[100], q0, n, m, p, fin[100], t, j, st[100], w;
char cuv[100];
char l[100];
struct nod
{
int stare;
nod *urm;
};
nod *d[105][200], *a, *b;
void parcurgere(int state, int p)
{
if (cuv[p]!='\0')
{
if (... | ALGO | 0.999326 | 4.078786 |
085fdcdf-5870-4684-b7a0-81cb4e976b7b | Prasanna018/Patterns--in--CPP | patterns in cpp/pattern7.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i <= n; i++)
{
for (int j = 0; j < n-i-1+1; j++)
{
cout << " ";
}
for (int k = 0; k < 2 * i - 1; k++)
{
cout << "*";
}
for (int j = 0;... | ALGO | 0.999837 | 3.877227 |
f0f28668-1e4c-4be9-82d2-5d0e3e4148b2 | prachiMeshram/Data-Structures-and-Algorithm | SDE SHEET/Patterns/pattern2.cpp | // https://practice.geeksforgeeks.org/problems/right-triangle/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=pattern_2
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
void printTriangle(int n) {
// code here
for (int i = 1; i <= n; i++) {
... | ALGO | 0.999978 | 5.03048 |
610b252d-e29a-4278-ab38-3a9ac275533e | ishandutta2007/codeforces | nuip/normal/580/A.cpp | #include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<cstring>
#include<sstream>
#incl... | ALGO | 0.999947 | 3.743794 |
3a13186e-df2e-4925-b268-10ff0f975c9f | dalangge1/Pilot | engine/3rdparty/JoltPhysics/Jolt/Core/StringTools.cpp | #include <Jolt/Jolt.h>
#include <Jolt/Core/StringTools.h>
JPH_SUPPRESS_WARNINGS_STD_BEGIN
#include <cstdarg>
JPH_SUPPRESS_WARNINGS_STD_END
JPH_NAMESPACE_BEGIN
string StringFormat(const char *inFMT, ...)
{
char buffer[1024];
// Format the string
va_list list;
va_start(list, inFMT);
vsnprintf(buffer, sizeof(buf... | TOOL | 0.950772 | 7.004594 |
bf6e61ca-b504-4ed4-b416-664c454d9140 | DavyVan/PhDStillNeedLeetCode | problems/83-Remove-Duplicates-from-Sorted-List/main.cpp | #include "kernel.h"
#include <stdlib.h>
#include <stdio.h>
int main()
{
int size;
printf("Input <# of nodes> (# > 0): ");
while (scanf("%d", &size))
{
printf("Input <nums>...: ");
struct ListNode *head = (struct ListNode*) malloc(sizeof(struct ListNode));
head->next = NULL;
... | ALGO | 0.998549 | 3.805124 |
c1a64e5a-07ab-4750-afe6-4d452a30da97 | ManojKumarPatnaik/Sr.SoftwareEngineerInterviewPrep | 03]. LeetCode/1]. Problems/C++/0017 (ii)]. Letter Combinations of a Phone Number.cpp | /*
Example 1:
Input: digits = "23"
Output: ["ad","ae","af","bd","be","bf","cd","ce","cf"]
Example 2:
Input: digits = ""
Output: []
Example 3:
Input: digits = "2"
Output: ["a","b","c"]
*/
class Solution {
public:
const vector<string> pad = {
"", "", "abc", "def", "ghi", "jkl", "mno... | ALGO | 0.999721 | 6.990767 |
e12b840b-a7e2-4f2c-bc67-20ef8d12c37c | Sarjador/Ender3_V4.2.2_Marlin-bugfix-2.0.x_BLTouch_and_FilamentSensor | Marlin/src/lcd/menu/game/maze.cpp | #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(MARLIN_MAZE)
#include "game.h"
int8_t move_dir, last_move_dir, // NESW0
prizex, prizey, prize_cnt, old_encoder;
fixed_t playerx, playery;
// Up to 50 lines, then you win!
typedef struct { int8_t x, y; } pos_t;
uint8_t head_ind;
pos_t maze_walls[50] = {
... | ALGO | 0.942636 | 5.033046 |
c111a9cc-4584-4685-9e3d-6e0493fe8187 | KwakJiyeon/BOJ | 15649_N과M1.cpp | #include <iostream>
#include <vector>
using namespace std;
int N, M;
bool check[9];
vector<int> v;
void f(int i) {
if (i == M) {
for (int j = 0; j < M; j++) {
cout << v[j] << ' ';
}
cout << "\n";
}
for (int j = 1; j <= N; j++) {
if (check[j]) {
continue;
}
check[j] = true;
v.push_back(j);
f... | ALGO | 0.999804 | 3.904708 |
e90d0a8b-d8a3-4649-b5fc-7db178d27cb5 | firewood/topcoder | atcoder/arc_110/a.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
LL lcm(LL a, LL b) { re... | ALGO | 0.999982 | 5.056962 |
ff041ddb-0be3-4f0a-8372-161f8c7bc4dc | xray-storage/Back-to-the-Roots | src/3rd party/NVTT/src/nvimage/Filter.cpp | // This code is in the public domain -- <EMAIL>
/** @file Filter.cpp
* @brief Image filters.
*
* Jonathan Blow articles:
* http://number-none.com/product/Mipmapping, Part 1/index.html
* http://number-none.com/product/Mipmapping, Part 2/index.html
*
* References from Thacher Ulrich:
* See _Graphics Gems III_ "G... | ALGO | 0.994391 | 5.140921 |
2eb03949-7d57-45cf-abd4-23d9b5cfef2f | Super-long/Summer-of-2019 | LZL.1/graph_theory/ShortestPath/HDU-1548.cpp | #include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<unordered_map>
#include<queue>
#include<vector>
#include<cstdlib>
#include<utility>
#include<cstring>
using namespace std;
int m,n,q;
int ans;
int tmp;
const int INF = 0x3f3f3f3f;
const int maxn = 205;
int vis[maxn];
int dis[m... | ALGO | 0.99988 | 3.623188 |
8f63006c-85f2-4a0d-b7e3-943f4d91f633 | shyamal2411/DSA-Practice | leetcodePractice/Tree/94InorderTraversal.cpp | class Solution {
public:
void inorder(TreeNode* root, vector<int>& tempNode) {
if (!root)
return;
inorder(root->left, tempNode);
tempNode.push_back(root->val);
inorder(root->right, tempNode);
}
vector<int> inorderTraversal(TreeNode* root) {
vector<int> tempNode;
inorder(root, ... | ALGO | 0.999988 | 6.561781 |
8e98d2b1-f9ac-43dc-aab7-17ad2c04df61 | Asad-Bin/cf-ac-problems | codeforces/1929/C..cpp | // . . . Bismillahir Rahmanir Rahim . . .
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#ifndef ONLINE_JUDGE
#define dbg_out cout
#define debug(...) dbg_out << "DBG )> "; __f(#__VA_ARGS__, __VA_ARGS__);
template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> pr) { out <... | ALGO | 0.999249 | 3.896036 |
96409d69-51fa-4b93-9e12-85e164a788d0 | khan1203/cf-solves | A_Recovering_a_Small_String.cpp | #include <iostream>
using namespace std;
int main()
{
int n, minSum = 99, minWord[3];
cin >> n;
for (char a = 'a'; a <= 'z'; a++) {
for (char b = 'a'; b <= 'z'; b++) {
for (char c = 'a'; c <= 'z'; c++) {
int sum = a + b + c;
if (sum < minSum && sum >= n... | ALGO | 0.999962 | 4.210882 |
b323e43c-7d6f-4b0c-bd65-71c9b5303479 | DimKor2020/Lab-Work-TMP | 3rd semester/Lab 9/Source.cpp | #include <iostream>
#include <string>
#include <fstream>
#include "BitString.h"
BitString::BitString() {
bs = 0;
len = 0;
}
BitString::BitString(std::string str) {
mas_from_string(str);
}
BitString::BitString(const BitString& b) {
len = b.len;
bs = new unsigned char[len + 1];
for (int i = 0; i <= len; i+... | TOOL | 0.991498 | 4.209496 |
1651b286-9364-4325-a399-acd987d0f672 | aman-anand-hub/DSA-HUB | DYNAMIC PROGRAMMING/PrintshortestcommonSupersequence.cpp | #include<bits/stdc++.h>
using namespace std;
int dp[1001][1001];
string printSCS(string x, string y, int n, int m)
{
for(int i=0;i<=m;i++) dp[0][i]=0;
for(int i=1;i<=n;i++) dp[i][0]=0;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
if(x[i-1]==y[j-1])
{
... | ALGO | 0.999996 | 4.277955 |
735b842e-059e-4550-be60-8994710ec3e8 | dohun-digipen/BOJ | DP/2133.cpp | #include <iostream>
int dp[31] = {0};
int main(){
int n;
std::cin >> n;
dp[0] = 1;
dp[1] = 0;
dp[2] = 3;
dp[3] = 0;
dp[4] = 11;
for(int i = 6; i<= n; i+=2){
dp[i] = dp[i-2] * 3;
for(int j = i - 4; j >= 0; j -= 2){
dp[i] += dp[j] * 2;
}
}
std::cout << dp[n];
} | ALGO | 0.999984 | 3.800412 |
0d51089e-42f4-4fa3-9e3c-d216fb17ecfa | ATMOS8/DSA | binary_search_median_in_a_row_wise_sorted_matrix_optimal.cpp | #include<bits/stdc++.h>
using namespace std;
int upperBound(vector<int> &arr, int x, int n) {
int low = 0, high = n - 1;
int ans = n;
while(low <= high) {
int mid = (low + high) / 2;
// maybe answer
if(arr[mid] > x) {
ans = mid;
// look for smaller index on le... | ALGO | 0.999999 | 5.521961 |
c8f588b3-5fe3-47a1-8e51-bd6c0b1ae51b | Roy-rom/android_frameworks_av | media/codecs/amrnb/dec/src/a_refl.cpp | /*
------------------------------------------------------------------------------
Filename: /audio/gsm-amr/c/src/a_refl.c
Functions: a_refl
Date: 02/05/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Removing unneeded include files and the ... | ALGO | 0.999856 | 5.783759 |
27ce61c8-f6b9-4fbb-bb80-e618869e508a | ps37/cpp_programming | errors/emperor.cpp | #include <iostream>
#include <fstream>
#include "string.h"
#include "vector"
using namespace std;
int main()
{
int present_number=2^2;
cout<<"please enter the number of squares in the chess board\n";
int number_of_squares=0;
cin>>number_of_squares;
double sum = 0;
for(int i =1; i<=number_of_squ... | ALGO | 0.999211 | 3.884688 |
217241aa-337c-4492-9454-c636bb5021a4 | kartik0920/Revision | Day 12/Lec 48/unsorted.cpp | #include "Node.cpp"
Node *removedup(Node *head)
{
if (head == NULL || head->next == NULL)
{
return head;
}
unordered_map<int, bool> mapping;
mapping[head->data] = 1;
Node *prev = head, *curr = head->next;
while (curr != NULL)
{
if (mapping[curr->data])
{
... | ALGO | 0.99949 | 4.7569 |
4a010b9a-e153-41dd-a182-19ebca675c85 | WenShihKen/uva | Zerojudge/d636 大爆炸bomb.cpp | #include<stdio.h>
#define m 10007
int main()
{
long long int in1, in2;
while (scanf("%lld%lld", &in1, &in2)!=EOF){
long long int ans = 1;
while (in2){
if (in2 % 2==1){
ans = (ans*in1) % m;
}
in1 = (in1*in1) % m;
in2 /= 2;
}
printf("%lld\n", ans);
}
return 0;
}
| ALGO | 0.999964 | 3.418764 |
11e10868-7c7c-46bd-b784-d04d1ccc8b17 | vidyanandk/DSA | CodeForces/A_Chewbaсca_and_Number.cpp | #include <iostream>
using namespace std;
int main() {
string tt;
cin >> tt;
for(int i=0;i<tt.size();i++) {
int t=tt[i]-'0';
if(i==0 && t==9) continue;
if(t>=5) t=9-t;
tt[i]=t+'0';
}
cout << tt << endl;
return 0;
}
| ALGO | 0.999844 | 4.060092 |
b0980a8e-d52c-4c3b-bd5c-bdfc5010b735 | mission365/leetcode_problems | 0040-combination-sum-ii/0040-combination-sum-ii.cpp | class Solution {
public:
void findCombination2(int index, int target,vector<int>& a, vector<vector<int>>& ans, vector<int>& ds){
if(target==0){
ans.push_back(ds);
return;
}
for(int i= index; i<a.size(); i++){
if(i>index && a[i]==a[i-1]) continue;
... | ALGO | 0.999995 | 6.208124 |
7e8ed22e-e832-4661-bd97-bb524cec5672 | ayyappareddynandipati/GFG | Difficulty: Easy/Check K-th Bit/check-kth-bit.cpp | class Solution {
public:
bool checkKthBit(int n, int k) {
// code here
//return (n & (1 << k)) != 0;
return ((n>>k)&1)!=0;
}
}; | ALGO | 0.999845 | 6.164634 |
f7ff3152-54d3-45f9-b3f2-99e88699b84e | Jehops/freebsd-ports-legacy | graphics/nurbs++/files/patch-matrix_matrix_char.cpp | --- matrix/matrix_char.cpp.orig 2008-02-13 22:21:07.000000000 +0100
+++ matrix/matrix_char.cpp 2008-02-13 22:21:42.000000000 +0100
@@ -27,7 +27,7 @@
namespace PLib {
- Matrix<char>&
+ template<> Matrix<char>&
Matrix<char>::operator*=(double a)
{
char *p1 ;
@@ -40,7 +40,7 @@
return *this ;... | TOOL | 0.914654 | 5.188797 |
94dab871-ce51-45d0-b379-15f52ae9c842 | zhangliangkai1992/zlk-leetcode | src/leetcode_34.cpp | /**
* @Copyright (c) 2021 The Authors All rights reserved
* @Author: zhangliangkai
* @create: 2021-06-25 00:10
*/
#include <gtest/gtest.h>
class Solution {
int BinSearch(const std::vector<int>& nums, int target) {
int low = 0;
int high = nums.size() - 1;
while (low <= high) {
int mid = (low + hi... | ALGO | 0.99944 | 6.524327 |
f0181594-c46d-45c5-af50-4c476932b35f | DnV1eX/Telegram-iOS | third-party/openh264/third_party/openh264/src/codec/encoder/core/src/sample.cpp | #include "sample.h"
#include "sad_common.h"
#include "intra_pred_common.h"
#include "mc.h"
#include "cpu_core.h"
namespace WelsEnc {
int32_t WelsSampleSatd4x4_c (uint8_t* pSample1, int32_t iStride1, uint8_t* pSample2, int32_t iStride2) {
int32_t iSatdSum = 0;
int32_t pSampleMix[4][4] = {{ 0 }};
int32_t iSample0,... | ALGO | 0.999962 | 4.246334 |
4cfcee06-b454-4844-beb2-4afc3c92ffdb | samuelrawrs/git_ws | cpp_examples/bubbleSort.cpp | #include <iostream>
using namespace std;
void bubbleSort(int a[], int size);
void print(const int a[], int size);
int main (){
const int SIZE = 8;
int a[] = {8,4,5,3,2,9,4,1};
print(a, SIZE);
cout << endl;
bubbleSort(a,SIZE);
print(a,SIZE);
cout << endl;
}
void bubbleSort(int a[], int si... | ALGO | 0.999932 | 5.203932 |
10d815db-627d-4547-8728-f8685e02a92e | andredxc/ICNInstallation | netbee/src/nbnetvm/jit/x64/x64-opt.cpp | /*****************************************************************************/
/* */
/* */
/*****************************************************************************/... | ALGO | 0.984455 | 5.818629 |
a712471f-df5b-4f15-9883-c2221d4d4cbc | Ravikant1043/gfg_potd | 17_1_2024.cpp | vector<vector<int>>ans;
set<vector<int>>s;
sort(arr.begin(),arr.end());
ans.push_back(arr);
s.insert(arr);
while(next_permutation(arr.begin(),arr.end())){
if(s.find(arr)==s.end()){
ans.push_back(arr);
s.insert(arr);
}
... | ALGO | 0.999781 | 4.731219 |
55965a8b-3c4c-4b84-95ca-feefaa72fd1d | hungdev1602/Data-structures-and-Algorithms | Dynamic Programming/22.Sum_substring/main.cpp | // Bài 22. Sum substring
// Cho một số tự nhiên N được biểu diễn như một xâu kí tự, bạn hãy tính tổng của
// tất cả các số tạo bởi các xâu con liên tiếp của N, ví dụ N = 235 thì ta có tổng = 2
// + 3 + 5 + 23 + 35 + 235.
// Input Format
// Dòng duy nhất chứa số nguyên dương N
// Constraints
// 1<=N<=10^12
// Outp... | ALGO | 0.999883 | 4.309839 |
dba3518b-cb49-49e0-82f4-7f74cf33b8bb | siddharth-kumar182002/DSA | A_Presents.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
int arr[t];
int arr2[t];
for (int i = 0; i < t; i++)
{
cin >> arr[i];
arr2[arr[i]-1] = i + 1;
}
for (int i = 0; i < t; i++)
{
cout << arr2[i] << " ";
}
return 0;
} | ALGO | 0.999947 | 4.053663 |
a725816a-7156-4053-9467-26e8f971ea14 | Mohammad-Ashikul-Islam/Competitive_Programming | UVA/UVA_10071_Back_to_High_School_Physics.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int t,v;
while(cin >> t >> v){
cout << 2*t*v;
}
return 0;
}
| ALGO | 0.996629 | 3.389257 |
09d8a7e8-80d1-44f1-a0c2-49ee9aba8f74 | andrewmo2014/Curves-and-Surfaces | vecmath/src/Matrix4f.cpp | #include "Matrix4f.h"
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "Matrix2f.h"
#include "Matrix3f.h"
#include "Quat4f.h"
#include "Vector3f.h"
#include "Vector4f.h"
Matrix4f::Matrix4f()
{
for( int i = 0; i < 16; ++i )
{
m_elements[ i ] = 0;
}
}
Matrix4f::Matrix4f( float m0... | TOOL | 0.977902 | 6.930418 |
96de06f1-519a-4e1d-8026-64389c276b7c | raincross7/code-similarity | codes/train_code/problem038/problem038_357.cpp | #include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair... | ALGO | 0.999955 | 3.940303 |
9a1c0908-af33-4c90-a1b0-fe734dc16198 | MdAlSiam/My-Codeforces-Solutions | 1389C.cpp | using namespace std;
#include <bits/stdc++.h>
#define ll long long int
#define dd double
#define scl(x) scanf("%lld", &x)
#define scll(x, y) scanf("%lld %lld", &x, &y)
#define scd(x) scanf("%lf", &x)
#define scdd(x, y) scanf("%lf %lf", &x, &y)
#define prl(x) printf("%lld\n", x)
#define prll(x, y) printf("%lld %lld\n... | ALGO | 0.999459 | 3.639002 |
fd1465d2-b615-4589-a5f1-11824435f0cc | iwannabeasenior/BasicProgramming | project1/tuan3/WaterJugs.cpp | #include<bits/stdc++.h>
using namespace std;
#define N 1001
int a, b,c ;
struct State {
int x, y;
int step;
State(int _x, int _y, int _step) {
x = _x;
y = _y;
step = _step;
}
};
vector<State> getNeighborhood(State s) {
vector<State> ns;
// build 7 state
State s1(a, s... | ALGO | 0.999942 | 3.586033 |
809f01a0-9eb7-4222-bd5d-b153d99b0b4b | Qrebit/Push_front | Memory/Source.cpp | #include <iostream>
#include <ctime>
using namespace std;
void Fill(int arr[], const int n) {
for (int i = 0; i < n; i++) {
arr[i] = rand() % 100;
}
}
void Print(int arr[], const int n) {
for (int i = 0; i < n; i++) {
cout << arr[i] << '\t';
}
cout << endl;
}
void back_add(int*& arr,int& n, int a) {
int* bu... | ALGO | 0.971583 | 3.662565 |
08a150e5-34b5-4968-8ef9-4e3b68d14c17 | Lomna21/DSA-love-babbar-codes | Lecture063 Tree Interview Questions Day1/identicalTree.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int data;
struct Node *left;
struct Node *right;
Node(int x){
data = x;
left = NULL;
right = NULL;
}
};
// } Driver Code Ends
/* A binary tree node
struct Node
{
int data;
struct Node* left;
struct N... | ALGO | 0.999577 | 7.172666 |
5b04c62d-874d-4b65-a059-0e4d2a4bd492 | open64-compiler/open64 | osprey/testsuite/cases/cern/root/TRandom3/testTRandom3.cpp |
// J.M. Dana
// <EMAIL>
//#include <stdio.h> // Compatibility with
//#include <errno.h> // gcc 2.96
#include <iostream>
#include <sys/time.h>
#include <unistd.h>
#include "timing.h"
#include "Rtypes.h"
#include "TRandom.h"
#include "TRandom3.h"
using namespace std;
#define N 2100000000
#define M 10
#define NN N/... | TEST | 0.933216 | 4.167641 |
474a5796-3fff-4cb3-a0f9-34fc16a113b6 | dosarudaniel/Halite-Competition-Proiect-PA | centru_pus_la_treaba_BOT.cpp | #include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <set>
#include <fstream>
#include "hlt.hpp"
#include "networking.hpp"
#define POSSIBLE_MOVEMENTS 5
int main() {
srand(time(NULL));
std::ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing... | ALGO | 0.993964 | 3.60717 |
125eca9a-d0b2-45d9-85a2-5e2de1275796 | SaranSaiChava/Problem_Solving | Codeforces/Edu_Round_31/a.cpp | #include < bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector < int > v;
int b;
for( int i=0 ; i < n ; i++)
{
cin>>b;
if(i==0)
{
if(b==3)
{
cout<<"NO";
return 0;
}
}
v.push_back(b);
}
if(n==1)
{
cout<<"YES";
return 0;
}
if(n==2)
{
if(((v[0]==1)&&(v[1]==2... | ALGO | 0.999981 | 3.898186 |
e73044a5-e838-412e-b476-9106dfc97e75 | y0yoyopi/Algoritmos-y-Estructura-de-Datos | homework/HashTables.cpp | #include <vector>
#include <string>
using namespace std;
// Nodo de la lista enlazada para manejar colisiones
template<typename T>
struct Nodo {
T data;
Nodo* next;
Nodo(T d) : data(d), next(nullptr) {}
};
// Lista enlazada para manejar colisiones
template<typename T>
class List {
private:
Nodo<T>* ... | ALGO | 0.999803 | 6.485505 |
cc15c2aa-d24e-4f5b-8d2d-ba5259046978 | Mulab11/cntt2016-hw1 | TC-SRM-568-div1-250/cjy.cpp | #include<bits/stdc++.h>
using namespace std;
int i,j,k,s,n,f[51][8];
vector<int> c[3];
class BallsSeparating
{
public:
int minOperations(vector<int> r,vector<int> g,vector<int> b)
{
if(c[0]=r,c[1]=g,c[2]=b,memset(f,-1,sizeof(f)),n=r.size(),n<3)return -1;
for(f[0][0]=0;i<n;i++)for(s+=r[i]+g[i]+b[i],j=0;j<8;j+... | ALGO | 0.999395 | 4.690228 |
d1c96db9-3146-40af-aac0-345db3aa2543 | hoanxuanbach/Competitive-Programming | OI/PA/2024/BUC.cpp | // Judges with GCC >= 12 only needs Ofast
// #pragma GCC optimize("O3,no-stack-protector,fast-math,unroll-loops,tree-vectorize")
// MLE optimization
// #pragma GCC optimize("conserve-stack")
// Old judges
// #pragma GCC target("sse4.2,popcnt,lzcnt,abm,mmx,fma,bmi,bmi2")
// New judges. Test with assert(__builtin_cpu_sup... | ALGO | 0.999906 | 4.136384 |
f6153f70-eaaf-4952-8c0e-946b8f68620c | rayluo98/QuantLibrary | math_library/QMath.cpp | #include <cmath>
#include <vector>
namespace QMath {
std::vector<std::vector<double>> cublicSpline(std::vector<std::pair<double, double>> inputs){
std::vector<std::vector<double>> result;
return result;
}
} | ALGO | 0.999478 | 4.133152 |
46e316d5-92dd-4f5d-87b5-102793fb9dfe | Johannyjm/c-pro | AtCoder/asa/2020/asa0222/a.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int a, b;
cin >> a >> b;
if(a+b>=10) cout << "... | ALGO | 0.994546 | 3.846692 |
ef488820-2682-4036-b0e6-30416af7f7f0 | ChuanSWT/Codeforces_codes | A_Olympiad_Date.cpp | #include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <tuple>
#include <queue>
#include <iomanip>
#include <numeric>
#include <assert.h>
#define int long long
using namespace std;
void compete_solution();
signed main()
{
ios_base::sync... | ALGO | 0.999955 | 4.511482 |
a6675555-c79f-43cd-b3d8-6d84bb33418c | Anonymous2/trinityone | src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp | /* ScriptData
SDName: Boss_High_Botanist_Freywinn
SD%Complete: 90
SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay)
SDCategory: Tempest Keep, The Botanica
EndScriptData */
#include "ScriptMgr.h"
#include... | TOOL | 0.853806 | 5.698837 |
e137a6d7-32e5-4856-b731-245fc1a16479 | jayantiii/ADS_LAB | lab10-binomial_heap1.cpp | #include <bits/stdc++.h>
using namespace std;
struct Node
{
int val, degree;
Node *parent, *child, *sibling;
};
typedef Node* NODE;
NODE root = NULL;
void binomialLink(NODE h1,NODE h2)
{
h1->parent = h2;
h1->sibling = h2->child;
h2->child = h1;
h2->degree = h2->degree + 1;
}
NODE createNode(... | ALGO | 0.999944 | 4.332431 |
823ab986-9376-4bb7-bfd3-5462bc828a44 | PiusLim373/leetcode_and_hackerrank | leetcode/interview150/120_triangle.cpp | #include <vector>
int minimumTotal(std::vector<std::vector<int>>& triangle)
{
if (!triangle.size())
return 0;
for (int i = triangle.size() - 2; i >= 0; i--)
{
for (int j = 0; j < triangle[i].size(); j++)
{
int curr = triangle[i][j];
triangle[i][j] = std::min(curr + triangle[i + 1][j], curr... | ALGO | 0.999899 | 5.929543 |
72658527-98f8-4ab8-b8f3-8a8d2fa84ffb | mori399/old-lab | сем 2/ПнЯВУ/лаба 22/lab22.cpp | #include <iostream>
#include <cmath>
using namespace std;
double func(double a)
{
if(a <= 0 || a == -2 || a == 2) throw a; // знаменатели
double z1 = ((a+2)/sqrt(2*a) - a/(sqrt(2*a)+2) + 2/(a-sqrt(2*a)))*(sqrt(a)-sqrt(2))/(a+2);
// cout << z1 << endl;
double z2 = 1/(sqrt(a)-sqrt(2));
// cout << ... | ALGO | 0.955615 | 4.192106 |
f7b778a9-baf6-4f2d-b6f0-c57369ca6276 | shaowei-cai-group/AriParti | src/partitioner/src/ast/simplifiers/euf_completion.cpp | #include "ast/ast_pp.h"
#include "ast/ast_util.h"
#include "ast/euf/euf_egraph.h"
#include "ast/simplifiers/euf_completion.h"
#include "ast/shared_occs.h"
namespace euf {
completion::completion(ast_manager& m, dependent_expr_state& fmls):
dependent_expr_simplifier(m, fmls),
m_egraph(m),
m_... | ALGO | 0.995272 | 3.202633 |
c123019f-9050-4eb6-afba-a8045f2be508 | DoctorLai/ACM | binarysearch/Making-List-Values-Equal/Making-List-Values-Equal.cpp | // https://helloacm.com/algorithms-to-make-list-values-equal/
// https://binarysearch.com/problems/Making-List-Values-Equal
// EASY, MATH
int solve(vector<int>& nums) {
auto minmax = minmax_element(begin(nums), end(nums));
return *minmax.second - *minmax.first;
}
| ALGO | 0.999923 | 6.058234 |
a8812176-abf3-4949-9be7-4812162597ba | tugawa/openjdk-reproduce-5164 | src/hotspot/share/compiler/tieredThresholdPolicy.cpp | #include "precompiled.hpp"
#include "compiler/compileBroker.hpp"
#include "compiler/compilerOracle.hpp"
#include "compiler/tieredThresholdPolicy.hpp"
#include "memory/resourceArea.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/globals_extensi... | TOOL | 0.918619 | 7.483397 |
aa5ffb94-9185-4158-8989-4ea603c14615 | CrazyFengCat/C-CPP | code/ExpertCProgramming/mat.cpp | #include <iostream>
#include <vector>
using namespace std;
template<class T>
class Mat
{
private:
/* data */
int row;
int col;
vector<T> matrix;
public:
Mat(/* args */){
row = col = 0;
}
Mat(vector<vector<T>> v){
row = v.size();
col = row == 0?0:v[0].size();
... | ALGO | 0.999525 | 3.390728 |
ec236e37-419c-41e1-8d8a-3e7dfee4f3ea | jjoolloo/Swiss-Slovak-misunderstanding | success!!!!!!!!!!!!!!!/toolbox_fast_marching/mex/gw/gw_geodesic/GW_GeodesicFace.cpp | /*------------------------------------------------------------------------------*/
/**
* \file GW_GeodesicFace.cpp
* \brief Definition of class \c GW_GeodesicFace
* \author Gabriel Peyr
* \date 4-12-2003
*/
/*------------------------------------------------------------------------------*/
#ifdef GW_SCC... | ALGO | 0.913431 | 6.686407 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.