uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
e47df364-dd12-4df6-99bc-552a4029bb7e | NDT080506/HocLapTrinh | Icpc/contest1/bai6.cpp | #include <bits/stdc++.h>
#define fo(i, n) for (int i = 0; i < (n); i++)
#define fi(i, n) for (int i = 1; i <= (n); i++)
using ll = long long;
using namespace std;
const int mod = 1e9 + 7;
// tinh mod cua mot so nguyen nho va so nguyen lon
ll mod_(ll a, string b){
ll res = 0;
for(char ch: b){
res = (res * 10 ... | ALGO | 0.999661 | 5.982229 |
ed57ad24-046e-435a-bb2d-26296ca345bd | openjdkgit/-jfx | modules/javafx.web/src/main/native/Source/JavaScriptCore/b3/air/AirAllocateStackByGraphColoring.cpp | #include "config.h"
#include "AirAllocateStackByGraphColoring.h"
#if ENABLE(B3_JIT)
#include "AirArgInlines.h"
#include "AirCode.h"
#include "AirHandleCalleeSaves.h"
#include "AirInstInlines.h"
#include "AirLiveness.h"
#include "AirPhaseScope.h"
#include "AirStackAllocation.h"
#include <wtf/InterferenceGraph.h>
#incl... | ALGO | 0.92274 | 7.721806 |
7e8a0c89-4358-481a-a0df-00555d6f7c7f | fizban007/Aperture4 | problems/fast_wave_2d/src/main.cpp | #include "core/math.hpp"
#include "framework/config.h"
#include "framework/environment.h"
#include "systems/compute_moments.h"
#include "systems/data_exporter.h"
#include "systems/field_solver_sph.h"
#include "systems/gather_tracked_ptc.h"
#include "systems/grid_sph.hpp"
#include "systems/policies/coord_policy_spherica... | ALGO | 0.890826 | 5.42882 |
484fa9b1-8423-42b1-bbff-00b9b8a5cd0a | 113bommy/LogicalErrorFixCodeT5 | LogicalErrorFix_metric/CodeT5_LineNumber_cpp_source/Problem_45_source_165.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> v;
int sum = 1;
for (int i = 0; i < n; i++) {
int a;
cin >> a;
v.push_back(a);
}
int count0 = 0, count1 = 0;
for (int i = 0; i < n; i++) {
if (v[i] == 1) {
count1++;
if (count1 == 2... | ALGO | 0.999753 | 4.379863 |
556bc059-636b-4fd6-bae0-a9363207a91d | ktak2001/algorithm | AOJ/alds1v2/4dans.cpp | #include <iostream>
#include <vector>
using namespace std;
bool f(const vector<int> &w, int P, int k)
{
int i = 0, n = (int)w.size();
for (int j = 0; j < k; ++j)
{
for (int wj = 0; i < n && wj + w[i] < P; ++i)
wj += w[i];
if (i >= n)
return true;
}
return i >= n;
}
int main()
{
int n, k;
cin >> n >>... | ALGO | 0.99996 | 3.980342 |
a37b88ad-66b0-4aa7-a568-4565efcdfebc | shiv001001/shiv-s-programs | LAB 2/PROGRAM 6 WEEK 2.cpp | #include <stdio.h>
int main()
{
int a,b,c;
printf("ENTER 3 NUMBERS AND THE O/P WILL BE THE GREATEST OF THE 3");
scanf("%d %d %d", &a, &b, &c);
if(a>b && a>c)
printf("THE GREATEST NUMBER IS %d", a);
else if(b>c)
printf("THE GREATEST NUMBER IS %d", b);
else
printf("THE GREATEST NUMBER IS %d", c);
}
| ALGO | 0.999251 | 3.699584 |
ea519025-af28-43d9-93e3-29dfae2a9b2d | yohm/sim_sampling_analysis | stoch_block_sampling/simulator/stoch_block_sampling.cpp | #include <iostream>
#include <random>
#include "sampling.hpp"
int main(int argc, char** argv) {
if(argc != 11) {
std::cerr << "Usage : ./stoch_block_sampling.out N N_C p_in p_out alpha h0_min h0_max beta reshuffle _seed" << std::endl;
return 1;
}
size_t N = std::stoul(argv[1]);
size_t N_C = std::stoul... | ALGO | 0.989553 | 4.810559 |
81330ab1-986c-48cc-bca3-7ef050ff21dd | rupav/cp | competitive_coding/contests/570/570A.cpp | #include<bits/stdc++.h>
using namespace std;
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll mod = 1e9+7;
ll gcdll(ll a, ll b){
... | ALGO | 0.999806 | 3.740969 |
1dc099e2-0117-4278-9e7e-0fc5cfd0e7e1 | mrunaltarwatkar018/Coding_Ninjas_Introduction_To-C-and_Data_Structures_and_Algorithm | Milestone 4/A - Lecture 11 - Trees/2. Assignment/2_count_nodes.cpp | /* =================================================================================================================== */
/*
Question : Count nodes
Given a tree and an integer x, find and return the number of
nodes which contains data greater than x.
... | ALGO | 0.999949 | 5.366706 |
03cc8dc7-ff4f-4527-aa04-c0170d48979b | Livia-11/Data-Structure-and-Algorithms | linked list.cpp | #include<iostream>
using namespace std;
class Node{
public:
int data;
Node* next;
Node(int dt){
data=dt;
next=NULL;
}
};
Node* deleteAtBeginning(Node* head){
if(head == NULL){
return head;
}
Node* temp = head;
head = head->next;
temp->next = NULL;
delete temp;
return head;
}
Node* dele... | ALGO | 0.999734 | 4.689287 |
65b55a19-34ac-41b5-b21f-82d66ed41371 | sir-rasel/Sadia_apu_code_library_DS_and_algorithm | stringL,N.cpp | #define MAXP 106
char valid[27];
unsigned long long pw[MAXP];
string print(int k, int d, unsigned long long n)
{
//printf("%d %d %llu\n", k, d, n);
string ans = "";
int i,j;
j = d;
while(j > 0)
{
for (i=0; i<k; ++i)
{
if ((i+1)*pw[j-1] >= n) break;
}
n... | ALGO | 0.999965 | 3.711244 |
691a1152-738c-48db-8ba7-a90b2bef1585 | Djokovic0311/LeetCode | problems/my_calendar_ii/solution.cpp | class MyCalendarTwo
{
map<int, int> mp; // key: time; val: +1 if start, -1 if end
public:
bool book(int start, int end)
{
mp[start]++;
mp[end]--;
int booked = 0;
for (auto it = mp.begin(); it != mp.end(); it++)
{
booked += it->second;
if (bo... | ALGO | 0.999858 | 5.92342 |
da1c6995-9a15-471d-95af-327068cdd13b | VFR-maniac/opencore-amr | opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp | /*
------------------------------------------------------------------------------
Filename: agc.cpp
Funtions: energy_old
energy_new
agc_init
agc_reset
agc_exit
agc
agc2
------------------------------------------------------------------------------
M... | ALGO | 0.993215 | 5.119219 |
f8c0111d-829a-426b-aaba-ff57f9e7d974 | heavenMOJANG/ICPC | .history/Codeforces/CF2031/D_20241115233807.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int INF = 0x7fffffff;
class DSU {
private:
int n, siz;
vector<int> father, siz;
DSU(int x) : n(x), father(x + 1), siz(x + 1, 1) { iota (fat... | ALGO | 0.999761 | 4.573462 |
e1ef72f1-bf6e-4ad6-9699-858cf7afb226 | siddhanttomar2003/CP | A_To_Zero.cpp | //author:-Siddhant Tomar
//linked in :-https://www.linkedin.com/in/siddhant-tomar-9b3aab261/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order... | ALGO | 0.999751 | 4.255454 |
c56d399f-67a5-40c5-b5c2-74f9967aaa54 | hoanghiep1945/DSA | Dynamic Programming_DP/DSA05029.cpp | #include <bits/stdc++.h>
using namespace std;
// dp[i] : số cách giải mã của i kí tự
int decode(string m) {
int n = m.length();
if (m[0] == '0') return 0;
m += "@";
vector<int> dp(n + 1, 0);
dp[0] = dp[1] = 1;
// nếu kí rỗng hoặc có 1 kí tự thì chỉ có 1 cách giải mã
for (int i = 2; i <= n; i... | ALGO | 0.99943 | 4.855347 |
6fc3a5b7-c45b-4d0e-861a-c48056949e59 | SakshamSahgal/Competitive-Programming | Codeforces + Codechef/C. Alternating Subsequence.cpp | #include<iostream>
#include<cstring>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
#include<climits>
#define lli long long int
#define GO_FAST ios_base::sync_with_stdio(0);ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// basic debugging macros
lli __i__,__j__;
lli inf = 9e18;
#defin... | ALGO | 0.999822 | 3.388781 |
2cf211aa-f4ba-4c17-a91c-3375f72fe7d5 | pakhandi-zz/CODECHEF | BUYING2/1.cpp | //Author : pakhandi
//
using namespace std;
#include<iostream>
#include<stdio.h>
#include<algorithm>
using std::string;
static struct IO {
char tmp[1 << 10];
// fast input routines
char cur;
//#define nextChar() (cur = getc_unlocked(stdin))
//#define peekChar() (cur)
inline char nextChar() { return cur ... | ALGO | 0.999754 | 3.152565 |
152d024c-ff83-471a-be1a-02720eb77434 | Ginakira/Code-Archive | Leetcode/LeetCode2643.cpp | // LeetCode 2643 一最多的行
#include <algorithm>
#include <array>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> rowAndMaximumOnes(vector<vector<int>... | ALGO | 0.999723 | 6.246171 |
62ce9f6c-0266-4221-b40d-2fd076f37865 | devpeshawari/Problem-Solving | 236-lowest-common-ancestor-of-a-binary-tree/lowest-common-ancestor-of-a-binary-tree.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
TreeNode * findLCA(TreeNode * node, TreeNode * p, TreeNode * q){
if(node == NULL) return NULL;
if(node ... | ALGO | 0.999988 | 6.227843 |
4601dea6-8fbf-40ce-aefe-8b1ff46c6e91 | AkshitGarg24/LeetCode_solutions | Difficulty: Easy/Union of Two Sorted Arrays with Distinct Elements/union-of-two-sorted-arrays-with-distinct-elements.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// a,b : the arrays
// Function to return a list containing the union of the two arrays.
vector<int> findUnion(vector<int> &a, vector<int> &b) {
vector<int> ans;
int i = 0;... | ALGO | 0.999384 | 5.926601 |
7be5c5c1-cb14-49f8-993a-2f871a142e3f | Mohit-106/DSA_Level_2 | Best_of_DP/3_Maximum Value of an Ordered Triplet II.cpp | // > 2874. Maximum Value of an Ordered Triplet II
// class Solution {
// public:
// long long maximumTripletValue(vector<int>& nums) {
// int n = nums.size();
// vector<int>rm(n);
// rm[n-1] = -1;
// long long ans=0;
// for(int i=n-2; i>0; i--){
// ... | ALGO | 0.999867 | 5.011593 |
52c3ed01-6427-4935-9175-c1161e4d6415 | ishandutta2007/codeforces | nocodenolife/normal/961/A.cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n , squares;
cin>>n>>squares;
int arr[n] = {0};
for(int i=0;i<squares;i++)
{
int k;
cin>>k;
arr[k-1]++;
}
int min=squares;
for(int i=0;i<n;i++)
{
if(min>arr[i])
m... | ALGO | 0.99975 | 3.002534 |
90caaced-c26a-4ec3-aef4-fb4a2d2ca90a | Anshika-111105/DSA-leetcode | 2432-number-of-zero-filled-subarrays/number-of-zero-filled-subarrays.cpp | class Solution {
public:
long long zeroFilledSubarray(vector<int>& nums) {
long long count=0, streak=0;
for(auto x: nums){
if(x==0){
streak++;
count=count+streak;
}else{
streak=0;
}
}
ret... | ALGO | 0.999975 | 6.149071 |
a71af12a-a2af-4009-866d-01beee55eea8 | Smaedd/source-sdk-2013-utils | mp/src/utils/vbsp/disp_ivp.cpp | struct disp_grid_t
{
int gridIndex;
CUtlVector<int> dispList;
};
static CUtlVector<disp_grid_t> gDispGridList;
disp_grid_t &FindOrInsertGrid( int gridIndex )
{
// linear search is slow, but only a few grids will be present
for ( int i = gDispGridList.Count()-1; i >= 0; i-- )
{
if ( gDispGridList[i].gridInde... | TOOL | 0.931187 | 5.989269 |
fa1bff9f-98ec-42e2-899e-e91bb57cbfd8 | kaushik-bhat/Codeforces_solutions | 1311A - Add Odd or Subtract Even.cpp | /*
You are given two positive integers a and b.
We can choose any positive odd integer x (x > 0) and add it to a (or) We can chose any positive even integer y (y > 0) and subtract y from a.
Firstly, let us prove that we can always turn a into b in some finite moves, assuming they are not equal in the first place
Say a... | ALGO | 0.999985 | 5.51893 |
552c2233-bc1e-4d2e-bb4d-bf824b4b92a2 | jhasudhakar/leetcode | 25_reverse_node_in_k_groups.cpp | #include <stdlib.h>
//Definition for singly-linked list.
struct ListNode
{
int val;
ListNode *next;
ListNode ():val (0), next (NULL)
{
}
ListNode (int x):val (x), next (NULL)
{
}
ListNode (int x, ListNode * next):val (x), next (next)
{
}
};
class Solution
{
public:
ListNode * reverseKGroup (Lis... | ALGO | 0.999981 | 5.447745 |
45fb80a2-b4cf-433e-a23c-77c0d4184e61 | Loki-chen/Compile_via_MLIR | third_party/llvm-project/llvm/utils/TableGen/PseudoLoweringEmitter.cpp | #include "CodeGenInstruction.h"
#include "CodeGenTarget.h"
#include "llvm/ADT/IndexedMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen... | TOOL | 0.893973 | 7.830148 |
8270c56a-4875-4b98-b23a-ffeb1f4e2796 | sarvex/leetcode-s | solution/0400-0499/0434.Number of Segments in a String/Solution.cpp | class Solution {
public:
int countSegments(string s) {
int ans = 0;
for (int i = 0; i < s.size(); ++i) {
if (s[i] != ' ' && (i == 0 || s[i - 1] == ' ')) {
++ans;
}
}
return ans;
}
}; | ALGO | 0.999858 | 5.620683 |
c6b2a2cc-589c-4e10-999d-48071e8e06a3 | DDugs/litcoder | 1218-lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.cpp | class Solution {
public:
TreeNode* lcaDeepestLeaves(TreeNode* root) {
return dfs(root).first;
}
pair<TreeNode*, int> dfs(TreeNode* root) {
if (!root) {
return {nullptr, 0};
}
auto [l, d1] = dfs(root->left);
auto [r, d2] = dfs(root->right);
if (d1 ... | ALGO | 0.999963 | 6.886359 |
3dc739b5-1273-48c0-aacf-69ec22189af0 | Ibn-Omar-Romel/LeetCode_Solve | 0118-pascals-triangle/0118-pascals-triangle.cpp | class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>>vec(numRows);
for (int i = 0; i < numRows; i++) {
for(int j = 0; j <= i; j++) {
if (j == 0 || j == i) {
vec[i].push_back(1);
}
... | ALGO | 0.999991 | 5.709246 |
5f356e29-3ae4-41c4-b97b-59eb0d0fed1e | Ph0ngsathorn/MiniCode | ifc พงศธร012.cpp | #include<iostream>
using namespace std;
int main(){
int a;
cin>>a;
if(a>10){
cout<<"Nice";
}
return 0;
}
| TOOL | 0.926932 | 3.468847 |
68761071-abbb-4a1b-a89b-896481c704c5 | bi-an/blog | source/downloads/code/atomic/cas_case.cpp | #include <atomic>
#include <thread>
#include <iostream>
std::atomic<int> counter(0);
void conditional_increment() {
for (int i = 0; i < 1000; ++i) {
int expected = counter.load();
while (expected < 500 && !counter.compare_exchange_weak(expected, expected + 1)) {
// 重试,直到成功或条件不满足
... | ALGO | 0.98655 | 4.824965 |
5cbddf0a-b096-413e-aea7-46afbd6a17ee | dhieunguyen/learning-programming | Contest1/bai2.cpp | #include<iostream>
using namespace std;
bool check = true;
int N,K;
int array[50];
void inIt(){
cin>>N>>K;
for(int i=1;i<=K;i++){
cin>>array[i];
}
}
void nextCombination(int N,int K,int array[]){
int i=K;
while(i>0&&array[i]==N-K+i)
i--;
if(i>0){
array[i]++;
for(int ... | ALGO | 0.999571 | 3.76627 |
a6e596a6-b9a2-483e-a828-aa50ad57003f | Sandip-Kanzariya/GFG-LeetCode | Medium/Merge 2 sorted linked list in reverse order/merge-2-sorted-linked-list-in-reverse-order.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
/* Link list Node */
struct Node
{
int data;
struct Node* next;
};
void print(struct Node *Node)
{
while (Node!=NULL)
{
cout << Node->data << " ";
Node = Node->next;
}
}
Node *newNode(int data)
{
Node *temp = ... | ALGO | 0.999836 | 5.069886 |
889f6e92-972f-477e-9137-0ed4df154dc3 | gerald-yang/iotivity-demo | iotivity-1.0.1/extlibs/boost/boost_1_58_0/libs/geometry/doc/src/examples/algorithms/intersection_ls_ls_point.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[intersection_ls_ls_point
//` Calculate the intersection of two linestrings
#include <iostream>
#include <deque>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/register/li... | ALGO | 0.99299 | 5.3639 |
f578f053-daab-4325-8988-da1db76f8656 | Pranay36/leetcode-problems | 0438-find-all-anagrams-in-a-string/0438-find-all-anagrams-in-a-string.cpp | class Solution {
public:
vector<int> findAnagrams(string s, string p) {
vector<int> v;
vector<char>freq(26);
vector<char> window(26);
int n = s.size();
int m = p.size();
if(n < m)
return {};
for(int i=0;i<m;i++){
freq[p[i]-'a'... | ALGO | 0.999976 | 6.152045 |
e2b60529-d7e1-46a7-ab18-589882bce0c4 | ishandutta2007/codeforces | vladprog/normal/1059/C.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
typedef long double ld;
typedef pair<int,int> pii;
#define x first
#define y second
signed main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
set<int> s;
for(int i=1;i<=n;i++)
... | ALGO | 0.999997 | 3.916785 |
b3490f5d-fd13-4744-b41c-2c9e840e2253 | raincross7/code-similarity | codes/train_code/problem076/problem076_127.cpp | #include<iostream>
#include<vector>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> H(N);
vector<int> map(N);
for(int i = 0; i < N; i++) {
cin >> H[i];
map[i] = H[i];
}
for(int i = 0; i < M; i++) {
int A, B;
cin >> A >> B;
A--;
B--;
map[A] = max(map[A... | ALGO | 0.999987 | 4.098776 |
35a7fd8d-c914-4a47-833f-c2535f15f8af | njusegzyf/AtgProjs | CallCPP-CLFF/11_50/recipes/expint.cpp | #include <cmath>
#include <limits>
#include "nr.h"
using namespace NR;
DP expint(int n, double x)
{
const int MAXIT=100;
const DP EULER=0.577215664901533;
const DP EPS=numeric_limits<DP>::epsilon();
const DP BIG=numeric_limits<DP>::max()*EPS;
int i,ii,nm1;
DP a,b,c,d,del,fact,h,psi,ans;
nm1=n-1;
if (n < 0 || ... | ALGO | 0.999038 | 3.992707 |
e942156b-e13d-41ee-b621-0e32e3c8a1c6 | Dev-Reddy/CrackYourPlacement | Day42/Tree/193.Balanced Binary Tree/sol.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.999816 | 6.271742 |
51e47cf5-a487-467c-96d1-5e46fae3a241 | mrizaln/learn-cpp | 9. Compound Types: References and Pointers/9.8. pointes and const.cpp | #include <iostream>
/*---------------------------------------------------------------------------------------
============[ pointer to const value ]============
---------------------------------------------------------------------------------------*/
// a pointer to const value is a (non-const) poin... | TOOL | 0.974815 | 5.340651 |
8290d062-ab48-4a59-b298-2466185ea04a | antusaha970/My-source-code-DSA | leetcode/largestNumafterdigitSwap.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int largestInteger(int num)
{
vector<int> stStore, revStore;
int ans = 0;
while (num != 0)
{
int tmp = num % 10;
stStore.push_back(tmp);
revStore.push_back(tmp);
num /= 10;
}
reverse(... | ALGO | 0.999824 | 4.468955 |
844a4e19-1726-411e-82e4-8192d22ff72f | daeunchung/cplusplus | boj10951입출력.cpp | #include <iostream>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int A, B, T;
while (cin >> A >> B) {
cout << A + B << '\n';
}
return 0;
} | ALGO | 0.999272 | 4.631736 |
a0a5d785-72ab-4f19-bd8d-efc8db321c15 | dfbrasil/CPP | AtividadesIF/Lista5/l5q8.cpp | //ler 15 num saber se tem repetido e em qual posição
#include <iostream>
using namespace std;
int main(){
int m, teste;
bool igual = false;
int vet[15];
for (int i = 0; i < 15; i++){
cout << "\nDigite um número pra inserir no vetor: ";
cin >> m;
vet[i] = m;
}
for (int... | ALGO | 0.985126 | 4.153891 |
c9a2281f-1090-46c3-b428-11112088c469 | Armijosluis/-Taller-de-Programaci-n-en-C- | Ejercicios/7.Suma de una serie aritmética/do while.cpp | #include <iostream>
int main() {
int n;
int suma = 0;
// Solicitar al usuario el número de términos
std::cout << "Ingrese el numero de terminos: ";
std::cin >> n;
// Calcular la suma de la serie aritmética y mostrar cada término
std::cout << "Suma de la serie aritmetica: ";
int i = 1;... | ALGO | 0.999343 | 4.352065 |
d9e50ef2-a9e7-4e93-b7b6-845d735c41b1 | MohammadRaziei/alglib | src/integration.cpp | #ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include "stdafx.h"
#include "integration.h"
// disable some irrelevant warnings
#if (AE_COMPILER==AE_MSVC) && !defined(AE_ALL_WARNINGS)
#pragma warning(disable:4100)
#pragma warning(disable:4127)
#pragma warning(disable:4611)
#pragma warning(disable:4702)
#pragma... | ALGO | 0.999623 | 6.042985 |
b8d386f7-a2af-4498-b876-bc359dc204b2 | CodingRohanX/C- | 15 Pair/2.cpp | /* Difference b/w a pair & Map is that Map has a unique key, were pair is just a
collection of 2 int int (or any other variable).*/
#include<iostream>
#include <utility> // for Pair
using namespace std;
int main(){
// Initialization
//1.
pair<int, int> p;
//2.
pair<int, int> p(1, 2); // p.... | TOOL | 0.909266 | 4.607424 |
eb907f78-af23-4200-8e01-cabddbdc259a | alsb1/co | bellman-p.cpp | #include <iostream>
#include <fstream>
#include <climits>
using namespace std;
class Edge{
protected:
int peso;
int s, f;
public:
Edge(int _s, int _f, int _p): s(_s), f(_f), peso(_p){}
int getPeso(){return peso;}
int getS(){return s;}
int getF(){return f;}
};
class Grafo{
protected:
int l... | ALGO | 0.999766 | 3.860105 |
ffb3a254-c880-4bda-b0ee-0f9d73f17bdc | DaeunOh/ALGORITHM | BOJ/[BFS, 2468] 안전 영역.cpp | /*
시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 26707 9861 6642 33.735%
문제
재난방재청에서는 많은 비가 내리는 장마철에 대비해서 다음과 같은 일을 계획하고 있다.
먼저 어떤 지역의 높이 정보를 파악한다.
그 다음에 그 지역에 많은 비가 내렸을 때 물에 잠기지 않는 안전한 영역이 최대로 몇 개가 만들어 지는 지를 조사하려고 한다.
이때, 문제를 간단하게 하기 위하여, 장마철에 내리는 비의 양에 따라 일정한 높이 이하의 모든 지점은 물에 잠긴다고 가정한다.
어떤 지역의 높이 정보는 행과 열의 크기가 각각 N... | ALGO | 0.99975 | 5.330751 |
9ae4d784-8a0a-476d-86a5-03454aa394c5 | godnoTA/acm.bsu.by | 1. Деревья поиска/20 #859/[OK]210572.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <ctime>
using namespace std;
class Tree;
class Node
{
private:
int data;
Node *left;
Node *right;
int height;
int depth;
int level;
int max_halfpath_length;
public:
friend Tree;
Node() { data = 0; left = 0; right = 0; height = -1; depth = -1... | ALGO | 0.989351 | 3.380373 |
3a48e7cf-3467-4545-9a20-f88fc0a414ad | seaworld0125/boj-training-old | 배열/2841 copy.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N, P, n, p, A=0;
cin >> N >> P;
vector<vector<int>> arr(10, vector<int>(0, 0));
for(int i = 0; i < N; i++){
cin >> n >> p;
while(arr[n].back() > p && !arr[n].empty()){
arr[n].pop_back(); A++;
... | ALGO | 0.999396 | 3.62009 |
22bc7c37-5ca3-4801-a8d3-7a00cb3cbf4c | ArijitWayne/Algorithms | Math/3_Sum_square_complexity/findtriplets.cpp | #include<bits/stdc++.h>
#include<tr1/unordered_set>
#include <string>
#include <sstream>
namespace patch
{
template < typename T > std::string to_string( const T& n )
{
std::ostringstream stm ;
stm << n ;
return stm.str() ;
}
}
using namespace std;
struct triplet{
int first, seco... | ALGO | 0.998001 | 4.498672 |
2d59c112-6545-4135-be7b-513ada7be461 | lattice0/juce_audio_graph_tutorial_android | juce-6.0.8-linux/JUCE/modules/juce_box2d/box2d/Dynamics/Contacts/b2CircleContact.cpp | #include "b2CircleContact.h"
#include "../b2Body.h"
#include "../b2Fixture.h"
#include "../b2WorldCallbacks.h"
#include "../../Common/b2BlockAllocator.h"
#include "../../Collision/b2TimeOfImpact.h"
#include <new>
using namespace std;
b2Contact* b2CircleContact::Create(b2Fixture* fixtureA, int32, b2Fixture* fixtureB, ... | ALGO | 0.943834 | 6.864361 |
c5c349a7-b8db-4f9f-a1ee-8175c0c35234 | namansukhwani/C-CPP-Campus-Practice | programs/grades30.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int grade;
cin>>grade;
if(grade<40){
cout<<"FAILED";
}
else if(grade>=40 && grade<50){
cout<<"THIRD";
}
else if(grade>=50 && grade<60){
cout<<"SECOND";
}
else{
cout<<"FIRST";
}
return 1;... | ALGO | 0.997697 | 4.10957 |
b0f29427-27cc-4ee3-a2df-2ce2ee524f78 | Mikeflames/Algorithms | NetWork delay time.cpp | //Djilstra's Algo
class Solution {
typedef pair<int, int> pi;
public:
int networkDelayTime(vector<vector<int>>& times, int n, int k) {
vector<int > cost (n+1,INT_MAX) ;
cost[k] = 0 ;
vector<pi> adj[n+1] ;
int u, v , w ;
for(int i =0 ; i < times.size() ; i++)
... | ALGO | 0.999951 | 5.552871 |
b8602947-bcc5-49f8-9883-02b7d5b48a87 | santu-dhali/DSA-Practice | 230-kth-smallest-element-in-a-bst/kth-smallest-element-in-a-bst.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.999997 | 5.916773 |
c83c9b23-5f99-4e2f-b6a6-5acc19eb5868 | szymmirr/Contests | SPOJ/ITS/ITS3/tests/MWP7_1L-test.cpp | #define CATCH_CONFIG_MAIN
#include "catch.hpp"
#include <iostream>
#define main __real_main
#include "../MWP7_1L.cpp"
#undef main
std::string INPUT_1 = "5\n3 5 1 2 1 3 3 3 2 6 8 2 2 2 2\n";
std::string CORRECT_ANSWER_1 = "15\n1\n4\n12\n1\n";
std::string INCORRECT_ANSWER_1 = "0";
std::ostringstream capture_main_stdout... | TEST | 0.998782 | 4.148172 |
dc09d53e-e75c-476b-a452-acebc3e6ef5b | prisma-lab/oscillation-suppression-in-cable-suspended-robots | src/licas/modelBasedControlLicas_v2.cpp | #include "cable_suspended_robotics/modelBasedControlLicas_v2.hpp"
#include "cable_suspended_robotics/utils.hpp"
#include "cable_suspended_robotics/dynamicModel.hpp"
MODEL_BASED_CONTROLLER::MODEL_BASED_CONTROLLER() {
_gazeboClockSub = _nh.subscribe("/clock",0,&MODEL_BASED_CONTROLLER::gazeboClockCB,this); ... | TOOL | 0.990514 | 4.45589 |
d5bbe631-204d-4ac1-af4c-daec2b57f7db | Young-Jang/algorithm_c- | Project1/Project1/두동전.cpp | #include<iostream>
#include<queue>
using namespace std;
struct pos {
int x1, y1;
int x2, y2;
int cnt;
};
char map[20][20];
int posX[4] = { 0,1,0,-1 };
int posY[4] = { -1,0,1,0 };
int check[20][20][3];
int n, m;
int res = 0;
queue<pos> q;
void bfs()
{
while (!q.empty())
{
int x1 = q.front().x1;
int y1 = q.f... | ALGO | 0.999909 | 4.034985 |
2ca599d8-fc4e-4267-9011-e55f18fa842a | Shubhamsahu1101/cpp | D_Three_Activities.cpp | #include <bits/stdc++.h>
#define forall(it, cont) for (auto it = cont.begin(); it != cont.end(); it++)
#define forl(i, a, b) for (int i = a; i < b; i++)
#define forr(i, a, b) for (int i = a; i >= b; i--)
#define int long long
#define pb push_back
#define M 1000000007
#define yes cout << "YES" << endl
#define no cout <<... | ALGO | 0.999641 | 4.373668 |
56c38fa1-53b3-45ea-9f08-a8e5e248f837 | RichieDatalyst/Semester-Work | PF/PF-1/Appetizer(a) Array.cpp | #include <iostream>
using namespace std;
void cin_Array(int arr[],int n){
for(int i=0;i<n;i++){
cin>>arr[i];
}
}
int main(){
int n,arr[n];
cout<<"ENTER THE SIZE OF ARRAY : ";
cin>>n;
cin_Array(arr,n);
return 0;
}
| ALGO | 0.908128 | 3.18894 |
e92f42f8-c7e5-479c-b2b3-cb550a3d6b97 | siddharth908singh/sem2lab4 | lab4.q1d.cpp | #include<iostream>
using namespace std;
class QueueArr{
int ar[50];
int count;
public:
QueueArr(){
count=0;
}
void enqueue(int val);
void dequeue();
void display();
};
void QueueArr::enqueue(int val){
if (count>50){
cout<<"OVERFLOW!!,CANNOT INSERT ANYMORE VALUES DUE TO LACK OF SPACE";
}
else{
ar[cou... | ALGO | 0.997693 | 4.534018 |
f93acfd4-0f14-4b42-8b03-131968afbba3 | vaishnaviselvaraj05/LeetCode | 349-intersection-of-two-arrays/intersection-of-two-arrays.cpp | class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
vector<int>res;
for(int i=0;i<nums1.size();i++){
for(int j=0;j<nums2.size();j++){
if(nums1[i]==nums2[j]){
if(!exists(res,nums1[i])){
res... | ALGO | 0.999832 | 5.584154 |
3de6778b-866f-4928-bb33-f407a7a0d93e | jimmy947788/zygisk-florida-gadget | src/libcxx/test/std/algorithms/alg.nonmodifying/alg.find/find.pass.cpp | // <algorithm>
// template<InputIterator Iter, class T>
// requires HasEqualTo<Iter::value_type, T>
// constexpr Iter // constexpr after C++17
// find(Iter first, Iter last, const T& value);
#include <algorithm>
#include <cassert>
#include "test_macros.h"
#include "test_iterators.h"
#if TEST_STD_VER > 17
TE... | TEST | 0.979783 | 6.902922 |
a3454e6a-9ea1-4035-8991-ef994ed8ad23 | shaan372/Atcoder | N_-_Slimes.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define ppb pop_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define prDouble(x,y) cout << fixed << setprecis... | ALGO | 0.999982 | 4.17841 |
55d160a2-92a0-44ef-ad5d-8ae0456e30c2 | WaderManasi/Knowing-DataStructures-Algorithms | Array/FirstRepeatingElement.cpp | // Given an array arr[] of size N, find the first repeating element. The element should occurs more than once and the index of its first occurrence should be the smallest.
//Solution:
int firstRepeated(int arr[], int n) {
for(int i=0;i<n;i++)
{
if(count(arr,arr+n,arr[i]) > 1)
return i+1;
}
re... | ALGO | 0.999756 | 5.023499 |
c8cad084-c0f0-4d9d-b837-682d210cb930 | jumeike/gem5-smt-exp | gem5-vanilla/src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage3.cpp | /*****************************************************************************
stage3.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.999495 | 4.191345 |
d83d152a-eabb-431c-8ce7-051835954865 | dirkneuhaeuser/exercise-problems | number_theory/gcd_lcm/UVa10892_lcm_cardinality.cpp | #include"bits/stdc++.h" // using "" instead of <>, so it will search locally for the precompiled version first
using namespace std;
// 2**6 = 64
// 2**8 = 256
// 2**10 = 1,024
// 2**15 = 32,768
// 2**20 = 1,048,576
// 2**25 = 33,554,432
// 2**30 = 1,073,741,824
// 2**32 = 4,294,967,296
// int up to 2*10^9 (2^31-1... | ALGO | 0.999224 | 4.434406 |
d21d2ee2-eeb4-47f9-a8fc-d63cefc14891 | jihye032/thesis__virtual_camera | BaseLib/Motion/func.cpp |
#include <vector>
#include <fstream>
#include "ml.h"
#include "common.h"
using namespace ml;
double ml::DiffPosture( const Posture& p1, const Posture& p2 )
{
double ret_error = 0.;
for(size_t i = 0; i < p1.body()->num_joint(); ++i) {
ret_error += (p1.GetGlobalTranslation(i) - p2.GetGlobalTranslation(i)).length_s... | ALGO | 0.99525 | 3.917052 |
5946b257-1304-4727-81ae-bfc910061427 | PaukIsUha/optimizing_formating_code | predictions/full_output_predicted_submissions/Codenet/p00523/370783768/improved.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long int64;
const int64 INF = 1LL << 58;
int N, A[200000];
int64 sum[200000];
bool Find(const int &pos, const int64 &size) {
int hoge = distance(
sum, lower_bound(sum + pos + 1, sum + N + pos + 1, sum[pos] + size));
if (hoge == N + pos + 1)
return... | ALGO | 0.999912 | 4.466246 |
c76e039c-7aca-4a57-a689-e1cc71c07815 | LoadingSugar/HDU2 | catalan.cpp | #include<stdio.h>
//f(n)=f(0)*f(n-1)+f(1)*f(n-2)+f(2)*f(n-3)...+f(n-1)*f(0)
int catalan(int x){
if(x<2)return 1;
else return catalan(x-1)*(4*x-2)/(x+1);
}
long catalan2(int x){
if(x<2)return 1;
long *h=new long[x+1];
h[0]=h[1]=1;
for(int i=2;i<=x;i++){
h[i]=0;
for(int j=0;j<i;j++)
h[i]+=h[j]*h[i-1-j];
}
... | ALGO | 0.999941 | 3.26291 |
e21c7632-bca9-4875-bad3-f1bb1b27b1a7 | puja2196/LLVM-tutorial | lldb/source/Host/common/HostInfoBase.cpp | #include "lldb/Host/Config.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostInfoBase.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/ADT/S... | TOOL | 0.920013 | 7.137581 |
32f4b779-762e-4bb5-b923-ac104a635e4d | srshoruv/binary-trees | subTreeChecker.cpp | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
int data;
Node* left;
Node* right;
Node(int data){
this->data = data;
left = right = NULL;
}
};
static int idx = -1;
Node* buildTrees(vector<int> nodes) {
idx++;
if (nodes[idx] == -1) {
... | ALGO | 0.999938 | 5.568928 |
3d4c3e0d-b7b4-4767-972d-451df7b136e1 | avinash-ducs/Algorithms | Section A/Q1.cpp | #include<iostream>
#include<limits.h>
using namespace std;
int main()
{
/*
description: driver function to calculate minimum matrix multiplications required to multipy n matrices
variables used: -> num_matrix-number of matrices to be multiplied
-> p-dimension array
-> i-used for iterating
-> ele-used to t... | ALGO | 0.999621 | 3.505268 |
2a3557c0-3d54-4125-bd6b-9a21f376680b | cymcarlos/otp | erts/emulator/beam/jit/arm/instr_msg.cpp | #include "beam_asm.hpp"
extern "C"
{
#include "bif.h"
#include "code_ix.h"
#include "erl_proc_sig_queue.h"
#ifdef USE_VM_PROBES
# include "dtrace-wrapper.h"
#endif
}
#ifdef ERTS_SUPPORT_OLD_RECV_MARK_INSTRS
static void recv_mark(Process *p) {
/* inlined here... */
erts_msgq_recv_marker_insert_bind(p, erts... | TOOL | 0.900573 | 6.24951 |
4126d349-e17c-46ff-8506-62566bfe5e4c | clausjensen/mq | MQ2Main/MQ2DetourAPI.cpp | // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT 0x510
#define DIRECTINPUT_VERSION 0x800
#if !defined(CINTERFACE)
#error /DCINTERFACE
#endif
#define DBG_SPEW
#include "MQ2Main.h"
#ifndef ISXEQ
typedef struct _OurDetours {
/* 0x00 */ unsigned int addr;
/* 0x04 *... | TOOL | 0.861464 | 4.518239 |
8aa7078b-6a6b-465e-a35f-366a298f712a | azizamurod/flutter-va-dart-mobil-dasturlash-kursi | 14-expense-tracking-app/14.18/expense_pro/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.997747 | 6.776823 |
317fdbdc-1a70-4763-a661-b4ed3b1102ce | clairad/wenduzhilian | CZ-1C++3班/Linuxday4-10月28日-基础文件IO2/10月28日代码/Linuxday4-10月28日-基础文件IO2/Linuxday4-10月28日-基础文件IO2/main.cpp | #include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
using namespace std;
string getKey(const string& path, const string& num)
{
int pos = path.rfind('\\');
string res;
pos++;
if (path.size() - pos <= 16)
{
res = path.substr(pos);
}
else
{
res = path.substr(path.size() - 16);
}... | ALGO | 0.996656 | 4.275933 |
d8e5f3d9-9f31-4fc6-b5e7-aadf028c96c9 | wasit-shafi/hands-on-DSA-and-CP | c++/printAllPossibleSubStrings.cpp | //
//printAllPossibleSubStrings.cpp
//
//program to print all possible sub-strings of a given string.
//
#include<iostream>
using namespace std;
int main()
{
int n;
string str;
cout << endl << "Enter string : ";
getline(cin, str);
n = str.length(); // now we don't have to recalculate string len... | ALGO | 0.871637 | 3.922495 |
6388b157-84e8-4d51-818d-5bccab3d42d3 | Ryb7532/pipedream | sa/image_classification/cpp/vgg16_2_4_theory_hybrid.cpp | #include <iostream>
#include <sstream>
#include <stdlib.h>
#include <sys/time.h>
#include <mpi.h>
using namespace std;
double get_elapsed_time(struct timeval *begin, struct timeval *end)
{
return (end->tv_sec - begin->tv_sec) * 1000000
+ (end->tv_usec - begin->tv_usec);
}
int main(int argc, char *argv[])
{
s... | TOOL | 0.928523 | 4.699573 |
5df8e258-1ba2-4af7-9bb3-1a78710f4e4f | shashvatms/Leetcode-Questions | 0151-reverse-words-in-a-string/0151-reverse-words-in-a-string.cpp | class Solution {
public:
string reverseWords(string s) {
istringstream stream(s);
string word;
vector<string> res;
while(stream >> word){
res.push_back(word);
}
reverse(res.begin(),res.end());
string result="";
for(int i=0;i<res.size();i++)... | ALGO | 0.999916 | 6.290219 |
0b3bb74b-cc5d-40ee-b021-929ac3a2a12b | danielfelipe-df/Hospital_AM | res/code.cpp | #include <iostream>
#include <algorithm>
#include <other_CSV.h>
int main(void)
{
std::vector<std::string> names;
read_directory("Data/", names);
std::sort(names.begin(), names.end());
names.erase(names.begin() + 0);
names.erase(names.begin() + 0);
names.erase(names.begin() + 0);
std::vector<std::vecto... | DATA | 0.969749 | 3.660815 |
aba5fbf1-4088-4702-8864-231eda9ac6e1 | Eeman1113/Leetcode | Problems/1929.cpp | class Solution {
public:
int colorTheGrid(int m, int n) {
this->m = m;
this->n = n;
return dp(0, 0, 0, 0);
}
private:
static constexpr int kMod = 1'000'000'007;
int m;
int n;
vector<vector<int>> mem = vector<vector<int>>(1000, vector<int>(1024));
int dp(int r, int c, int prevColMask, int c... | ALGO | 0.998352 | 6.286223 |
9dd97b7a-80b2-414a-903b-6396b86112b9 | zain2703/Kattis | Polish.cpp | #include <bits/stdc++.h>
#include<sstream>
#include<string>
//#include<ctype.h>
//#include<iostream>
// For debuging
using namespace std;
void printVector(vector<string> vec)
{
cout << "Vector: ";
for (auto x : vec) {
cout << x << " ";
}
cout << endl;
}
void ReverseVector(vector<str... | ALGO | 0.999797 | 4.322838 |
245c3b58-512d-4689-b074-6491d5bcc1e8 | VelociRoughtor/Repeat | False_Position.cpp | #include<bits/stdc++.h>
using namespace std;
class FalsePosition{
private:
double tolerance, a, b;
int maxIteration;
public:
FalsePosition(int mxItr, double tol) {
tolerance = tol;
maxIteration = mxItr;
generateRandom();
}
double func(double x) {
return x * x * x -... | ALGO | 0.999954 | 4.902326 |
76ec5293-8ec4-47f7-88fe-81484e04435b | KwonHyeokGyu/opencv_study | ch8/Harris2.cpp | //#include <iostream>
//#include <vector>
//#include <opencv2/core/core.hpp>
//#include <opencv2/imgproc/imgproc.hpp>
//#include <opencv2/highgui/highgui.hpp>
//using namespace cv;
//
//class HarrisDetector {
//private:
// // ڳ 32Ʈ εҼ
// Mat cornerStrength;
// // ȭ ڳ 32Ʈ εҼ
// Mat cornerTh;
// // ִġ ()
// Mat local... | ALGO | 0.991775 | 4.891936 |
531e6dcb-552e-4dde-b1c9-f39c9ca060f1 | boss11887/CPP | เรียนรู้/dynamic/rod_cutting.cpp | #include <bits/stdc++.h>
using namespace std;
int val[1000005];
int dp[1000005];
int high=INT_MIN;
int re(int now){
if(now==0){
return 0;
}
if(dp[now] != 0){
return dp[now];
}
int num;
for(int a=1;a<=now;a++){
num=val[a]+re(now-a);
dp[now]=max(dp[now],num);
}... | ALGO | 0.999871 | 3.462286 |
daecda87-a641-4571-939e-37492587e72e | Shell-Wataru/AtCoder | GCJ/google2022_qualification/B.1.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <map>
using namespace std;
using ll = long long;
string result(vector<ll> Rs){
ll results[6];
ll base52 = (1LL<<52);
ll base42 = (1LL<<42);
ll base35 = (1LL<<35);
ll base21 = (1LL<<21);
ll base14 = (1LL<<14);
... | ALGO | 0.999652 | 3.774933 |
e5e186d0-1ca0-4ecf-b043-9004662b0d57 | enochii/leetcode-solution | 530.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// 530. Minimum Absolute Difference in BST
//中序遍历
//从左边向上回溯要把值往上传!所以用 reference
class Solution {
int ans;
public:
in... | ALGO | 0.999991 | 6.624971 |
e9e61575-211c-4d61-a9d6-957cf14cd864 | Owen230/EulerProblems | 3.cpp | /*
The prime factors of 13195 are 5,7,13 and 29.
What is the largest prime factor of the number 600851475143?
The 569095th person to have solved problem 3.
*/
#include <iostream>
using namespace std;
long Factor(long x, int y){
if(x > 0 ){
while((x%y)==0){
cout << x << "%" << y << " -> " << ... | ALGO | 0.999752 | 4.929435 |
05a683e3-0c28-47bf-918e-e19f867d7d2c | Ajiperuyellow/IPGLAMPS | lib/branches/initialStateLib/src/vegas.cpp | //------------------------------------------------------------------------------------------
//provided by subversion
//------------------------------------------------------------------------------------------
//$HeadURL: file:///home/bamps/svn/lib/branches/initialStateLib/src/vegas.cpp $
//$LastChangedDate: 2013-10-2... | ALGO | 0.999359 | 4.645943 |
89969a55-4770-4766-9eaf-66f22dcef6fb | sangwookShin/AlgorithmStudy | BOJ/practice1/BOJ 11053.cpp | #include <iostream>
using namespace std;
int N;
int A[1000];
int dp[1000] = { 1, };
void solve() {
for (int i = 1; i < N; i++) {
int min = 0;
for (int j = 0; j < i; j++) {
if (A[i] > A[j] && min <= dp[j]) {
min = dp[j];
}
}
dp[i] = min + 1;
}
int result = 0;
for (int i = 0; i < N; i++) {
... | ALGO | 0.999979 | 4.761511 |
f41d839c-e0f3-4256-b16f-45fff5997707 | shrutiramdurg/Strivers-A2Z-Sheet | Linked Lists/Easy/Find the Middle of a Linked List.cpp | /*
Definition of singly linked list:
struct ListNode
{
int val;
ListNode *next;
ListNode()
{
val = 0;
next = NULL;
}
ListNode(int data1)
{
val = data1;
next = NULL;
}
ListNode(int data1, ListNode *next1)
{
val = data1;
next = next1;... | ALGO | 0.999915 | 5.719373 |
4c124acf-d54e-4105-b75b-562058b70222 | kosakowski/OGS6-MP-LT-Drum | MeshGeoToolsLib/MeshNodesOnPoint.cpp | #include "MeshNodesOnPoint.h"
#include "MeshLib/Mesh.h"
namespace MeshGeoToolsLib
{
MeshNodesOnPoint::MeshNodesOnPoint(MeshLib::Mesh const& mesh,
GeoLib::Grid<MeshLib::Node> const& mesh_grid,
GeoLib::Point const& pnt,
... | ALGO | 0.947057 | 6.872038 |
235bdd0b-fd3b-4038-8918-8c5cdbfcd47a | sarahorsak/STRUMPACK | src/sparse/fronts/FrontalMatrixCUBLAS.cpp | #include "FrontalMatrixCUBLAS.hpp"
#include "dense/CUDAWrapper.hpp"
#if defined(STRUMPACK_USE_MPI)
#include "ExtendAdd.hpp"
#include "FrontalMatrixMPI.hpp"
#endif
namespace strumpack {
template<typename scalar_t,typename integer_t> class FrontalMatrixCUBLAS;
template<typename scalar_t, typename integer_t> class L... | TOOL | 0.997858 | 5.869948 |
66004664-543a-49d7-a2be-654e90667286 | ishandutta2007/codeforces | coderanshu/normal/1499/F.cpp | // Har Har Mahadev
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define sz(a) (ll)a.size()
#define F first
#define S second
#define INF 2000000000000000000
... | ALGO | 0.999942 | 4.531273 |
2b1d9536-3ed0-4545-8523-fe2cfaf361ec | ds-umass/GraphMini | GraphMini/dependency/oneTBB/examples/graph/cholesky/cholesky.cpp | #include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <tuple>
#include "mkl_lapack.h"
#include "mkl.h"
#include "oneapi/tbb/flow_graph.h"
#include "oneapi/tbb/tick_count.h"
#include "oneapi/tbb/global_control.h"
// Application command line arguments parsin... | ALGO | 0.999664 | 5.971964 |
2d70d075-3131-4946-94d9-8fde5a1120b3 | Shuvro-d/Codeforces | Vasya and Hipster.cpp |
#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
int x,y,m,n;
if(a<b){
m=a;
n=b;
}
else{
m=b;
n=a;
}
x=m;
if((n-m)>=2){
y=(n-m)/2;
}
else{
y=0;
}
printf("%d %d\n",x,y);
return 0;
}
| ALGO | 0.999954 | 3.208657 |
c0644b02-80d7-41fc-98e0-71d976a2a12f | oms01/ProblemSolving | 프로그래머스/unrated/181900. 글자 지우기/글자 지우기.cpp | #include <string>
#include <vector>
using namespace std;
string solution(string my_string, vector<int> indices) {
string answer = "";
vector<bool> tmp(my_string.length());
for(int i=0;i<indices.size();i++){
tmp[indices[i]] = 1;
}
for(int i=0;i<my_string.length();i++){
if(!tmp[i]) a... | ALGO | 0.999872 | 5.431328 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.