uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
658f498d-dc3b-4451-8035-2a355a159280 | williamtsutumi/codeforces-contests | i-dont-remember/natal2022/NatalE.cpp | #include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define PER(i, a, b) for (int i = a; i >= b; i--)
#define PMOD(n, m) ((((n) % (m)) + (m)) % (m))
#define debug(x) cout << #x << " = " << x << endl;... | ALGO | 0.999727 | 4.135028 |
2fc43953-4ba6-465e-bade-864d7fbaefd3 | QuantumDroid/platform_frameworks_av | media/libstagefright/codecs/amrnb/common/src/extract_h.cpp | /*
Pathname: ./gsm-amr/c/src/extract_h.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the extract_h function. Sync'ed up
with the current template and fixed tabs.
Description: Removed conditional code that update... | TOOL | 0.957451 | 5.901973 |
f5003b17-a228-4ba3-9436-a5eaf89ac982 | palak72/Practicalc-CC | Practical8/practical8.cpp | #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
using namespace std;
// Structure to represent a production rule
struct Production {
char lhs;
string rhs;
};
// Function to check if a grammar is LL(1) based on the parsing table
bool isLL1(const map<pair<... | ALGO | 0.99995 | 7.259663 |
8c941966-953c-4473-9053-054e6dbbe9de | marcelohpf/tep-solutions | uva/10263.cpp | #include <iostream>
#include <cmath>
#define xx first
#define yy second
#define ER 1e-6
using namespace std;
using Point=pair<double,double>;
double distance(const Point& A, const Point& B){
return hypot(A.xx-B.xx,A.yy-B.yy);
}
bool equals(double a,double b){ return fabs(a-b) < ER;}
class Line{
public:
... | ALGO | 0.999961 | 4.253024 |
706dfc02-df76-4eb6-8ecc-991f4ec5d484 | informatics-mathematics/codeforces | Other Competitions/mBIT (Montgomery Blair Informatics Tournament)/Spring 2021/Standard Problems/C - Reverse Race.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string str;
getline(cin, str);
stringstream ss(str);
string word;
string ans = "";
while(ss >> word)
{
int l = word.length();
if(isupper(word[0]))
{
word[0] += 32;
word[l-1] -= 32;
... | ALGO | 0.999972 | 4.31317 |
c9e77e9f-334a-4c25-b787-58ad9d15d3ac | abhinav6859/cpp- | 4_loop/question1.cpp | // Write a program in C++ to find the sum of the series 1 +11 + 111 + 1111 + .. n terms.
// Sample Output:
// without using two loop
// Input number of terms: 5
// 1 + 11 + 111 + 1111 + 11111
//The sum of the series is: 12345
#include <iostream>
using namespace std;
int main (){
int n;
int l=0;
int k=1;
... | ALGO | 0.999554 | 4.465652 |
eaa78d31-04af-4fa8-b8b8-8b2d0c0a9e48 | jesuswr/cp-codes-and-problems | 1082E.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <math.h>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <unordered_map>
#include <assert.h>
#include <array>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;... | ALGO | 0.999976 | 3.742624 |
5753c050-8b7e-4fc9-87f1-2135f527d5a3 | TEUNGKU-ZULKIFLI/10.stepper | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
9297a3f5-f2fc-494d-aee7-db6cc31773b1 | jakingy/ACIO-Encore-Round-2020 | tatertech/solutions/sol-sub1.cpp | #include <bits/stdc++.h>
using namespace std;
#define MAXN 1000
int N, M, done[MAXN][MAXN];
double cache[MAXN][MAXN];
char grid[MAXN][MAXN];
double E(int r, int c) {
if (!done[r][c]) {
done[r][c] = 1;
if (r < N - 1 && c < M - 1) cache[r][c] = .5 * E(r + 1, c) + .5 * E(r, c + 1);
else if(r... | ALGO | 0.999422 | 4.192286 |
d85635f4-fb42-48fc-8e4f-4a072fe7988d | karunsehwag/leetcode_daily | 1568-minimum-number-of-days-to-disconnect-island/1568-minimum-number-of-days-to-disconnect-island.cpp | class Solution {
public:
int g=0;
int minDays(vector<vector<int>>& grid) {
if(count(grid)!=1)
return 0;
for(int i=0;i<grid.size();i++)
{
for(int j=0;j<grid[0].size();j++)
{
if(grid[i][j]==1)
{ ... | ALGO | 0.999977 | 6.105748 |
e5a128fc-e52f-4110-9920-728b9e2fb541 | bubanalesumit157/CPP_DSA | cpp/daa lab/bin_search.cpp | #include<iostream>
#include<ctime>
using namespace std;
int bs_itr(int arr[],int s,int e,int key){
srand(time(NULL));
while(s<=e){
int mid=rand()%(e-s+1)+s;
if(arr[mid]==key){
return mid;
}
else if(arr[mid]>key){
e=mid-1;
}
else{
... | ALGO | 0.999882 | 4.022428 |
c3df2225-41d1-4023-b974-6a7f868fbb23 | hicder/icpc_code | uva/uva_00573.cpp | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <bitset>
#include <queue>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstring>
#define FOR(i,n) for(int i = 0; i < (n); i++)
#define pf printf
#define pb push_back
#define pfn printf("\n")
#define INF 1000000000
using namespace st... | ALGO | 0.998112 | 3.023943 |
565a7fa1-a8da-44a1-b2ac-734c3c13333f | gnud-gnaoh/aoc2024 | day9/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
freopen("input", "r", stdin);
string s;
cin >> s;
vector<int> t;
int n = s.size();
int id = 0;
for (int i = 0; i < n; i++) {
int len = s[i] - '0';
if (i % 2 == 0) {
while (len--) {
t.push_back(id);... | ALGO | 0.999918 | 3.808725 |
04722952-0676-4fda-a615-77d31c3cfc4d | thanh-nguyen03/basic_band | Exam/Hard/first_week/di_chuyen_nhanh_chong/sol.cpp | #include <stdio.h>
#define abs(a) a > 0 ? a : -a
int main() {
int s, x1, x2, t1, t2, c, d;
scanf("%d%d%d%d%d%d%d", &s, &x1, &x2, &t1, &t2, &c, &d);
int case1 = (x2 - x1) * t2;
if (case1 < 0) case1 = - case1;
int case2 = 0;
if (c < x1) {
if (d == 0) {
case2 += (c + x1) * t1;
d = 1;
}
else case2 += (... | ALGO | 0.999947 | 3.341601 |
8127d734-9a5b-4d53-886e-2fcc71647488 | spcl/smat | preprocess/src/general/csr.cpp | #include <string>
#include <vector>
#include <fstream>
#include <iostream>
#include <random> //std::shuffle
#include <stdexcept>
#include <algorithm> // std::sort
#include <numeric> //std::iota
#include <iterator>
#include "matrices.h"
#include "utilities.h"
using namespace std;
void CSR::clean()
{
/*--------... | ALGO | 0.852001 | 3.627652 |
8f4936d7-a729-4b72-a834-91932bf448b3 | apkharsh/recurrsion | deleteMiddleElementFromStack.cpp | // Find the middle element of an stack using recurrsion
#include <bits/stdc++.h>
using namespace std;
stack<int> findMiddle(stack<int> &s){
if(s.empty()) return s;
int val = s.top();
s.pop();
if(current = size/2)
} | ALGO | 0.999437 | 4.439428 |
548bfd57-8675-4518-b0fa-763eab3ddcc2 | Lye-0407/18020495-TranMinhHieu-INT2215-50 | code-hoc-tap/on-tap-0-code-mau/XauDoiXung.cpp | #include <iostream>
#include <string>
using namespace std;
bool isPalindrome(const string& s)
{
int i = 0;
int j = s.length() - 1;
while (i < j)
{
if (s[i] != s[j]) return false;
i++;
j--;
}
return true;
}
int main()
{
string s;
getline(cin, s);
... | ALGO | 0.999891 | 6.525807 |
935cb80d-f5b4-46f6-94f5-4abaa97ec20b | arthurfp/MinesweeperGame-Flutter | 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.998859 | 6.785645 |
60886664-29f4-4788-b7a0-ad5eac79fb81 | tad315/DSA-code.ptit | DSA02027 - NGƯỜI DU LỊCH.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl '\n'
int n;
vector<vector<int>> c;
vector<bool> visited;
int ans = INT_MAX;
void backTrack(int pos, int cnt, int cost)
{
if (cost >= ans) return;
if (cnt == n)
... | ALGO | 0.999974 | 3.773968 |
9334986d-0168-4610-bdc7-016939299f93 | pranjalnehete02/CDAC | DSA/Competitive Programming/hello_world/LinkedList/Inserting_node_at_front.cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
node *push(node *head, int newdata){
node *newnode = new node();
newnode -> data = newdata;
newnode -> next = head;
head = newnode;
return head;
}
int main(){
node *head = NULL;
head = push(head,5);
head = ... | ALGO | 0.997033 | 3.77351 |
f860235d-f6d0-4db3-aca7-559b26ff1067 | Abhishek-Sharma-1999/LeetCode-Solutions | 98-validate-binary-search-tree/98-validate-binary-search-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.999708 | 6.212574 |
e68a140f-6024-4688-b593-b0a902faaf83 | reger-men/HPL_GPU | src/auxil/HPL_dlamch.cpp | /*
* Include files
*/
#include "hpl.h"
/*
* ---------------------------------------------------------------------
* Static function prototypes
* ---------------------------------------------------------------------
*/
static void HPL_dlamc1
STDC_ARGS(
( int *, int *, int *, int ... | CONFIG | 0.97274 | 5.575266 |
c1870245-f3f5-4d63-929d-3c95e7288752 | flydog98/CppBaekjoon | C++15552.cpp | // 15552 A + B
#include <iostream>
using namespace std;
int main(void) {
int test = 0;
int a = 0, b = 0;
scanf("%d", &test);
for (int i = 0; i < test; i++) {
scanf("%d %d", &a, &b);
printf("%d\n", a + b);
}
return 0;
} | ALGO | 0.998949 | 4.880051 |
9ff464d1-7343-43df-9eae-9485a92c8c95 | pmkosela/podstawy_programowania_23-24 | gr2/lab5/zadanie8/main.cpp | #include <iostream>
using namespace std;
bool trianglePossible(float a, float b, float c)
{
return ((a+b)>c && (a+c)>b && (c+b)>a);
}
int main()
{
float a, b, c;
std::cin >> a >> b >> c;
std::cout << trianglePossible(a, b, c) << std::endl;
return 0;
}
| ALGO | 0.997986 | 4.641807 |
adbd2a75-0ef1-42e9-8daa-32cb6cb462a6 | SevkiBekir/CEIT211 | Homework/Lab3/lab3_2.cpp | // *************************************************************
// * This example is about Sorting to the avg. of numbers gets *
// * Created by Sevki Bekir *
// * Date: April 1, 2015 *
// *********************************************************... | ALGO | 0.998546 | 3.601577 |
434be0d8-9557-43ca-9ba0-bf29a4a6bb39 | Sachit0786/LeetCode | 2434-design-a-number-container-system/design-a-number-container-system.cpp | class NumberContainers {
public:
// Constructor
// Initializes an empty data structure to store number-index mappings.
NumberContainers() {}
/**
* Updates the mapping of an index to a number.
* If the index already exists, it removes the previous number from the mapping.
* Then, it assig... | ALGO | 0.994256 | 7.26713 |
76f8ff68-1357-4b55-87f8-f7ebf8440ea0 | Oreobird/ai-demo | face_quality/3rdparty/opencv-4.0.0/modules/imgproc/src/featureselect.cpp | #include "precomp.hpp"
#include "opencl_kernels_imgproc.hpp"
#include "opencv2/core/openvx/ovx_defs.hpp"
#include <cstdio>
#include <vector>
#include <iostream>
#include <functional>
namespace cv
{
struct greaterThanPtr
{
bool operator () (const float * a, const float * b) const
// Ensure a fully determinis... | ALGO | 0.996885 | 6.68146 |
43d05f5b-0849-4e89-a58c-cab7dbe641f6 | Rittik10/DS-40-LEVEL-CODES | q 17.cpp | #include <stdio.h>
int main() {
int num, count = 0;
printf("Enter an integer: ");
scanf("%d", &num);
if (num == 0)
count = 1;
else {
while (num != 0) {
num /= 10;
count++;
}
}
printf("Number of digits = %d\n", count);
return 0... | ALGO | 0.998773 | 5.889881 |
a0e3195f-6ac1-4936-9b6b-5f3b46bf7b42 | ranjeet-kumar-2002/Interview_DS_Algo | Arrays/[1,n]patten.cpp/442. Find All Duplicates in an Array.cpp | 442. Find All Duplicates in an Array
// 1 <= nums[i] <= n [1,n] use the nums element as indx
// Each element in nums appears once or twice.
You must write an algorithm that runs in O(n) time and uses only constant extra space.
************************************************
we can use sorting
we can use the map
we c... | ALGO | 0.999872 | 6.267812 |
bf0552f2-1927-459a-9c22-57b9d9bda256 | SiriusZYZ/vmd | vmd.cpp | #include "vmd.h"
Eigen::VectorXcf vmd::fft(const Eigen::VectorXf& x)
{
Eigen::FFT<float> fft;
Eigen::VectorXcf res;
fft.fwd(res, x, x.size());
return res;
}
Eigen::VectorXcf vmd::fftshift(const Eigen::VectorXcf& X)
{
int n = X.size();
int k = (n + 1) / 2;
Eigen::VectorXcf w(n);
w(Eigen::seq(0, n - k - 1)... | ALGO | 0.999844 | 5.529921 |
276bef16-a407-468f-8dd4-5aaefd80679f | Stele1203/C_plus | test./string2/25.cpp | #include <iostream>
#include <string>
using namespace std;
//. Napisati program koji za data dva stringa S i T provjerava da li su jednaki kada se
//otkucaju na tastaturi. Karakter ‘#’ ima specijalno značenje i predstavlja pritisak
//backspace dugmeta na tastaturi (brisanje karaktera ispred kursora).
//Ulaz: U prvom... | ALGO | 0.999874 | 4.552097 |
6767b0ae-1928-40b0-ba3f-a1c9583ea8e1 | mterada1228/atcoder | atcoder_begginer_contests/ABC274/c/c.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> G(2 * n + 2, 0);
for (int i = 1; i <= n; ++i) {
int a;
cin >> a;
G[2 * i] = G[a] + 1;
G[2 * i + 1] = G[a] + 1;
}
for (int i = 1; i <= 2 * n + 1; ++i) {
cout << G[i] << endl;
}
return 0;
} | ALGO | 0.999937 | 3.669188 |
19647947-9d9f-47cf-b6da-2c7bf2c8fcee | jerry20091103/Teensy_Harmonizer | lib/DaisySP/Synthesis/formantosc.cpp | #include "../Utility/dsp.h"
#include "formantosc.h"
#include <math.h>
using namespace daisysp;
void FormantOscillator::Init(float sample_rate)
{
carrier_phase_ = 0.0f;
formant_phase_ = 0.0f;
next_sample_ = 0.0f;
carrier_frequency_ = 0.0f;
formant_frequency_ = 100.f;
phase_shift_ = 0.0... | ALGO | 0.94286 | 5.216876 |
ac972311-adfb-4a37-8bce-c7f0e68dc3d6 | TimHung000/leetcode | 0649_dota2Senate/main.cpp | #include <string>
#include <queue>
class Solution {
public:
std::string predictPartyVictory(std::string senate) {
std::queue<int> radiant;
std::queue<int> dire;
int len = senate.size();
for(int i = 0; i < len; ++i) {
if(senate[i] == 'R')
radiant.push(i);... | ALGO | 0.999981 | 6.262223 |
48b00dd7-ecbe-41a9-aa7c-c674fa63b93e | manikanta2901/ubuntu | .history/codingChallenges/cpp/Codechef/longChallenges/Year2021/January/BlackJack_20210108173636.cpp | #include<bits/stdc++.h>
#include<vector>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<iterator>
#include<string>
#include<map>
#define vv vector
#define F first
#define S second
#define MP make_pair
#define EXECUTE_FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define printM... | ALGO | 0.999822 | 3.52863 |
5f15abbe-fd80-4349-9b6a-ff5a2b91d6e7 | vitorguidi/Competitive-Programming | Treinos equipe/xv de piracikobus/2018/09-16 Damascus 2015/i.cpp | #include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define fr(i,n) for(int i=0;i<n;i++)
#define frr(i,n) for(int i=1;i<=n;i++)
#define ms(x,i) memset(x,i,sizeof(x))
#define dbg(x) cout << #x << " = " << x << endl
#define all(x) x.begin(),x.en... | ALGO | 0.999742 | 3.588213 |
7bdb8de2-1022-4f24-9aac-9605f8f3d465 | stefdasca/CompetitiveProgramming | Infoarena/pesaptecarari.cpp | /*
infoarena pesaptecarari - https://www.infoarena.ro/problema/pesaptecarari
"Given a directed graph of n nodes, where each node has a value written on it, find the path which has in its product as few
occurences of P as possible, where P is given in input"
Do dijkstra for each distinct prime fac... | ALGO | 0.999988 | 3.545147 |
f8c7e10c-55b6-4171-962e-03d550888aa9 | mhsong21/baekjoon-solve | answer/2748.cpp | #include <iostream>
long memo[91];
long solve(long n) {
if (memo[n] > 0) {
return memo[n];
}
if (n == 0) {
return 0;
}
if (n == 1 || n == 2) {
return 1;
}
long ans = solve(n-1) + solve(n-2);
memo[n] = ans;
return ans;
}
int main() {
int n;
std::cin >> n;
long ans = solve(n);
std... | ALGO | 0.999983 | 5.54796 |
d08202e2-5b23-420c-9e63-2bf16bce0c74 | prateekshyap/DSA | Arrays/GFG_CountDistinct.cpp |
/*
https://practice.geeksforgeeks.org/problems/distinct-absolute-array-elements4529/1
Count distinct elements in an array
*/
#include <iostream>
#include <algorithm>
#include <unordered_set>
using namespace std;
class Solution
{
public:
int countDistinct(int arr[], int n)
{
int res=1, i ,j;
... | ALGO | 0.999669 | 4.9422 |
ead62981-fdaf-4af3-a48a-e9c87eaf3eb7 | KaydenWeatherford/APCSP | Assignments/Prec_Yield.cpp | #include <iostream>
#include <list>
#include <string>
#include <array>
#include <cmath>
#include <vector>
#include <bits/stdc++.h>
#include <tuple>
using namespace std;
int binarySearch(string arr[], string x, int n)
{
int l = 0;
int r = n - 1;
while (l <= r) {
int m = l + (r - l) / 2;
... | TOOL | 0.958642 | 3.554206 |
8d22adee-a2ce-4ccf-b533-060ca68f2506 | tookstanmay/Codeforces_solutions_cpp | 800_rated_codeforces/watermelon.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned __int64
int main(){
int t;
cin>> t;
while(t--){
int w;
cin>> w;
if (w % 2 == 0 && w > 2) cout<< "YES"<< endl;
else cout<< "NO"<< endl;
}
return 0;
} | ALGO | 0.99929 | 4.245236 |
48273e09-662c-4baf-9ab3-1d204528d196 | MC-117/BraneEngine | Tangram/ThirdParty/bullet3_Backup/Bullet3OpenCL/NarrowphaseCollision/b3QuantizedBvh.cpp | #include "b3QuantizedBvh.h"
#include "Bullet3Geometry/b3AabbUtil.h"
#define RAYAABB2
b3QuantizedBvh::b3QuantizedBvh() : m_bulletVersion(B3_BULLET_VERSION),
m_useQuantization(false),
m_traversalMode(TRAVERSAL_STACKLESS_CACHE_FRIENDLY)
//m_traversalMode(TRAVERSAL_STACKLESS)
... | ALGO | 0.993782 | 7.105717 |
2d29de4f-ddaf-4db5-b26d-785fc7c0f2be | ishandutta2007/codeforces | takio/normal/609/C.cpp | #include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 110000;
int a[N];
int main () {
// freopen ("in.txt", "r", stdin);
int n;
while (cin >> n) {
// cin >> n ;
LL sum = 0;
for (int i = 1; i <= n; i++) {
scanf ("%d", &a[i]);
sum += a... | ALGO | 0.99978 | 3.623718 |
f2cd1c9a-f85d-420a-9921-7a1ed8794760 | Psymage360/DSA-2.0 | queues/queueSTL.cpp | // push
// pop
// front
// empty
#include<bits/stdc++.h>
using namespace std;
int main()
{
queue<int> q;
for(int i=0;i<5;i++)
q.push(i);
q.pop();
cout<<"empty returns "<<q.empty()<<endl;
while(!q.empty())
{
cout<<q.front()<<endl;
q.pop();
}
cout<<"empty returns "<<q.e... | ALGO | 0.986445 | 3.808068 |
9f143dc7-ae98-45c9-8685-abf93c03f9db | oxygen-hunter/Flashboom | data/leetcode_cpp/double-modular-exponentiation.cpp | // Time: O(n * (logb + logc))
// Space: O(1)
// fast exponentiation
class Solution {
public:
vector<int> getGoodIndices(vector<vector<int>>& variables, int target) {
const auto& addmod = [&](uint32_t a, uint32_t b, uint32_t mod) { // avoid overflow
a %= mod, b %= mod;
if (mod - a ... | ALGO | 0.999077 | 5.969199 |
a847a170-d90c-4ef8-9d37-732c0effb385 | AniruddhSharma23/Codeforces-Solution | 800/Log Chopping.cpp |
#include <iostream>
using namespace std;
#include <bits/stdc++.h>
using ll = long long;
int main()
{
// your code goes here
ll t;
cin >> t;
while (t--)
{
int n;
cin >> n;
int s = 0;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
... | ALGO | 0.999108 | 3.825419 |
1a623c1e-691f-4b6c-b33d-947387170de6 | A1lice23/cpp | 11659/11659.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll sum[100001];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n, m, x;
cin >> n >> m;
for(int i = 1; i <= n; i++){
cin >> x;
sum[i] = x + sum[i-1];
}
int a, b;
while(m--){
... | ALGO | 0.999952 | 4.441979 |
37e80b4c-1c97-4eb1-a581-78223a98bead | Safwan-Ibrahim/CPP | Phase 01 P2/Class 9/Problem of Class 9/Fedya_and_Maths.cpp | // Created on: 2025-02-20 05:37
// Author: Safwan_Ibrahim
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int32_t main() {
ios_base::sync_with_stdio(0);cin.tie(0);
string S; cin >> S;
int d = S.back() - '0';
if (S.size() > 1) {
d = (S[S.size() - ... | ALGO | 0.999899 | 4.883366 |
81695380-56da-421c-953b-fbd8fed2e9c2 | ishandutta2007/codeforces | baluteshih/normal/1523/E.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define X first
#define Y second
#define SZ(a) ((int)a.size())
#define ALL(v) v.begin(), v.end()
#define pb push_back
const int MOD = 1e9 + 7, MAXN = 200000;
int J[MAXN + 5] = {1}, invJ[MAXN + 5] = ... | ALGO | 0.999954 | 4.373867 |
73d146be-21b5-4d66-a35a-f4143ce6218d | om-ashish-soni/Competitive-Programming | problemset/company_wise_problems/STRIVER_SDE_SHEET/ARRAYS/pascal_leetcode.cpp | // problem link : https://leetcode.com/problems/pascals-triangle/
// solution : below code
class Solution {
public:
vector<vector<int>> generate(int numRows) {
vector<vector<int>> v;
vector<int> row{1};
v.push_back(row);
for(int i=1;i<numRows;i++){
vector<int> &prev=v.ba... | ALGO | 0.999968 | 6.410116 |
8246aef6-e6f3-4528-b9b2-a102391af723 | ishandutta2007/codeforces | __math/normal/316/A2.cpp | #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include ... | ALGO | 0.999962 | 3.543907 |
a6463a28-15a8-46cd-a2a2-b98ce7e6d53d | tuanduong3001/homework3.5 | Armstrong.cpp | #include<iostream>
#include<math.h>
using namespace std;
int countNumber(int n)
{
int count = 0;
while (n > 0)
{
int tmp = n % 10;
count++;
n /= 10;
}
return count;
}
int isArms(int n)
{
int s = 0;
int count1 = countNumber(n);
while (n > 0) {
int tmp = n % 10;
s += pow(tmp, count1);
n /= 10;
}
re... | ALGO | 0.999856 | 4.042877 |
34f9115d-8bff-45a5-9fc8-79d0a8127264 | azecoder/Problem-Solving | E-olimp/3498. Sum of Different Primes .cpp | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 1120
char primes[N];
int pnumbers[187];
unsigned int dp[N+1][187][15];
unsigned int nWays(int n,int i,int k){
if(!n&&!k)
return 1;
else if(n<0||i>=187||k==0)
return 0;
else if(dp[n][i][k]!=-1)
return dp[n][i][k];
els... | ALGO | 0.999808 | 3.296965 |
9d703282-fdce-416d-ba26-afa124b2f211 | BilalNasir97/Object-Oriented-Programming-C- | polymorphism.cpp | #include <iostream>
#include <string>
using namespace std;
// In ploymorphism we can use same
//function name for different functions
// Also in polymorphism we use use child class
//functionalities by parent class pointer
class Student
{
public:
// virtual keyword is used to here to
//inherit from multiple c... | TOOL | 0.980867 | 6.17766 |
d979a6a5-9b83-470f-8c03-cfde443ab426 | BeastBoyAsh/C- | 159.cpp | #include<iostream>
using namespace std;
main()
{
int size,i,m=0,z=0;
cout<<"Enter size of array = ";
cin>>size;
int a[size],n;
for(i=0;i<size;i=i+1)
{
cin>>a[i];
}
cout<<"Enter the number- ";
cin>>n;
for(i=0;i<size;i=i+1)
{
if(a[i]==n)
m=i+1;
}
for(i=m;i<size;i=i+... | ALGO | 0.999808 | 3.112123 |
50077df6-50b8-4850-b8b5-6eed2bfded00 | SJMormo/competitive-programming | codeforces/1829D.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define INF 1e18
#define mod 1000000007
void fastio()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
void solve()
{
ll n, k;
cin >> n >> k;
if (n == k) {
cout << "YES\n";
return;
}
vector<... | ALGO | 0.999927 | 4.127329 |
e7d4885c-7958-43ab-a0f6-e99dfffd9f74 | leverimmy/Codes | 比赛/学校/2019-9-28测试/source/hdyz MZC/weapon.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int read() {
int w=1,x=0,ch=getchar();
for(; ch<'0'||ch>'9'; ch=getchar())if(ch=='-')w=-1;
for(; ch>='0'&&ch<='9'; ch=getchar())x=x*10+ch-'0';
return x*w;
}
int n,F,p[10010];
namespace baoli {
int an... | ALGO | 0.999895 | 4.049422 |
c6bf3020-ad15-4c39-9c0b-1afbd72df6fb | soso1461/TIL_Today-I-Learn | C++2022/BaekJoon/BaekJoon/Baek11653_230930.cpp | #include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int num;
cin >> num;
if (num == 1) return 0;
for (int i = 2; i <= num; i++) {
while (num % i == 0) {
cout << i << '\n';
num /= i;
}
}
} | ALGO | 0.999989 | 4.693777 |
45207caa-cad3-4aa6-88ed-b56b3624be3a | hirbu/pbinfo-solutions | blackfriday.cpp | #include <fstream>
using namespace std;
long long n,i,j,a[11],b[11];
int main()
{
fstream f("blackfriday.in");
ofstream g("blackfriday.out");
f>>n;
for (i=1;i<=n;i++)
f>>a[i];
for (i=1;i<=n;i++)
f>>b[i];
j=1;
for (i=2;i<=n;i++)
if ( a[j]*(a[i]-b[i]) > (a[j]-b[j])*a[i] ) j=i;
g<<j;
return 0;
}
| ALGO | 0.999926 | 3.084164 |
e0c48df5-27e3-4464-8bb3-4b79074d50d9 | Maxou974/42 | common_core/webserv/srcs/chunked-transfer.cpp | #include "chunked-transfer.h"
static std::string int_to_hexstring(int n)
{
std::stringstream str;
str << std::hex << n;
std::string tmp = str.str();
std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::toupper);
return tmp;
}
void write_vector_to_vector(const std::vector<unsigned char> &from, std::vector<uns... | TOOL | 0.877139 | 4.990433 |
43741c0e-62d1-4231-9df5-f20b5ae635f7 | raincross7/code-similarity | codes/train_code/problem473/problem473_317.cpp | #include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001;
typedef pair<int,int> P;... | ALGO | 0.999991 | 4.253786 |
06176555-f978-467e-8d95-6307f8e00545 | raincross7/code-similarity | codes/train_code/problem060/problem060_304.cpp | #include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
#define int long long
#ifndef bhupixb
#define var(...)
#define stl(...)
#endif
#define rep(i,a,b) for (int i = a; i <= (int)b; ++i)
#define f first
#define s second
#define single_test
constexpr int mod = 1e9 + 7;
struct M {
unsig... | ALGO | 0.999389 | 4.460001 |
181c79f3-1e7a-441f-8d03-4600385896de | Web3Expert47/faceRecognition | src/main/resources/opencv/sources/modules/cudaimgproc/src/hough_circles.cpp | #include "precomp.hpp"
using namespace cv;
using namespace cv::cuda;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || !defined(HAVE_OPENCV_CUDAFILTERS)
Ptr<cuda::HoughCirclesDetector> cv::cuda::createHoughCirclesDetector(float, float, int, int, int, int, int) { throw_no_cuda(); return Ptr<HoughCirclesDetector>... | ALGO | 0.950739 | 6.922724 |
156b63ab-d35c-45ca-b95e-c7977e9e4134 | raincross7/code-similarity | codes/train_code/problem294/problem294_346.cpp | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, s, n) for (int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
double a, b, x;
cin >> a >> b >> x;
x /= a;
const double PI = acos(-1.0);
cout << fixed << setprecisi... | ALGO | 0.999898 | 4.164458 |
3766aceb-efdd-4ab6-880e-e3d156f34a78 | Kriti2019/GFG_ | Difficulty: Easy/Minimum number of Coins/minimum-number-of-coins.cpp | //{ Driver Code Starts
// Initial Template for C++
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
// User function Template for C++
class Solution{
public:
vector<int> minPartition(int V)
{
// code here
vector<int> ans;
int coins[] = {1, 2, 5, 10, 20, 50, 100, 200, 500... | ALGO | 0.999933 | 6.184577 |
9c6236b9-0595-4f27-bc61-777da69388d5 | ishandutta2007/codeforces | skuecrk/normal/930/B.cpp | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
#define MN 5000
char s[MN+5];
vector<int> v[26];
int u[26];
int main()
{
int n,i,j,k,ss,mx,ans=0;
scanf("%s",s);n=strlen(s);
for(i=0;i<n;++i)v[s[i]-'a'].push_back(i);
for(i=0;i<26;++i)
{
for(j=mx=0;j<n;++j)
{
for(k=... | ALGO | 0.999729 | 3.071243 |
a37ec7f6-41e7-4b8d-ae4d-acb4cb802b97 | mesutozlahlan/Cpp-Projects- | lab 7/Point/main.cpp | #include<iostream>
//#include "Point.h"
#include "PointSet.h"
using namespace std;
int main()
{
PointSet ps;
int x, y;
cin>>x>>y;
Point x1(x, y);
cin>>x>>y;
Point x2(x, y);
cin>>x>>y;;
Point x3(x, y);
cin>>x>>y;
Point x4(x, y);
cin>>x>>y;
Point x5(x, y);
cin>>x>>y;
Point x6(x, y);
cin>>x>>y... | ALGO | 0.993714 | 3.957132 |
4c588c42-c49d-484f-97a1-a233f3ce90a2 | alasaijir/LABS | VAR6/9.2/9.2.3/source.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <ctime>
#include <list>
using namespace std;
#define AMOUNT 8
//Сложно сказать какой контейнер лучше.
//Вставка данных не требуется, а двусвязный список list позволяет обходить контейнер в нужных направлениях, так что доступ за O(1) не дает преимущес... | ALGO | 0.999307 | 4.184532 |
f89aa9e7-273e-4ad2-971f-c6d81c97541d | soaibsafi/Competitive-programming | UVa/UVA - 12372.cpp | #include<iostream>
using namespace std;
int main()
{
int t,i,j;
cin>>t;
int a[3];
for(j=1;j<=t;j++){
for(i=0; i<3;i++){
cin>>a[i];
}
if(a[0]>20||a[1]>20||a[2]>20)
cout<<"Case "<<j<<": "<<"bad"<<endl;
else
cout<<"Case "<<j<<": "<<"good"<<endl;
}
return 0;
... | ALGO | 0.911971 | 3.708314 |
411de67b-db24-41f2-a498-511ea103e841 | yku/Competition | TopCoder/srm488/TheBoredomDivTwo.cpp | // SRM488 Div2 250
#include <iostream>
#include <sstream>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
class TheBoredomDivTwo {
public:
int find(int n, int m, int j, int b) {
int ret = n;
if (j - n > 0) ret++;
if (b - n > 0) ret++;
return ret;
}
/... | ALGO | 0.999712 | 4.461767 |
733b6103-e35b-4d22-88f8-f7f8dbe4c780 | TStr626/AtCoder | ABC268/F.cpp | #include<iostream>
#include<vector>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<iomanip>
using namespace std;
# define rep(i,n) for(i=0; i<n; i++)
struct unit {
long long xcount = 0;
long long numtotal = 0;
long long sc... | ALGO | 0.999793 | 3.63173 |
75ead979-7cf0-46d9-9dbe-49adb927760b | engrsakib/phitron | semester 2/3 Basic Data Structures/A MID/Queries.cpp | #include <bits/stdc++.h>
using namespace std;
int count = 0;
class Node
{
public:
int val;
Node *next;
Node *prev;
Node(int val)
{
this->prev = NULL;
this->val = val;
this->next = NULL;
}
};
void insert_head(Node *&head, Node *&tail, int val)
{
Node *new_Node = new N... | ALGO | 0.999941 | 4.302924 |
d78ca5e4-e632-4a2e-be1a-390352631267 | LLstream/atcoder | abc374/a.cpp | #include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
#endif
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, s, n) for (ll i = s; i < n; i++)
int main() {
string s;
cin >... | ALGO | 0.997754 | 3.659764 |
714d14e8-3edf-41a4-b979-b95a43c22f4d | AhanafTahmid/DSA | Binary Search/CF Edu/Step 2/A_Packing_Rectangles.cpp | //000000111111
//invariant(the condition throughout the program): r is always true, l is always false
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll w, h, n;
bool ok(ll m){
return ((m/h) * (m/w)) >= n;
}
void solve(){
cin>> w >> h >> n;
ll l = 0, r=1, m;
while(!ok(r)) r*=2;
... | ALGO | 0.999864 | 4.252017 |
f6aea8aa-5026-4f2a-9277-38b883eb5210 | Junlin-Yin/myLeetCode | vanilla/19-remove_nth_node_from_end_of_list.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* removeNthFr... | ALGO | 0.99995 | 5.946415 |
fb7eb030-573d-423a-87fd-19cea0a81276 | PietroCaforio/parallel-programming-homeworks | homework-3/sequential_implementation.cpp | //
// Created by Dennis-Florian Herr on 13/06/2022.
//
#include <string>
#include <deque>
#include <future>
#include <functional>
#include "Utility.h"
#define MEASURE_TIME false
struct Problem {
Sha1Hash sha1_hash;
int problemNum;
};
class ProblemQueue {
public:
void push(Problem problem){
... | ALGO | 0.998503 | 5.183352 |
9cc28f8e-6a8b-494a-8afa-c205cb0ba8b5 | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_3470_304.cpp | #include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
if (n == 1) {
puts("2");
} else if (n == 2) {
puts("3");
} else if (n == 3) {
puts("1");
} else if (n == 4) {
puts("2");
} else if (n == 5) {
puts("2");
}
}
| ALGO | 0.99996 | 3.535128 |
d5affa7c-c279-4a0d-8c16-d6ebba4d081e | amoriello/pulse-beacon | hard_build/run/41.cpp | #include <iostream>
#include "factorial.hpp"
void func_41()
{
std::cout << factorial<12>::value << std::endl;
}
| TOOL | 0.958357 | 3.798711 |
afc62658-4ecb-484b-b9df-37da8e811042 | parthapritam2717/CodeChef | CHN09.cpp | #include<stdlib.h>
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<limits>
#include<list>
#include<map>
#include<set>
#include<time.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl>... | ALGO | 0.999089 | 3.533838 |
64671c8a-1b0e-4ac8-b12c-87617bc593e8 | lirui233/C-Primer_vs2017 | C++Primer_vs2017/9.15.cpp | #include <iostream>
#include <vector>
using namespace std;
int main(void)
{
vector<int> vec1{ 1,2,3,4,5,6,9 };
vector<int> vec2{ 1,2,3,4,5,5 };
if (vec1 == vec2)
{
cout << "==" << endl;
}
else if (vec1 < vec2)
{
cout << "vec1 < vec2" << endl;
}
else
{
cout << "vec1 > vec2" << endl;
}
cin.get();
r... | ALGO | 0.991184 | 3.406273 |
4ed6d95b-e2a2-4fc5-84dd-0bd01dd74cfc | Med16-11/365daysOfCode | DSA_Problems/LeetCodeDaily/Minimum Fuel Cost to Report to the Capital.cpp | long long minimumFuelCost(vector<vector<int>>& roads, int seats) {
long long ans = 0;
vector<vector<int>> graph(roads.size() + 1);
for (const vector<int>& road : roads) {
const int u = road[0];
const int v = road[1];
graph[u].push_back(v);
graph[v].push_back(u);
}
dfs(graph... | ALGO | 0.999924 | 6.049688 |
87edf05f-6781-44a0-873d-078ed552756e | ishandutta2007/codeforces | chiliudog/normal/722/A.cpp | #include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)... | ALGO | 0.993208 | 3.190229 |
4b9afafa-74a3-42b1-9ec2-1134f5a9a4ff | lakshaydhiman70/Competitive-Programming | Graph/SurroundingReggins.cpp | #include<bits/stdc++.h>
using namespace std;
void dfs(int row, int col, int n, int m, vector<vector<int>>& vis, vector<vector<char>>& board,
vector<pair<int,int>>& directions){
vis[row][col] = 1;
for(auto dir: directions){
int nrow = row + dir.first;
int ncol = col + dir.second;
... | ALGO | 0.999951 | 5.628601 |
1a83f715-c5da-4085-a679-112e90d84302 | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_48_0.cpp | #include <bits/stdc++.h>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ') {
while (!isdigit(ch = getchar()))
if (ch == '-') f = -1;
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
return f * x;
}
const int N = 1e2 + 5, M = 3e3 + 5, P = 1e9 + 7;
int n, m, a[N], b[N], p[M];
l... | ALGO | 0.999977 | 4.012024 |
9e4fe5d1-f418-40b9-b2a6-dcecfd63255a | whitecloudy/RFID_beamformer | src/Beam_algo/Directional_beamtrainer.cpp | #include "Beam_algo/Directional_beamtrainer.hpp"
#include <cmath>
#include <cstdlib>
#include <ctime>
Directional_beamtrainer::Directional_beamtrainer(int ant_num, std::vector<int> ant_array) : Beamtrainer(ant_num){
this->ant_array = ant_array;
this->cur_angle_x = 0;
this->cur_angle_y = 0;
}
void Directional_be... | TOOL | 0.987389 | 4.717203 |
4fee25b2-3f5f-4d75-8105-217913862d98 | lmvasquezg/Programming-Languages | clases/clase20/intercambio-01.cpp | #include<iostream>
#include<cstdlib>
using namespace std;
void intercambiar(int a , int b){
int temp=a;
a = b;
b = temp;
}
int main(void){
int k =10,j=20;
cout << "k: " <<k<<" j: " << j << endl;
intercambiar(k,j);
cout << "k: " <<k<<" j: " << j << endl;
return EXIT_SUCCESS;
}
| ALGO | 0.989329 | 3.068183 |
d9a37757-f7ca-4649-969b-377daa37aef0 | satyapsr13/LeetCode | 40-combination-sum-ii/40-combination-sum-ii.cpp | class Solution {
vector<vector<int>>ans;
void find(vector<int>&can,int n,int target,int l,vector<int>v,int sum)
{
if(sum>target)
{
return ;
}
if(sum==target)
{
ans.push_back(v);
}
unordered_map<in... | ALGO | 0.999995 | 6.106542 |
43324052-b4be-46c5-8950-2ff5af238fd0 | pongsaphol/submission | evaluator/o61/may08/rqg_2.cpp | #include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define x first
#define y second
int n, x, y;
void solve(pii pos, int sz, pii del) {
int ret = sz >> 1;
if(ret == 1) {
int x, y; tie(x, y) = pos;
bool st1 = (x/2) & 1, st2 = (y/2) & 1;
if(pos == del) printf("1 %d... | ALGO | 0.999931 | 3.45714 |
71ec8c58-a113-47c4-b5a6-71b563787549 | CT7692/Stock_Binary_Tree | TreeStockDriver.cpp | //*****************************************************************************************************
//
// File: TreeStockDriver.cpp
//
// Student: Joseph Rydel
//
// Assignment: Assignment #6
//
// Course Name: Data Structures II
//
// Course Number: COSC 3100 - 01
//
// Due: March 07, 2022
//
/... | ALGO | 0.961823 | 3.792459 |
b52256c9-6edb-43d0-97d5-5f57a2634661 | qkrtjddn0628/C-and-Cplusplus-note | Project1/4-5-6. for문 예제5.cpp | #include<stdio.h>
int main() {
int n;
scanf_s("%d", &n);
int i, sum;
for (i = 1, sum = 0; i <= n; sum += i, i++);
printf("%d\n", sum);
} | ALGO | 0.99972 | 4.157589 |
98461eb5-b953-4498-930a-b5de3e412497 | Meowcoin-Foundationn/Meowcoin | src/crypto/hmac_sha256.cpp | #include "crypto/hmac_sha256.h"
#include <string.h>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{
unsigned char rkey[64];
if (keylen <= 64) {
memcpy(rkey, key, keylen);
memset(rkey + keylen, 0, 64 - keylen);
} else {
CSHA256().Write(key, keylen).Finalize(rke... | ALGO | 0.985362 | 5.856034 |
82337f79-2651-4ef3-83f3-39e23f3ec7a6 | denisewu/LeetCode | DistinceSubsequences.cpp | /*
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, "ACE" is a subsequence... | ALGO | 0.99999 | 6.308235 |
83b924b3-008d-4ca7-a0af-8f91fbc631b8 | brandonhs/H3-LinkedLists | test-it.cpp | #include <iostream>
#include <vector>
#include <chrono>
// Function to display a progress bar
void printProgressBar(double progress)
{
int barWidth = 70;
std::cout << "[";
int pos = barWidth * progress;
for (int i = 0; i < barWidth; ++i)
{
if (i < pos)
std::cout << "=";
... | TOOL | 0.870415 | 7.081725 |
eabe8930-bd99-4571-ae21-0257d48b3feb | yoshikiri/kyo-pro | atcoder/joi/007/e.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int main() {
int r, c;
cin >> r >> c;
int a[r][c];
rep(i, r) rep(j, c) cin >> a[i][j];
int ans = 0;
rep(s, 1 << r) {
int x[r][c];
rep(i, r) {
if (s >> i & 1) {
r... | ALGO | 0.999846 | 4.500294 |
2ca38e7e-d366-4437-99cd-292262c17e03 | Licheam/Codes | P2480.cpp | #include <cstdio>
#define LL long long
#define MOD 999911658
#define MAXP 35700
const LL div[]={2,3,4679,35617};
LL n,g,f[MAXP],sum[4];
LL binpow(LL x,LL y,LL mod){
LL r=1%mod;
for(;y;y>>=1){
if(y&1) r=r*x%mod;
x=x*x%mod;
}
return r;
}
void pre(LL p){
f[0]=1;
for(int i=1;i<=p-1;i++) f[i]=f[i-1]*i%p;
}
LL... | ALGO | 0.999923 | 3.931383 |
1fc1271b-aaa6-4ee3-accf-448b77e3c64b | juniorprincewang/virtio-cuda-module | NVIDIA_CUDA-9.1_Samples/6_Advanced/reduction/reduction.cpp | /*
Parallel reduction
This sample shows how to perform a reduction operation on an array of values
to produce a single value.
Reductions are a very common computation in parallel algorithms. Any time
an array of values needs to be reduced to a single value using a binary
associative operator,... | ALGO | 0.986669 | 6.177983 |
2372fa49-5772-4afb-98e8-a2aeade2e893 | ayush4028/C-Notes | 07_Linked_List/questions/ReverseSinglyLL.cpp | #include<bits/stdc++.h>
using namespace std;
class Node{
public :
int data;
Node* next;
//constructor
Node(int data)
{
this -> data = data;
this -> next = NULL;
}
};
void print(Node* head)
{
Node* temp = head;
while(temp != NULL)
{
cout << temp -> data ... | ALGO | 0.999775 | 5.070184 |
c62bb7f2-8a9a-4a92-badf-e74bca03204c | CSUNSA1704250/parallel-nqueens-problem-null | utils.cpp | #include <iostream>
#include "utils.hpp"
using namespace std;
int main(int argc, char* argv[]){
string Type = argv[2];
int N = atoi(argv[4]);
cout<<Type<<'\n'<<N<<endl;
vector<int> sol;
for(int i=0;i<N;i++){sol.push_back(i+1);}
vector<vector<int>> solutions;
solutions.push_back(sol);
so... | TOOL | 0.8957 | 3.987606 |
36ab63a1-eaf8-4626-a8f4-b3f0061248ce | jamshidbek12/boolean | 18-example.cpp | #include <iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a==b || a==c || b==c){
cout<<"TRUE";
}else{
cout<<"FALSE";
}
}
| ALGO | 0.999855 | 4.14636 |
69897763-b797-4cbc-ab23-b5d646ee24e3 | Jahvinci/MotaCoin | src/sync.cpp | #include "sync.h"
#include "util.h"
#include <boost/foreach.hpp>
#ifdef DEBUG_LOCKCONTENTION
void PrintLockContention(const char* pszName, const char* pszFile, int nLine)
{
printf("LOCKCONTENTION: %s\n", pszName);
printf("Locker: %s:%d\n", pszFile, nLine);
}
#endif /* DEBUG_LOCKCONTENTION */
#ifdef DEBUG_LOC... | TOOL | 0.97413 | 5.7469 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.