uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
949ca811-7905-47a4-9799-410c8d0321fb | algorithmstudy4/sw_test | s_coding/2606_바이러스.cpp | #if 01
//바이러스
//https://www.acmicpc.net/problem/2606
#include <iostream>
#include <queue>
#include <string>
using namespace std;
#define MAX 100
int com, N; // 컴퓨터 수 , 연결된 네트워크 쌍의 수
int adj[MAX + 10][MAX + 10];
int visited[MAX + 10];
int cnt;
void DFS(int start) { //재귀
visited[start] = 1;
for (int i = 1; i <= co... | ALGO | 0.999733 | 4.907601 |
ed65753a-9133-49f9-b4f8-1d0749f1463f | TTSS0529/leetcode-practice-in-cpp | cpp/dynamic_programming/0070_climbing_stairs/brute_force.cpp | #include "climbing_stairs.hpp"
int Solution::climbStairs(int n) {
long long dp0 = 1, dp1 = 1, dpi;
for (int i = 0; i < n; ++i) {
dpi = dp0 + dp1;
dp0 = dp1;
dp1 = dpi;
}
return dp0;
} | ALGO | 0.999994 | 5.365372 |
12d19548-22aa-429b-87ff-05da21a48058 | milanow/LeetCodePractice | 500+/520_Detect_Capital.cpp | /* 520. Detect Capital
* Count the number of capital letters, checking if it belongs to one of the rules
* of being a valid one
*/
class Solution {
public:
bool detectCapitalUse(string word) {
int capnum = 0;
for(int i = 0; i < word.length(); i++){
if(word[i] < 'a') capnum++;
... | ALGO | 0.999895 | 5.885494 |
1d4791fd-dff1-4702-aa73-0771115925a3 | Zain4391/DSA | anagram.cpp | #include<iostream>
#include<algorithm>
#include<string>
using namespace std;
bool isAnagram(string s, string t)
{
if(s.length() != t.length())
{
return false;
}
sort(s.begin(),s.end()); //sort the first string
sort(t.begin(),t.end()); //sort the secong string
return s == t;
}
int main... | ALGO | 0.999771 | 5.471288 |
4c3f25db-8f94-4504-997c-5db8a1af7ad9 | salepape/plenoptic-camera-rendering | source/core/shape/polynomial.cpp | //******************************************************************************
///
/// @file core/shape/polynomial.cpp
///
/// Implementation of the 3-variable polynomial geometric primitive.
///
/// @author Alexander Enzmann
///
/// @copyright
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') versio... | ALGO | 0.999263 | 4.379519 |
b5d40662-2ad4-4068-998f-12a55efb168d | rajeevloghade/DSA_CPP | Pattern Questions/Pattern_10.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cout << "Enter n: ";
cin >> n;
int i = 1, j;
while (i <= n)
{
j = 1;
while (j <= i)
{
cout << i - j + 1 << " ";
j++;
}
cout << endl;
i++;
}
}
/**
1
2... | ALGO | 0.999731 | 3.887668 |
d3a2812c-647a-4949-b08b-34b30f9ebaea | pfrego/CSC-121---Paul-Fregoso | mainoops.cpp | #include <iostream>
#include <vector>
#include "remove_duplicates.h"
using namespace std;
int main() {
vector<int> my_vector = {1, 1, 2, 2, 3, 3, 4, 4, 5, 5};
vector<int> filtered_vector = remove_duplicates(my_vector);
cout << "Filtered vector: ";
for (int num : filtered_vector) {
cout ... | ALGO | 0.990755 | 5.733965 |
063dc661-8473-4fee-a810-5e1f106b050e | himanshu864/DSA_CPP | Greedy/BurstBallon.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// We need to pop all balloons with mini arrows
// So basically we can pop all overlapping points in sorted order, one by one
// Hence we need to iterate through each balloons in a sorted manner
// find all following balloons that overlap ... | ALGO | 0.999765 | 6.355405 |
df2b9cee-2305-4df2-92b6-f1a41406609f | dinukaamarasinghe817/cp | 8weeks/week5/hogwards.cpp | // Link to the problem statement : https://www.hackerrank.com/contests/acm-8-weeks-of-code-week-05/challenges/hogwarts-3
#include <bits/stdc++.h>
using namespace std;
void solve() {
int t;
cin >> t;
while(t--){
string spell;
cin >> spell;
getchar();
int n = spell.length();
... | ALGO | 0.999706 | 4.583875 |
f82d8c27-02fb-4eb9-b804-173548488f56 | Kavin1421/Leetcode-Solution | 1700-1799/1733.Minimum Number of People to Teach/Solution.cpp | class Solution {
public:
int minimumTeachings(int n, vector<vector<int>>& languages, vector<vector<int>>& friendships) {
unordered_set<int> s;
for (auto& e : friendships) {
int u = e[0], v = e[1];
if (!check(u, v, languages)) {
s.insert(u);
s.i... | ALGO | 0.999777 | 5.634054 |
c5672f7e-0e7e-4969-9032-c0c379460c85 | quethaibinh/code_ptit_DSA | Th_bai7.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
int n, k;
int a[100005];
string sc;
set<string> v;
void tryy(int i, int bd){
for(int j = bd; j < s.size(); j ++){
sc.push_back(s[j]);
if(i == k) v.insert(sc);
else tryy(i + 1, j + 1);
sc.pop_back();
}
}... | ALGO | 0.999848 | 4.419512 |
5f9cde9f-eae4-4c65-85b7-79a488209dda | thiru31/daily-coding | college wallah/Linkedlist/merge-2-sorted-ll.cpp | #include <bits/stdc++.h>
using namespace std;
class node
{
public:
int val;
node *next;
node(int data)
{
val = data;
}
};
class linkedlist
{
public:
node *head;
linkedlist()
{
head = NULL;
}
void insert(int val)
{
node *temp = head;
node *new... | ALGO | 0.999865 | 4.467284 |
11f0f6c9-42c7-4179-bb94-2ceef11d0eee | samshad/UVa | 10082 - WERTYU.cpp | /// Name: Md. Samshad Rahman
/// Prob: 10082 - WERTYU
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cctype>
#include <string>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <sstream>
#include <bit... | ALGO | 0.9971 | 3.009555 |
60f04b59-0149-43f5-9871-7674cef6e95b | mikerainey/taskparts | benchmark/tpal/sum_array.cpp | #include "taskparts/nativeforkjoin.hpp"
#ifndef TASKPARTS_TPALRTS
#error "need to compile with tpal flags, e.g., TASKPARTS_TPALRTS"
#endif
#include <taskparts/benchmark.hpp>
void sum_array_heartbeat(double* a, uint64_t lo, uint64_t hi, double r, double* dst);
/* Handler functions */
/* ================= */
void sum_... | ALGO | 0.984315 | 6.240907 |
552ba9fd-d1bf-49ba-ad7b-e44c5076ebf0 | itsdharmxd/CPPcodechef | STL c++/upper_lowwer_Binary.cpp |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(a, b, c) for (ll a = b; a < c; a++)
#define repr(a, b, c) for (ll a = b; a >= c; a--)
#define fst first
#define snd second
#define pb push_back
#define pii pair<ll,ll>
#define vi vector<ll>
#define all(c) ((c).begin()), ((c).end())
#defi... | ALGO | 0.999753 | 4.783053 |
122b826f-da77-434b-b7dc-f607e344ac98 | rayzh0v0/AlgorithmCamp | algorithm025/week08/191-number-of-1-bits.cpp | class Solution {
public:
bool isPowerOfTwo(int n) {
return n > 0 && (n & (n - 1)) == 0;
}
}; | ALGO | 0.999498 | 6.544011 |
3f92359c-eee7-4a06-a7d4-c597edc802aa | JNXSTJ/games202_ | Assignment2/prt/src/perspective.cpp | #include <nori/camera.h>
#include <nori/rfilter.h>
#include <nori/warp.h>
#include <Eigen/Geometry>
NORI_NAMESPACE_BEGIN
/**
* \brief Perspective camera with depth of field
*
* This class implements a simple perspective camera model. It uses an
* infinitesimally small aperture, creating an infinite depth of field... | TOOL | 0.986071 | 7.633757 |
a3f47066-674d-4231-ab96-79eb2fb83b86 | taronegeorage/AlgorithmTraining | Linked List/4.Swap Nodes in Pairs/solution3.cpp | ListNode* swapPairs(ListNode* head) {
auto dummy = new ListNode(0);
dummy->next = head;
for(auto pre = dummy; pre->next && pre->next->next;) {
auto a = pre->next, b = a->next;
pre->next = b;
a->next = b->next;
b->next = a;
pre = a;
... | ALGO | 0.999949 | 5.398946 |
288808c4-6836-4f80-b0a7-c43e784c37ef | Chetansbandurkar/DSA_PRACTICE | DP/2370. Longest Ideal Subsequence.cpp | class Solution {
public:
int solve(string&s, int pr, int& k, int ind, vector<vector<int>>& dp) {
if (ind >= s.size())
return 0;
if (dp[ind][pr+1] != -1)
return dp[ind][pr+1];
int inc = 0;
if (pr == -1 || abs(pr - (s[ind] - 'a')) <= k)
inc = 1 + sol... | ALGO | 0.999944 | 5.311837 |
a472a8fc-ea6b-498e-bb24-cd609513ea99 | MaheenHabib/Practice-Qs | PF pyramid.cpp | #include <iostream>
using namespace std;
int main()
{
int i, j;
for(i=1; i<=5; i++)
{
for(j=9; j>=(2*i-1); j--)
{
cout << "*";
}
cout<<endl;
}
return 0;
}
| ALGO | 0.999707 | 3.254204 |
61d20d28-ba56-4aee-98d5-1ed92d6c6287 | ishandutta2007/codeforces | heart_blue/normal/1687/B.cpp | #include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bi... | ALGO | 0.999985 | 3.110188 |
c09b19aa-5e65-459d-a8db-2c3ca51a33c7 | cloudysman/C_Programming_PTIT | C01026_So_Nguyen_To.cpp | #include <stdio.h>
#include <math.h>
int isPrime(int n) {
if (n <= 1) return 0;
if (n <= 3) return 1;
if (n % 2 == 0 || n % 3 == 0) return 0;
for (int i = 5; i * i <= n; i = i + 6)
if (n % i == 0 || n % (i + 2) == 0)
return 0;
return 1;
}
int main() {
int t;
scanf("%... | ALGO | 0.999724 | 5.422797 |
483cf6ca-32b9-4cf0-a69f-957407fdaebd | raincross7/code-similarity | codes/train_code/problem181/problem181_210.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1001001001;
const ll mod = 1000000007;
int main(){
ll k, a, b; cin >> k >> a >> b;
ll ans = 0;
if(a + 1 >= b){
cout << k + 1 << endl;
return 0;
}
else{
if(k <= a){
cout << 1 + k <... | ALGO | 0.999918 | 3.393992 |
bcee82f5-42ed-462e-b98f-de5c2f52dd33 | PootieT/explain-then-translate | CodeGenMirror/data/transcoder_evaluation_gfg_fixed/cpp/PROGRAM_TO_FIND_THE_AREA_OF_PENTAGON.cpp | #include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
float f_gold ( float a ) {
float area;
area = ( sqrt ( 5 * ( 5 + 2 * ( sqrt ( 5 ) ) ) ) * a * a ) / 4;
return area;
}
//TOFILL
int main() {
int n_suc... | ALGO | 0.9855 | 4.138546 |
e902346d-e9e3-45de-a48b-e4664bf7f3b3 | sanchit-ahuja/cppcode | random.cpp | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int binarysearch(long long int arr[], long long int key, long long int n)
{
int low=0;
long long int high=n-1;
while(low<=high)
{
long long int mid=(low+high)/2;
if(arr[mid]<key)
low=mid+1;
else if(arr[m... | ALGO | 0.997086 | 4.272248 |
0cf76597-a8c5-4b9e-879e-94c52408ee63 | jaiminb2512/365-Days-of-Code | day_055/Sort a half-sorted array.cpp | #include <iostream>
#include <vector>
void merge(vector<int> &arr, int left, int mid, int right) {
int n1 = mid - left + 1;
int n2 = right - mid;
vector<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[mid + 1 + j];
... | ALGO | 0.999817 | 5.597563 |
dc23b978-a454-4bb3-963c-44b1a4a595bc | raden/KTAB | KTAB/kmodel/src/demoleon.cpp | #include "demoleon.h"
using KBase::PRNG;
using KBase::KMatrix;
using KBase::Actor;
using KBase::Model;
using KBase::Position;
using KBase::State;
using KBase::PCEModel;
using KBase::VotingRule;
using KBase::VPModel;
namespace DemoLeon {
const double TolIFD = 1E-6;
LeonActor::LeonActor(string n, string d, LeonMo... | ALGO | 0.99771 | 5.421703 |
141ee615-3a2b-40a9-84d7-46aedd3a9f8d | ankivStar/Data-Structure-and-Algorithms | 18__Hashmaps/02_remove_duplicate.cpp | #include <iostream>
using namespace std;
#include <unordered_map>
#include <string>
#include <vector>
vector<int> removeDuplicate(int* a, int size){
vector<int> output;
unordered_map<int, bool> seen;
for (int i = 0; i < size; i++){
if (seen.count(a[i]) > 0){
continue;;
}
... | ALGO | 0.999285 | 4.91079 |
20d03df9-8ec7-4966-944a-508c5112035d | SAF-Algorithm/SAF-Algorithm | week6/youbin/Boj1654.cpp | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void)
{
int K, N;
int tmp, result, q;
int arr[10001];
unsigned int left = 1, mid, right = 0;
cin >> K >> N;
for (int i = 0; i < K; i++) {
cin >> tmp;
arr[i] = tmp;
if (right <= tmp) right = tmp;
}
while (left <= righ... | ALGO | 0.999946 | 3.886177 |
5bd16e51-0d13-43be-af66-d110da0256b5 | Rshroff2036/ASSIGNMENT | assignment/module 4/Inheritance Polymorphism-4/4_Q12.cpp | //Write a program to swap the two numbers using friend function without using third variable
#include<iostream>
using namespace std;
class A{
int n1,n2;
public:
void get()
{
cout<<"enter the n1 value:";
cin>>n1;
cout<<"enter the n2 value:";
cin>>n2;
}
friend void swap(A);
};
void swap(A obj)
{
ob... | ALGO | 0.99737 | 5.508807 |
60f69ada-7593-4da3-a0dc-adadbb07dc14 | Guptaverse/Striver-SDE-Sheet- | Arrays/006.merge_two_sorted.cpp | brute force : TC: O(N*LogN +N) , SC : O(1)
class Solution {
public:
void merge(vector<int>& nums1, int m, vector<int>& nums2, int n)
{
int size1=nums1.size()-1;
for(int i=0;i<nums2.size();i++)
{
nums1[size1]=nums2[i];
size1--;
}
sort(nums1.begin(),nu... | ALGO | 0.99998 | 5.696195 |
59cfea03-a909-4487-b340-68ea38ba09fb | ripalnakiya/Cpp-Programmes | Recursion/07_FibonacciSeries.cpp | //$ This program returns perticular fibonacci element at passed position
// # (We can get elements of the series from the Memoisation Method)
//! See Program 014_FibonacciSeries2.cpp
#include <iostream>
using namespace std;
int *series;
//@ This function has time complexity O(2^N)
int fib(int num)
{
if (num <= ... | ALGO | 0.999818 | 5.081348 |
5d1ce4a0-6609-4fb5-8c42-5fc93f4e77d2 | VrishtiGupta11/Cpp_DataStructures | Data Structures/Stacks Queues/queue_array.cpp | #include <iostream>
using namespace std;
template <typename T>
class Queue {
T* data;
int nextIndex, firstIndex, capacity, N;
public:
Queue() {
capacity = 4;
data = new T[capacity];
nextIndex = 0;
firstIndex = -1;
N = 0;
}
void enqueue(T element) {
... | TOOL | 0.977469 | 4.441402 |
ec025900-d0ae-405f-9bc9-86b59b34710e | scashnetwork/scash | src/bitcoin-tx.cpp | #if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <chainparamsbase.h>
#include <clientversion.h>
#include <coins.h>
#include <common/args.h>
#include <common/system.h>
#include <compat/compat.h>
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <core_io.h>
#include <ke... | TOOL | 0.860307 | 6.285527 |
39c495b2-f1c6-4a86-8560-9a4a11c0536c | coldEr66/online-judge | atcoder/ABC122 pD.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define RST(i,n) memset(i,n,sizeof i)
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(),a.end()
#define X first
#define Y second
... | ALGO | 0.999895 | 3.945544 |
d94362aa-1986-4020-b3b8-d495d823be4a | ivabby/Competitive-Programming | LeetCode/LeetCode Practice Problems/1742- Maximum Number of Balls in a Box.cpp | class Solution {
public:
int countBalls(int lowLimit, int highLimit) {
map<int,int> m;
int mx = 0;
for(int i=lowLimit;i<=highLimit;i++) {
int j = i;
int s = 0;
while(j > 0) {
s+=j%10;
j/=10;
}
... | ALGO | 0.999282 | 6.071768 |
982cebfa-d877-4d29-a416-3d79ae0ca245 | rinikerlab/RDKit_mETKDG | modified_rdkit/Code/GraphMol/Fingerprints/AtomPairs.cpp | #include <GraphMol/RDKitBase.h>
#include <GraphMol/Fingerprints/AtomPairs.h>
#include <GraphMol/Subgraphs/Subgraphs.h>
#include <DataStructs/SparseIntVect.h>
#include <RDGeneral/hash/hash.hpp>
#include <cstdint>
#include <boost/dynamic_bitset.hpp>
#include <boost/foreach.hpp>
#include <GraphMol/Fingerprints/Fingerprint... | ALGO | 0.997053 | 5.86111 |
23c4c63c-c696-4242-9444-ea38f1ab33fc | ninilo97/Hackerearth-Practice-Solution | BASIC PROGRAMMING/Basics of Bit Manipulation/xorRectangle_M.cpp | //@author Nikhil Londhe
#include<bits/stdc++.h>
using namespace std;
const int MX = 1e6;
const int BITS = 20;
typedef long long ll;
ll arr[MX+1][BITS];
int main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n; cin>>n; for(int i=1;i<=n;++i){
int x; cin>>x; for(int j=0;j<20;++j) arr[i][j]=arr[i-... | ALGO | 0.998418 | 3.781659 |
ca4450cb-bc4f-49ff-92e5-c795de9175df | codewithaman07/My-questions | 646-maximum-length-of-pair-chain/maximum-length-of-pair-chain.cpp | class Solution {
public:
int findLongestChain(vector<vector<int>>& pairs) {
vector<int>temp;
sort(pairs.begin(),pairs.end());
for(auto &num : pairs){
auto it = lower_bound(temp.begin(),temp.end(), num[0]);
if(it == temp.end()) temp.push_back(num[1]);
else ... | ALGO | 0.999984 | 5.718342 |
20f7b1f0-6b62-4c3a-a05c-a0bfc54e8619 | ankit-tiwari-dev/DSA-Problem-Set-II | Undirected_graph_cycle_using_bfs.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
// Function to detect cycle in an undirected graph.
bool detect(int src, vector<int> adj[], int vis[])
{
vis[src] = 1;
queue<pair<int, int>> q;
q.push({src, -1});
... | ALGO | 0.999963 | 6.202043 |
bcd2f50d-de57-4053-ab74-51b55889c31c | falabretti/algorithms | dynamic_programming/01_knapsack.cpp | #include <bits/stdc++.h>
using namespace std;
int knapsack(int weights[], int values[], int solution[], int qnt, int max_weight) {
int dp[qnt + 1][max_weight + 1];
for (int i = 0; i <= qnt; i++) {
for (int j = 0; j <= max_weight; j++) {
if (i == 0 or j == 0) {
dp[i][j] =... | ALGO | 0.999981 | 3.643397 |
35dc4e12-38a0-4cde-8f11-aa13f31f13f1 | tatvlogs0312/Data-Structure-and-Algorithms-C- | DoThi/TimKiemDijsktra.cpp | #include <iostream>
#include <fstream>
#define MAX 100
#define VoCung 1000
using namespace std;
typedef struct GraphTag
{
int n;
int a[MAX][MAX];
} graph;
bool DocFile(graph &g)
{
ifstream fi("Dijsktra.txt");
if (fi.is_open() == true)
{
fi >> g.n;
for (int i = 0; i < g.n; i++)
... | ALGO | 0.998829 | 3.951547 |
635fc93e-85f7-4c34-810e-f33f6034a3a1 | AryanChauhan25/CodingBlocks-AlgoCourse-Solutions | Recursion/SmartKeypadAdvance.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
char table [][10] = {" ", " ", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
char searchIn [][12] = {"prateek", "sneha", "deepak", "arnav", "shikha", "palak", "utkarsh", "divyam", "vidhi", "sparsh", "akku"};
set<string> s;
void smartK... | ALGO | 0.999909 | 4.407908 |
2d105444-660d-46d8-9b5c-7ecd12c541b2 | prathik-kaliyambath/code | div3/481/A.cpp | #include<iostream>
#include<vector>
#include <unordered_map>
using namespace std;
int main(){
unordered_map<int,int> s;
int n;
vector<int> v;
cin>>n;
while(n--){
int t;
cin>>t;
v.push_back(t);
}
for(auto it=v.end()-1;it>=v.begin();it--){
s[*it]++;
}
c... | ALGO | 0.999979 | 3.878045 |
35091920-33ee-4a1b-b267-759d394bd0f4 | edge555/Online-Judge-Solves | Codeforces/1426/A. Floor Number.cpp | #include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pf printf
#define sc scanf
#define sf(n) scanf("%d",&n)
#define sff(n1,n2) scanf("%d %d",&n1,&n2)
#define sfff(n1,n2,n3) scanf("%d %d %d",&n1,&n2,&n3)
#define sl(n) scanf("%lld",&n)
#define... | ALGO | 0.999638 | 3.634222 |
d3825ea2-5065-4d8d-8c24-d7ec3ac663d2 | Jashimjnn/CppProject | phitron1.cpp/BinaryTree/B_Plus_Minus_Split.cpp | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define Y cout << "YES" << endl;
#define N cout << "NO" << endl;
int main()
{
ll t;
cin>>t;
while(t--)
{
ll n;
cin>>n;
string str;
cin>>str;
ll cnt1=0,cnt2=0;
for(int i... | ALGO | 0.999908 | 4.027725 |
b5a6c5f2-1631-42ec-8d7a-311e70f04ff1 | renhaofan/Source-Archive | OpenCV/opencv_contrib-3.4.5/modules/saliency/src/staticSaliency.cpp | #include "precomp.hpp"
namespace cv
{
namespace saliency
{
/**
* StaticSaliency
*/
bool StaticSaliency::computeBinaryMap( InputArray _saliencyMap, OutputArray _binaryMap )
{
Mat saliencyMap = _saliencyMap.getMat();
CV_CheckTypeEQ(saliencyMap.type(), CV_32FC1, "");
Mat labels = Mat::zeros( saliencyMap.rows * ... | ALGO | 0.99875 | 7.339057 |
8e74c72a-416e-4df9-9334-139bf8913898 | Nano1337/LeetCodePractice | two-sum/two-sum.cpp | #include <map>
using namespace std;
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
map<int, int> m;
for(int i = 0; i < nums.size(); i++){
m.insert({nums[i], i});
}
for(int j = 0; j < nums.size(); j++){
if(m.co... | ALGO | 0.999661 | 6.046654 |
3ce38de0-7d30-4e92-a21e-50feedaa1572 | MahinAshraful/CodeWatch_Data | sample-data/p00011/s983785416.cpp | #include <bits/stdc++.h>
using namespace std;
/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++) //a~(b - 1)?????§
#define print(i) cout << i << endl //?°??????????Python?????????
#define all(i) (i).begin(),(i).end() //??¨??????(sort??¨???)
#define mp make_pair //mp(OO, OO)??¨???... | ALGO | 0.999943 | 3.355787 |
788ec70d-7b32-473c-9e8b-213df72a4721 | Sookmyung-Algos/2021algos | algos_assignment/team_pratice/ACM ICPC/990001/10월1주차/10830.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int N;
long long B;
long long matrix[6][6];
long long result[6][6];
long long temp[6][6];
void multiply(long long m1[6][6],long long m2[6][6]){
// 행렬 제곱
for (int i=0;i<N;i++){
for (int j=0;j<N;j++){
temp[j][i]=0;
for... | ALGO | 0.999935 | 4.027821 |
93660a18-f225-4f88-acbb-f52333ee9a16 | Parean/Homeworks | 1/Hw9/Task9.1/List.cpp | #include "List.h"
#include <stdio.h>
String *createEmptyString(int size);
ListElement *createListElement(String *value, ListElement *next)
{
ListElement *newListElement = new ListElement;
newListElement->value = value;
newListElement->next = next;
return newListElement;
}
List *createList()
{
List *newList = ne... | TOOL | 0.978454 | 4.410294 |
d0767d02-5bab-4f85-a30b-3015efa75a5f | ishandutta2007/codeforces | shinriitin/normal/538/B.cpp | #include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
const int MAXN=1e6+5;
int q[MAXN],tot;
inline int trans(int set){
int x=0;
for(int i=7;~i;--i)
x=10*x+(set>>i&1);
return x;
}
int n,ans[MAXN],cnt;
int dp[MAXN],pre[MAXN];
int DP(int x){
if(!x)return 0;
if(... | ALGO | 0.999873 | 3.462455 |
1481d10f-5182-4ffa-a4c0-dccda014b7f3 | Taejin1221/Problem-Solving | Baekjoon/Baekjoon20233.cpp | // Baekjoon20233.cpp
#include <iostream>
using namespace std;
int main(){
int a, x, b, y, t;
cin >> a >> x >> b >> y >> t;
int ansFirst = 21 * max(0, t - 30) * x + a, ansSecond = 21 * max(0, t - 45) * y + b;
cout << ansFirst << ' ' << ansSecond << '\n';
return 0;
}
| ALGO | 0.999001 | 3.387909 |
d60f3028-29de-4219-8ad3-2f2a1c1caac6 | xKarnSinghx/ProblemSetSolution | ATC/RoundDown.cpp | /*
B - Round Down /
Time Limit: 2 sec / Memory Limit: 1024 MB
Score :
200
points
Problem Statement
Given an integer or a decimal
X
, round it down to an integer and print the result.
Constraints
0
≤
X
≤
10
100
X
is an integer or a decimal with at most
100
digits after the decimal point, without unnecessary l... | ALGO | 0.999955 | 3.626102 |
3ea25201-69b7-4759-9945-c5cb3abef37e | Yash-srivastav16/100-Days-Coding | Day 4/Write a program to identify of the a number is positive or negative.cpp | #include<iostream>
using namespace std;
int main(){
int num;
cout<<"Enter Number: ";
cin>>num;
if(num==0) cout<<"Neither Negative Nor Positive";
else if(num>0) cout<<"Positive";
else cout<<"Negative";
return 0;
} | ALGO | 0.999036 | 3.228583 |
03a4233d-08e9-4b3f-9475-9b7b94d2719e | AtharvPitrubhakta/Rohit_Negi_DSA_Sheet | Lec-11 While & Do-While Loop/ContinueSta.cpp | #include<iostream>
using namespace std;
int main()
{
// Continue
for(int i = 1; i <= 100; i++) {
if(i % 4 == 0)
continue;
cout << i << " ";
}
return 0;
} | ALGO | 0.999489 | 3.514485 |
509aa332-b5f6-4906-8c76-664abac79136 | AllenAndrew01123/Competitve-Programming | Codeforces/TripToTheOlympiad.cpp | #include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
typedef long long ll;
void solve()
{
ll l,r;cin>>l>>r;
ll bit;
ll excess=0;
for(int i=31;i>=0;i--)
{
if(((r>>i)&1)&&(!((l>>i)&1)))
{
bit=i;
break;
}
else
{
... | ALGO | 0.999665 | 3.452627 |
db521c07-8111-488f-8126-fb3074c86c78 | Erennedirlo/cp | Examples/segment_tree.cpp | // Written by: Erennedirlo, 07/11/2022
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(a, x, n) for (int a = x; a < n; ++a)
int main() {
int n, q, t;
cin >> n >> q >> t;
vector<int> v(n), seg(2 * n + 1);
loop(i, 0, n) {
cin >> v[i];
seg[i + n] = v[i];
}
for (int i ... | ALGO | 0.999851 | 4.978746 |
a4a2f449-0806-4738-b657-6c8b3ddb615d | atikOvi21/CSE4304-Data-Structure-Lab | Lab7-DSU/task04.cpp | #include <bits/stdc++.h>
using namespace std;
class DSU {
public:
vector<int> parent;
DSU(int n) {
parent.resize(n);
for (int i = 0; i < n; i++) {
parent[i] = i;
}
}
int find_Set(int u) {
if (parent[u] == u) {
return u;
}
return ... | ALGO | 0.999932 | 5.540838 |
b77e2feb-1088-4523-884d-fce1fc22b5ce | ngochahh2005/PTIT-code | CodePTIT-DSA/SortAndSearch/DSA06037 - SẮP XẾP ĐOẠN CON.cpp | #include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define lmt 1000000
using namespace std;
bool check(pair<int, int> a, pair<int, int> b) {
return a.second <= b.first;
}
int main() {
std::ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t-... | ALGO | 0.999899 | 4.008175 |
ae67bb11-c621-47e6-ad4a-de51e6ae2d85 | Dytchem/OI-Notes | Dytchem-ac/Gym/100738C/44605234_AC_31ms_1576kB.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
// constexpr ll INF = 0x7fffffffffffffff;
inline ll CEIL(ll a, ll b) { return (a - 1) / b + 1; }
ll n, d;
ll a[(int)1e5 + 1];
ll dp[(int)1e5 + 1];
int main() {
ios::sync_with_stdio(false);
cin >> n >> d;
d <<= 1;
f... | ALGO | 0.99982 | 3.606101 |
59f16b00-1de6-400f-a13b-73fc69387e15 | Katy343/BinarySearch | main.cpp | //FFig.19.04:fig.19_04.cpp
//BinarySearch test program
#include<iostream>
#include"BinarySearch.h"
using namespace std;
int main()
{
int searchInt; //searchKey
int position; //location of search key in vector
//create vector and output it
BinarySearch searchVector(15);
searchVector.displayElement... | ALGO | 0.998747 | 5.675066 |
3fcd907f-c0a6-41c7-a996-5d3a63cc079c | saga-blast/Competitive-Programming | LeetCode/Median_Of_Two_Sorted_Array.cpp | class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int n=nums1.size(),m=nums2.size(),t=(n+m+1)/2;
if(n>m)return findMedianSortedArrays(nums2,nums1);
int l=0,r=n;
while(l<=r){
int c1=(l+r)/2,c2=t-c1;
... | ALGO | 0.999988 | 6.262375 |
5d94ca47-369e-48fe-b62a-6c8f13d7b9be | manvendraaa/Leetcode-Practice | 477-total-hamming-distance/477-total-hamming-distance.cpp | class Solution {
public:
int totalHammingDistance(vector<int>& nums) {
// number of set bits in a^b
int n = nums.size();
int ans = 0;
// for all the nums count the total 1s at a idx and total 0s finally you can choose any one and zero to make diff bit and so the ans will be ... | ALGO | 0.99999 | 5.894154 |
76e4293e-8dd0-432a-800c-f8b4406be455 | UBCMOCCA/TerrainRLSim | optimizer/scenarios/OptScenarioJump.cpp | #include "OptScenarioJump.h"
#include "scenarios/ScenarioJump.h"
cOptScenarioJump::cOptScenarioJump(cOptimizer& optimizer)
: cOptScenarioTrackMotion(optimizer)
{
}
cOptScenarioJump::~cOptScenarioJump()
{
}
std::string cOptScenarioJump::GetName() const
{
return "Optimize Jump";
}
void cOptScenarioJump::BuildScene(... | ALGO | 0.998417 | 5.755725 |
99be3ff4-b408-4d03-b4fa-54ded1701a12 | njs145/coding-test | ex15/main.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
vector<char> moums = {'a', 'e', 'i', 'o', 'u'};
vector<char> alphabat;
int L, C;
string password;
int check_valid_password(string pw)
{
int moum_count = 0;
for(int i = 0; i < pw.size(); i ++)
{
for(int j = 0; j < mou... | ALGO | 0.999891 | 3.240063 |
75972405-bd1e-410b-af14-79ddd2a4f2b3 | sjmjys954646/Algorithm | boj2000-2999/boj2304.cpp | //freopen("input.txt", "r", stdin);
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <cstring>
#include <list>
#include <set>
#include <string.h... | ALGO | 0.999568 | 3.318931 |
18ee196e-659b-4937-a7a3-42a3454e0174 | bertk0/hotel-booking-mobile-app | 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.9988 | 6.76073 |
f1256714-55b6-464b-a186-9a0f7856bd70 | harryplusplus/textrenderer | third_party/source/icu4c-70.1/source/i18n/winnmfmt.cpp | #include "unicode/utypes.h"
#if U_PLATFORM_USES_ONLY_WIN32_API
#if !UCONFIG_NO_FORMATTING
#include "winnmfmt.h"
#include "unicode/format.h"
#include "unicode/numfmt.h"
#include "unicode/locid.h"
#include "unicode/ustring.h"
#include "cmemory.h"
#include "uassert.h"
#include "locmap.h"
#ifndef WIN32_LEAN_AND_MEAN
... | TOOL | 0.879915 | 4.180508 |
ee7474b2-8549-4069-9e85-4d008ef00d9e | IamWilliamWang/Recursion | reverse.cpp | #include "reverse.h"
Reverse::Reverse()
{
}
/*反转数字,核心思想同下面的函数*/
int Reverse::reverseDigit(int value)
{
if(value==0)
return value;//value=0
int num = value;
int i;
for(i=0;num>9;i++)
num/=10;
value = value - pow(10,i)*num;
value = reverseDigit(value);
value = value*10 + num... | ALGO | 0.998767 | 3.581922 |
87ad79fd-1b4d-473e-a29d-39c6e0db9009 | cglwn/ppp3e | 06/12_calculator_underscore.cpp | #include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
using namespace std;
constexpr char number = '8';
constexpr char name = 'a';
constexpr char let = 'L';
constexpr auto prompt = "> ";
constexpr auto result = "= ";
constexpr auto declkey = "let";
constexpr char quit = 'q';
constexpr char prin... | TOOL | 0.977473 | 5.269244 |
402055ca-b720-41c2-8d7f-7b230e0d5051 | Jyw526/algorithm | BOJ/9019.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <memory.h>
#include <string>
using namespace std;
int A, B;
void bfs() {
bool visited[10001] = { false };
queue <pair <int, string> > q;
q.push(make_pair(A,""));
while (!q.empty()) {
int n = q.front().first;
s... | ALGO | 0.999873 | 4.666398 |
1891dd0a-fe99-49ea-b6c3-90155bcbf523 | Prachi309/LeetCode | 0002-add-two-numbers/0002-add-two-numbers.cpp | /**
* Definition for singly-linked list.
* 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:
ListNode* addTwoNumbe... | ALGO | 0.999935 | 6.163582 |
e04cb93e-163e-49d2-b0da-d9e40ba4aad2 | avadhworkzone/pos | jakel_pos/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.998826 | 6.76073 |
41bceee6-3b54-491b-8474-25452b8c1695 | abhishekpaturkar/leetcode-daily | Mar/22_Count_the_Number_of_Complete_Components.cpp | // 2685. Count the Number of Complete Components
// You are given an undirected graph with n nodes labeled from 0 to n-1. The graph is represented by:
// An integer n, denoting the number of nodes.
// A list of edges edges, where each edges[i] = [u, v] represents an undirected edge between nodes u and v.
// A complete... | ALGO | 0.999671 | 7.311412 |
69990be2-e8c5-408b-b3f1-0331ef241593 | ShikhaDhiman1/Cpp-practice | palindromeCharArr.cpp | // Program to check if a word is a palindrome using character array.......
#include <iostream>
#include <cctype> // header file that declares a set of functions to classify( and transform ) individual characters. Ex., tolower(), toupper().
using namespace std;
int main(){
// int size;
// cout<<"Enter the si... | ALGO | 0.999479 | 4.224174 |
9689e270-46bb-4be7-a2e0-6a2b1227e02e | IndrajeetDatta/Vehicle-Speed-Estimation-Using-Optical-Flow-and-3D-Modeling | capstone-project/capstone-project/Track.cpp | #include <iostream>
#include <opencv2\opencv.hpp>
#include "global.h"
#include "Track.h"
#include "Blob.h"
#include "Cuboid.h"
#include "LMFunctor.h"
#include <Eigen/Eigen>
#include <unsupported/Eigen/NonLinearOptimization>
using namespace std;
using namespace cv;
//////////////////////////////////----- TRACK CONST... | ALGO | 0.97854 | 4.389246 |
ed590dd2-53fc-4fb5-abcd-63f30a850dcc | pnthi160403/compettive_programming | contest/code_tour_2024_challenge_1/bai_3/main.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
struct FT {
int n;
vector<int> bit;
void __init__(int _n) {
n = _n;
bit.assign(n + 1, 0);
}
void add(int x, int val) {
for(int i = x + 1; i <= n; i += i & -i) {
bit[i] += val;
}
}
int get(int x) {
int res = 0;
for(int i = x + ... | ALGO | 0.999871 | 4.397288 |
f72ee647-82c9-4bba-b917-05e427f57af1 | Akash1247/Leetcode | 2220-minimum-bit-flips-to-convert-number/2220-minimum-bit-flips-to-convert-number.cpp | class Solution {
public:
int minBitFlips(int start, int goal) {
int s,g,cnt=0;
while(start!=goal){
s=start&1;
g=goal&1;
if(s!=g)
cnt++;
start=start>>1;
goal=goal>>1;
}
return cnt;
}
}; | ALGO | 0.999995 | 5.705632 |
c83937b8-12dd-40a6-a21b-b98f07436efb | PramodSharma122/CSIT-Second_sem-Object-Oriented-Programming | P2.cpp | /*
Write a program to find the square root of a given integer using an inline function
*/
#include<iostream>
using namespace std;
#include<cmath>
inline int squareroot(int x)
{
return sqrt(x);
}
int main(){
int a=64;
cout<<"Squareroot is : "<<sqrt(a)<<endl;
} | ALGO | 0.997258 | 3.691917 |
45b80b95-2b74-4698-9b58-6c550b8f35e5 | prachi214/CrackYourPlacement | Arrays/insertIntervals.cpp | class Solution {
public:
vector<vector<int>> insert(vector<vector<int>>& intervals, vector<int>& newInterval) {
int i =0, j= 0;
vector<vector<int>>res;
int n = intervals.size();
//left
while(i<n && intervals[i][1] < newInterval[0]){
res.push_back(intervals[i]);
i++;
}
... | ALGO | 0.999959 | 6.063632 |
74b0dab0-9849-4989-a993-7dd8f281faa5 | Kannikakr/leetcode_questions | firstOccInString/firstocc.cpp | class Solution {
public:
int strStr(string haystack, string needle) {
int haystackLen = haystack.size();
int needleLen = needle.size();
if (needleLen == 0) return 0;
for (int i = 0; i <= haystackLen - needleLen; i++) {
if (haystack.substr(i, needleLe... | ALGO | 0.999819 | 5.965626 |
75a4236a-ba9c-4abc-b270-03c9444e30a8 | Ryansmg/CodingPractice | Baekjoon/3_gold/g3_1238_dijkstra.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#define inf 2147483640
using namespace std;
// 파티
struct path
{
int target;
int weight;
path(){};
path(int a, int b)
{
target = a;
weight = b;
}
};
struct pqi
{
int target;
int length;
pqi(... | ALGO | 0.999888 | 4.585325 |
fa3bbc2b-2a14-4618-86e3-d9297fcea8e3 | rameez2005/My-Programming-Fundamentals-Journey | 10 PROBLEMS CHALLENGE WEEK-2/task 12.cpp | #include <iostream>
using namespace std;
int main() {
int num = 0, rev = 0, rem = 0, temp;
cout << "enter the number " << endl;
cin >> num;
temp = num;
while (temp != 0)
{
rem = temp % 10;
rev = rev * 10 + rem;
temp = temp / 10;
}
if (rev == num)
cout << "it is a pelindrome number" << endl;
else
... | ALGO | 0.9977 | 3.516207 |
fd7f602d-ae96-4ecb-991a-991380f62d8d | ishita126jain/Data-Structure | Difference Between Element Sum and Digit Sum of an Array.cpp | class Solution {
public:
int differenceOfSum(vector<int>& nums) {
int elesum=0, digsum=0;
vector<int> temp;
for(int i=0;i<nums.size();i++){
int n=nums[i];
while(n!=0){
int a = n %10;
digsum = digsum+a;
n=n/10;
... | ALGO | 0.999952 | 6.201969 |
d2ee08fe-0d1f-4425-afe4-2ae8aff34f45 | winds-zzf/study-datastructure | program/数据结构实验3/3005.cpp | #define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#include<stdio.h>
#include<stdlib.h>
#define OVERFLOW -1
#define QMAXSIZE 120
typedef int Status;
//ʽ洢ṹ
typedef struct BiTNode
{
int data; //
struct BiTNode* lchild, * rchild; //
}BiTNode, * BiTree; //BiTNodeͶBiTNode
typedef struct
{
BiTree*... | ALGO | 0.999972 | 4.079555 |
9ef20932-1f3e-4f93-b2a6-fc2f863a1285 | aqsaldpa/flutter-emtrade | 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.9988 | 6.76073 |
3f4ff2ba-989e-4f6f-b247-9a81ecb69a96 | olexandryipz/OPLab8 | OPLab8.1(while)/OPLab8.1(while).cpp | #include <stdio.h>
#include <Windows.h>
#include <math.h>
int main() {
float a = 1.0, b = 1.0;
while (a <= 11) {
b = 1.0;
while (b <= 3.1) {
printf("a = %.1f, b = %.1f, Добуток = %.2f\n", a, b, a * b);
b += 0.2;
}
a += 1.0;
}
return 0;
} | ALGO | 0.998361 | 3.192041 |
cc601132-e535-4d60-9832-5a1f6948994f | liulog/Nanodet_Inference_OpenVINO | Detector.cpp | #include "Detector.h"
// COCO数据集用来给不同类别用不同颜色的框
const int color_list[80][3] =
{
//{255 ,255 ,255}, //bg
{216 , 82 , 24},
{236 ,176 , 31},
{125 , 46 ,141},
{118 ,171 , 47},
{ 76 ,189 ,237},
{238 , 19 , 46},
{ 76 , 76 , 76},
{153 ,153 ,153},
{255 , 0 , 0},
{255 ,127 , 0},
... | DATA | 0.947066 | 4.932224 |
c4955ae7-7409-4b16-9915-2062eb8ac038 | yrhiba/Competitive_Programming | Content/Algorithms, ADHOC & Data Structures/Codechef/Fair_Share_Settlement.cpp | /*
Starters 112 Division 3 (Rated)
Fair Share Settlement
link to the problem:
https://www.codechef.com/problems/FAIRSHARE
*/
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <iomanip>
#include <algori... | ALGO | 0.9999 | 4.096829 |
5acafe21-a69c-4ab0-82c2-e1e8b51b9b8f | mihaidanaila11/surseAF | FloydWarshall.cpp | #include <iostream>
#include <vector>
#include <fstream>
#define INT_MAX 2147483647
using namespace std;
vector<vector<int>> FloydWarshall(vector<vector<int>> graph){
int n = graph.size();
vector<vector<int>> d = graph;
vector<vector<int>> p(n, vector<int>(n, 0));
for(int i=1; i<n; i++){
for(... | ALGO | 0.999976 | 4.325459 |
272b7c6a-3621-4a9e-9560-d26f31b552db | itsaril/ADS | labka1/h.cpp | #include <iostream>
using namespace std;
bool isPrime(int n) {
if (n <= 1) {
return false;
}
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
int main() {
int n;
cin >> n;
if (isPrime(n)) {
cout << "YES";... | ALGO | 0.999777 | 5.52114 |
3733a274-a305-4760-9dec-0af77cc59bf2 | hongxuming123/Increment_RoleSim | source_code/hungarian3.cpp | #include "hungarian3.h"
#include <sstream>
using namespace std;
//float* weights;
//float* flagX;
//float* flagY;
//char* usedX;
//char* usedY;
//int* matchX;
//int* matchY;
void KM::init(float* data, int m, int n) {
N = max(m, n);
front = m;
back = n;
weights = new float[N * N];
flagX = new float[N];
flagY = ... | ALGO | 0.999645 | 4.18551 |
bcd830b2-a28b-4857-8964-37be74c4ea77 | doug16rogers/oldstuff | dos/cpp/PERMSTUF.CPP | #include <stdio.h>
#include <string.h>
char str[20]="1234";
typedef void (*funcptr)(void);
void (*execute_func)(void)=NULL;
void permute0(char* s,int n) //(n:0)
{
execute_func();
} //permute0
void permute1(char* s,int n) //(n:1)
{
char c0,c1;
if (n<2) {
execute_func();
}
else {
... | ALGO | 0.99987 | 3.760252 |
5134d696-077b-4303-a32f-6ee11ca1f905 | Lali67/Cpp_Snippet | 04-Bjarne Stroustrup-Programming Using Cpp/Chapter04/Chapter04/chapter.4.4.2.3-even.cpp |
//
// This is example code from Chapter <IP_ADDRESS> "For-statements" of
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include "std_lib_facilities.h"
//------------------------------------------------------------------------------
int square(int x) // return the square of x
{
... | ALGO | 0.883114 | 4.390702 |
5aa2b313-956c-414d-9db4-9fb19b17d680 | cuongpiger/algorithms-training | solutions/old/Roma and Changing Signs - Codeforces.cpp | #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <cmath>
#include <iomanip>
using namespace std;
//=================================================... | ALGO | 0.999973 | 3.804161 |
e530a488-4bf9-4a37-888e-2024cdaee65a | pomelo00o/LEETCODE | src/313.super-ugly-number.cpp | /*
* @lc app=leetcode id=313 lang=cpp
*
* [313] Super Ugly Number
*/
class Solution {
public:
int nthSuperUglyNumber(int n, vector<int>& primes) {
vector<int> res(1, 1);
vector<int> idx(primes.size(), 0);
while (res.size() < n) {
int _min_ = INT_MAX;
vector<int> t... | ALGO | 0.999973 | 6.250114 |
4e388cf0-c8fc-4dd2-8d18-3dfb92d2a6cf | ishandutta2007/codeforces | lycmd/normal/1503/C.cpp | #include<bits/stdc++.h>
#define int long long
#define node pair<int,int>
#define a first
#define c second
using namespace std;
int const N=233333;
int n,ans,pre;
node p[N];
signed main(){
ios::sync_with_stdio(0);
cin>>n;
for(int i=1;i<=n;i++)
cin>>p[i].a>>p[i].c,ans+=p[i].c;
sort(p+1,p+1+n);
for(int i=1;i<n;i++... | ALGO | 0.999929 | 3.245792 |
274526a1-b4e8-4d01-8d42-9cac419ad9ee | xtf0214/CPP | Problem/Luogu/Training/212【动态规划2】线性状态动态规划/P1725.cpp | // P1725 琪露诺
// https://www.luogu.com.cn/problem/P1725
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int n, l, r, ans = -INF;
cin >> n >> l >> r;
vector<int> a(n + 1), dp(n + 1, -INF);
for (int i = 0; i <= n; ... | ALGO | 0.999786 | 3.478316 |
0146679c-c9df-4972-9d46-a8c9d0bd745b | SujeetMainali/CPP-DSA | CPP/conditionals/loops.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int i = 1;
int sum = 0;
while (i <= n){
if(i%2 == 0){
sum = sum + i;
}
i++;
}
cout << "sum of even numbers is" << " " << sum <<endl;
return 0;
}
| ALGO | 0.999554 | 4.453915 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.