uuid stringlengths 36 36 | repo_name stringlengths 5 123 | relative_path stringlengths 5 4k | content stringlengths 33 2.85M | category stringclasses 6
values | algo_rel_score float64 0.85 1 | quality_score float64 3 8.76 |
|---|---|---|---|---|---|---|
8983731c-b026-4182-a843-508d6608f94e | hjiang13/LLMs-in-IR | processed_data/DecompiledResuts_Human_x_164_O1/GPT35_Human_x_164_O1_decompiled/CPP_30.cpp | ```cpp
#include <vector>
void get_positive(std::vector<float>& result, std::vector<float>& input) {
result.clear();
for (size_t i = 0; i < input.size(); i++) {
if (input[i] > 0.0f) {
result.push_back(input[i]);
}
}
}
int main() {
std::vector<float> input = {1.0f, -2.0f, 3.0... | ALGO | 0.999152 | 5.676168 |
0fc20860-6725-4c77-b90e-e3b2bef2c0e2 | truongtamthanh2004/Leetcode | 2903-insert-greatest-common-divisors-in-linked-list/insert-greatest-common-divisors-in-linked-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:
int greatestCommonDiv... | ALGO | 0.999975 | 5.627316 |
68c2f81c-9baf-4bef-a977-40b1a0afd254 | YilinZhang107/my_c | LeetCode/2187_m完成旅途的最少时间.cpp | #include<bits/stdc++.h>
using namespace std;
class Solution {
public:
//超时了...
long long minimumTime_1(vector<int>& time, int totalTrips) {
long long minTime = 0;
long long trueTotalTrip = 0;
while(trueTotalTrip < totalTrips){
trueTotalTrip = 0;
minTime++;
... | ALGO | 0.999974 | 5.183293 |
18fb2fd3-ef90-42af-9c8b-22ed0e7ef0a2 | ishandutta2007/codeforces | aokana/normal/1574/B.cpp | #include<bits/stdc++.h>
#define rgi register int
#define pbk push_back
#define pii pair<int,int>
#define fi first
#define se second
#define fin(x) freopen(x,"r",stdin)
#define fout(x) freopen(x,"w",stdout)
typedef long long ll;
using namespace std;
inline void read(){}template <typename T,typename... Ts> inline void re... | ALGO | 0.99992 | 3.892912 |
cec0c605-ccba-4ec3-b78c-22860a716efa | HHS-Proclub/hhs-pro-club-website | 2014-2016/solutions2014/PRB11/chen.michael9@gmail.com.cpp | #include <iostream>
using namespace std;
int main()
{
int N;
cin >> N;
int score = 0;
char a[1000];
char b[1000];
for (int i = 0; i < N; i++)
{
cin >> a[i];
}
for (int i = 0; i < N; i++)
{
cin >> b[i];
}
for (int i = 0; i < N; i++)
{
if (a[i] ... | ALGO | 0.999899 | 4.086421 |
2fbceab6-c3da-47b5-831c-8533a7c97e8f | fadhilahkhairogi/DSA | Jan25/week4/Coin_Transformation.cpp | #include <bits/stdc++.h>
#include <iostream>
#include <cmath>
typedef long long ll;
using namespace std;
int main(){
/*unordered_map<ll,ll> m;
ll base = 1, count =1;
while (base < 1000000000000000000){
m[base] = count;
count++;
base *= 4;
}*/
ll n,x;
cin>>n;
ll count;
while (n--){
... | ALGO | 0.999819 | 4.088757 |
a73b4cf9-afd1-4976-a325-14ba72872b3a | ishandutta2007/codeforces | nikolapesic2802/normal/1331/C.cpp |
// Problem : C. ...And after happily lived ever they
// Contest : April Fools Day Contest 2020
// URL : https://codeforces.com/contest/1331/problem/C
// Memory Limit : 256 MB
// Time Limit : 1000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_conta... | ALGO | 0.99993 | 3.883524 |
f13b6b5b-98f4-4b9f-b1b5-88c481a8d624 | Cy30mk3v/KTLT | Week_10/Theory/Source.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include "Header.h"
int main()
{
int *a;
int *max;
int length;
getArray(a, length);
maxLength(a, length, max);
trace(a, length, max);
} | ALGO | 0.948661 | 3.214409 |
25578088-6aa6-4f60-a057-1d2cafdabd1f | simsunny22/simunny22 | thread/c/producer_consumer/producer_consumer_with_2_cond.cpp | #include <stdio.h>
#include <pthread.h>
#define CAPACITY 8 // 缓冲区的最大容量
int buffer[CAPACITY]; // 缓冲区数组
int in; // 缓冲区的写指针
int out; // 缓冲区的读指针
int size; // 缓冲区中的数据个数
void buffer_init() {
in = 0;
out = 0;
size = 0;
}
// 判断缓冲区是否为空
int buffer_is_empty() {
ret... | ALGO | 0.931632 | 4.695013 |
70d78294-be96-4792-9a5a-aad6fe727bf8 | 19709830982/github_text | c_test/116.cpp | #include <stdio.h>
int main() {
double electricity, cost;
// õ
scanf("%lf", &electricity);
if (electricity <= 110) {
// õ0110֮䣨110ȣ
cost = electricity * 0.5;
} else if (electricity > 210) {
// õ210
cost = 110 * 0.5 + 100 * 0.55 + (electricity - 210) * 0.7;
... | ALGO | 0.995941 | 3.710823 |
893985e2-d49f-48eb-be85-a21eebe18bdb | matchlessLian/- | 实时计算.cpp | #include<stdio.h>
int MaxSum_shishijisuan(int List[,int N]);
int main()
{
}
int MaxSum_shishijisuan(int List[,int N])
{
int i;
int ThisSum,MaxSum;
ThisSum=MaxSum=0;
for(i=0;i<N;i++)
{
ThisSum+=List[i];
if(ThisSum>MaxSum)
{
MaxSum=ThisSum;
}
else if(ThisSum<0)
{
ThisSum=0;
}
}
return MaxSum;... | ALGO | 0.999734 | 3.067614 |
9e3783a3-0bd4-46ec-bb49-aa6f0f6dc757 | sankalpmittal1911-BitSian/Competitive-Coding | InterviewBit/Greedy Algorithm/Gas Station.cpp | /*There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its next station (i+1). You begin the journey with an empty tank at one of the gas stations.
Return the minimum starting ... | ALGO | 0.999993 | 5.395709 |
4c0e883b-57e1-4db5-ba9c-27400015f4fe | Nobles3689/practice | 20230912_1_#11403.cpp | //Beakjoon Online Judge #11403
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define INF 999999999
int dp[100][100] = { 0, };
void Floyd(int n){
for(int i = 0; i<n; i++){
for(int j = 0; j<n; j++){
for(int k = 0; k<n; k++){
dp[j][k] = min(dp[j]... | ALGO | 0.999967 | 3.445212 |
aeccb710-665a-4880-8910-819e820b68ea | logeshjankeeram/University-Assignments | Game OOP/Introduction-to-the-specialty-and-programming-languages./Task_3/Task3a2.cpp | /*Write a program to solve the quadratic equation:
ax2 + bx + c = 0.
Initial data: equation coefficients a, b, c. Data is entered using the keyboard.*/
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a, b, c, x1, x2;
cout << "enter value for a:";
cin >> a;
cout << "ent... | ALGO | 0.998388 | 3.616924 |
c0880701-c663-479a-b90d-adf2011c5260 | GritLILAN/Algorithm_practice | 牛客比赛/2025.3.23周赛Round86/E题.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
void sovle(){
int n;
cin >> n;
vector<int> a(n + 1);
int s = 0;
for(int i = 1; i <= n; i++){
cin >> a[i];
s = max(s, a[i]);
}
sort(a.begin() + 1, a.end());
vector<int> dp(n * s + 1);
dp[0] = 1;
i... | ALGO | 0.999558 | 4.173825 |
7580ecad-a047-4a20-ab6a-ae29bb3ba5ad | Ahg3L/Codigos | Estructura de datos/EXAMEN/Ins_bin_str_Miguel_Garcia_7.cpp | #include <iostream>
using namespace std;
struct nodo{
int dato;
struct nodo* siguiente;
struct nodo* anterior;
};
void insertar(nodo *&nuevo_num) {
int n;
cout<<"Escribe un numero :";
cin>>n;
nodo* nuevo=new nodo();
nuevo->dato=n;
nuevo->siguiente=NULL;
if(nuevo_num ==NULL)... | ALGO | 0.992665 | 3.907588 |
fb86f7f7-f758-4d96-af4c-87c9550d5c42 | dbstkd1101/SW_PRO | PRO_ONLINE/MCS_custom★.cpp | /*
* 부분 문자열 길이가 고정이므로 a,c,g 세개의 빈도수가 같으면 t는 당연히 같으므로
* a,c,g 의 개수로만 처리해도 된다.
*/
#include<iostream>
#include<unordered_map>
#include<string>
using namespace std;
//전체 개수 중 T는 나머지가 같으면 같은거니 계산 제외함 (성능 업)
//3개만 1001진법 이상으로 하면 overflow 가능성 줄어드니.
struct Data {
int a, c, g;
//bool operator==(const Data&r) const {
// retu... | ALGO | 0.999619 | 4.064617 |
5f55eb0e-4290-41d2-b8be-dd28a17b6282 | ishandutta2007/codeforces | elegia/normal/1041/C.cpp | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <limits>
#include <numeric>
#define LOG(FMT...) fprintf(stderr, FMT)
using namespace std;... | ALGO | 0.999989 | 3.490853 |
27482d37-baa7-4fdb-9fd3-f2e28e0f5e4f | adenehemia09/Book-Management | 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.998784 | 6.761023 |
10964d5b-c398-4d90-a485-6d2f5514d423 | qbit-glitch/data_structures_and_algorithms | leetcode_problems/arrays/lc_56_merge_intervals.cpp | /**
* Leetcode-56: Merge Intervals
*/
#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> mergeIntervals(vector<vector<int>> &a){
vector<vector<int>> ans;
sort(a.begin(), a.end());
for(int i=0; i<a.size(); i++){
if(ans.empty() || a[i][0] >= ans.back()[1])
ans.push_back(a... | ALGO | 0.999984 | 6.004347 |
56911684-1542-477d-8298-6a1bb56446ec | 113bommy/deepmind_codecontests_refine | cpp_source_filter_file/cpp_train_6626_0.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 105;
const long long mod = 1e9 + 7;
long long c[N];
long long f[N][N][N], val[N];
int n, m;
char s[N];
void up(long long &a, long long b) {
a = a + b;
a %= mod;
}
inline long long Pow(long long a, long long b, long long mod) {
long long ret(1);
for (; ... | ALGO | 0.99999 | 4.449747 |
87a0635e-cf03-4484-a218-7fc55a9ec6d7 | BSKorolev/Alg2 | lab16/main.cpp | /*
Функция `knapsack` использует мемоизацию, чтобы избежать повторных рассчетов при вызове функции для одних и тех же параметров.
Для этого используется двумерный массив K, который хранит рассчитанные ранее значения. Каждый элемент K[i][j] соответствует рассчету максимальной стоимости для i предметов и j веса рюкзака.... | ALGO | 0.999983 | 5.966185 |
c7a392e5-d6a4-4da7-ba0c-93b4d3604ddf | openbsd/src | gnu/llvm/llvm/lib/CodeGen/RegAllocScore.cpp | #include "RegAllocScore.h"
#include "llvm/ADT/ilist_iterator.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBundleIterator.h"
#include "llvm/CodeGen/Tar... | ALGO | 0.946129 | 6.498489 |
a833de9a-6563-4631-b24e-be0db8e93b31 | manikanta2901/ubuntu | .history/SRM/elab/DataStructures/Arrays/AR8_20200911150259.cpp | #include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
int size;
cin >> size;
for(int i = 0; i < size; i++){
int a;
cin >> a;
if(a % 2 != 0){
}
}
return 0;
} | ALGO | 0.999252 | 3.181667 |
d9585a22-6efa-4b8e-90d5-ebc07b628db0 | rachedchaaben/Parallel_LBM_cuda | LBM_cuda/src/utils/config/inih/ini.cpp | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <string>
#include <cctype> // for std::isspace
#include "ini.h"
#define MAX_LINE 200
#define MAX_SECTION 50
#define MAX_NAME 50
/* Strip whitespace chars off end of given string, in place. Return s. */
static c... | TOOL | 0.965934 | 5.90547 |
0c5c85d4-e8cc-4f07-9d1e-6f0480617301 | issyu39/competitive-programming | AtCoder/2021/abc205/abc205_b.cpp | #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
int a[N];
for (int i = 0; i < N; i++) {
cin >> a[i];
}
string ans = "No";
// 配列をソート
sort(a, a+N);
for (int i = 0; i < N; i++) {
if (a[i] != (i+1)) {
ans = "No";
brea... | ALGO | 0.999978 | 4.19486 |
a3622b68-cafe-49ae-a7df-0bcf8e13e437 | spexcher/ICPC_AUT_Standard_Juniors_Phase_1_2_-binary-search_stack_queue_deque_priority_queue- | D_Stack.cpp | // ------------------------------------------------------------------------------------
// Author: spexcher
// Name: Gourab Modak
// email: <EMAIL>
// Linktree: https://linktr.ee/spexcher/
// Github: https://github.com/spexcher/
// linkedin : https://www.linkedin.com/in/gourabmodak/
// ---------------------------------... | ALGO | 0.997127 | 5.011426 |
44456cc3-d1ed-4246-845e-3f20a5d38e26 | liliumproject/llvm-project | libcxx/test/std/algorithms/alg.sorting/alg.min.max/requires_forward_iterator.verify.cpp | // <algorithm>
// template<ForwardIterator Iter>
// max_element(Iter first, Iter last);
#include <algorithm>
#include <cassert>
#include "test_iterators.h"
int main(int, char**) {
int arr[] = {1, 2, 3};
const int *b = std::begin(arr), *e = std::end(arr);
typedef cpp17_input_iterator<const int*> Iter;
{
... | TEST | 0.955075 | 5.517587 |
46677b6f-236b-41ef-aab6-68b197b5ff6b | mk28r/Competative_Programming | UpdateFiles.cpp |
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define nline "\n"
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ps(x, y) ... | ALGO | 0.999664 | 3.734119 |
2f26074d-f612-47cd-955a-c0f66c319fac | Dexes/algorithmic-problems | timus/Volume 07/1607/cpp/main.cpp | #include<iostream>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
if (a > c) {
cout << a << endl;
return 0;
}
while (true) {
if (a + b <= c) {
a += b;
} else {
cout << c << endl;
return 0;
}
... | ALGO | 0.999835 | 3.257008 |
ad257fd2-6579-41d5-99d6-976b0a2f9940 | aanchalsethi/DataStructuresAndAlgorithm | binarySearch/firstAndLastOccurence.cpp | #include <iostream>
using namespace std;
int firstOccurence(int arr[], int n, int key)
{
int s = 0, e = n - 1;
int mid = s + (e - s) / 2;
int ans = -1;
while (s <= e)
{
if (arr[mid] == key)
{
ans = mid;
e = mid - 1;
}
else if (arr[mid] > key)... | ALGO | 0.999945 | 5.106548 |
87c64b59-2f14-4824-a4c5-89387d796ac7 | RioKKH/AtCoder | 00_ABC/ABC403/B/main.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
std::string S, T;
std::cin >> S;
std::cin >> T;
bool result = false;
for (size_t i = 0; i < S.size(); i++)
{
if (S[i] == T[0] || S[i] == '?')
{
for (size_t j = 0; j < T.size(); j++)
{
... | ALGO | 0.999983 | 4.430582 |
6ed32fea-0fc8-47e6-8658-48c8805b4c33 | ishandutta2007/codeforces | fattypenguin/normal/201/A.cpp | #include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queu... | ALGO | 0.999908 | 3.668788 |
2a7a15c2-9f3b-4faf-8de9-cdea27046783 | ManamritSingh/DSA_Array_Problems | 0217-contains-duplicate/0217-contains-duplicate.cpp | class Solution {
public:
bool containsDuplicate(vector<int>& nums) {
int i=0;
sort(nums.begin() , nums.end());
for(int i =0 ; i<nums.size()-1 ; i++ ){
if(nums[i] == nums[i+1])
return true;
}
return false;
}
}; | ALGO | 0.999917 | 5.487142 |
73b861ef-f50c-4596-af14-c694b79bd24f | trangtretrau2005/DSA-code_ptit | DSA-PTIT/Generation Algorithm/DSA01023 - SỐ THỨ TỰ TỔ HỢP.cpp | #include <bits/stdc++.h>
using namespace std;
int n, k, m[100001], tmpv[100001], lk[100001], tmp[100001], mang[100001];
vector<string> res;
void Try(int i){
if(i==k+1){
string S="";
for(int u=1;u<=k;u++) S += to_string(m[tmpv[u]]) + " ";
res.push_back(S);
return;
}
for(int... | ALGO | 0.999742 | 4.067628 |
4b0742cc-cca9-4de2-81ce-9f99748f5bcd | sarvex/leetcode-umka | solution/0800-0899/0878.Nth Magical Number/Solution.cpp | using ll = long long;
class Solution {
public:
const int mod = 1e9 + 7;
int nthMagicalNumber(int n, int a, int b) {
int c = lcm(a, b);
ll l = 0, r = 1ll * (a + b) * n;
while (l < r) {
ll mid = l + r >> 1;
if (mid / a + mid / b - mid / c >= n)
r =... | ALGO | 0.999975 | 5.951842 |
1e2e26e8-7651-4b86-ae9f-942e6d25ec55 | Nagasai2604/C-_beginning-codes | creating sum of variables/creating sum of variables/program1.cpp | #include<iostream>
using namespace std;
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
int sum = a + b + c + d;
cout << sum;
return 0;
} | ALGO | 0.984183 | 3.37955 |
14ecbb34-2e57-4e9d-8f3d-33a1a61930b5 | dimmkan/MSHP | lesson53/l53-3/l53-3/main.cpp | #include <iostream>
#include <iterator>
#include <vector>
#include <algorithm>
using namespace std;
typedef vector <int> v_int;
typedef istream_iterator<int> in_it;
typedef ostream_iterator<int> out_it;
bool action(int value){
return value >= 0;
}
int main()
{
v_int v;
int n;
cin >> n;
copy_n(in... | ALGO | 0.996442 | 4.029073 |
a4b0ac83-75de-45a8-9f31-ac7bbacf8dc1 | Ernesto-Canales/FUNDA_101_Ernie | C++/S36_CPP_Functions_part2/S36_Exercise1.cpp | /*
1. Write three different value-returning function,
that return the value true if a given number is Even, otherwise return false for Odd.
(Tip: use IF, Ternary and Bitwise)
*/
#include <iostream>
using namespace std;
//Prototipos
bool IFunction(int);
bool TFunction(int);
bool BFunction(int);
int main() {
int... | ALGO | 0.999544 | 5.169903 |
76e6aa3a-9b71-47e6-ab78-4db27285f962 | BushraShahzad09/LeetCode | Search an Element in an array - GFG/search-an-element-in-an-array.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
// Function to search x in arr
// arr: input array
// X: element to be searched for
int search(int arr[], int N, int X)
{
// Your code here
for(int i=0;i<N;... | ALGO | 0.999521 | 5.783348 |
b83b6294-1383-4d07-962c-712817b7c448 | Woodman3/hpc_algorithm | main.cpp | #include <iostream>
#include <algorithm>
#include "sort.hpp"
#include "test.hpp"
using namespace std;
int main(){
// int n=1000000;
// int max_power = 4;
// std::uniform_int_distribution<int>dis(0,( 1<<max_power )-1);
test_scan();
// int *a= random_data_gen<int>(n,dis);
// int *b = new int[n];... | TEST | 0.996228 | 3.382677 |
751876c3-3f0f-4d1c-9172-7a04d9c08cf9 | yida/CodingInterview | string_remove_duplicate.cpp | #include <iostream>
#include <cstring>
#include <queue>
using namespace std;
void remove_duplicate_char(string &str) {
string::iterator it = str.begin();
queue<int> duplicate;
for (int cnt = 0; cnt < str.length(); cnt++) {
for (int next = cnt + 1; next < str.length(); next++)
if (str[next] == str[cnt... | ALGO | 0.997785 | 4.406399 |
b4c0efc9-0d92-49d1-97a8-9098d2cd3d18 | Starry0/ACM | 51nod/1791.cpp | #include <iostream>
#include <stdio.h>
#include <stack>
#include <string.h>
#define ll long long
using namespace std;
const int N = 1100010;
int t, len;
char str[N];
ll pos[N], ans[N];
int main() {
scanf("%d",&t);
while(t--) {
scanf("%s",str+1);
len = strlen(str+1);
for(int i = 0; i <= len; i ++) {
pos[i] = ... | ALGO | 0.999784 | 3.735251 |
d7f86f8b-d55a-493a-8e81-329c8a9c8d78 | junesookang/asplos24-GMT | include/freestanding/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.sample/sample.stable.pass.cpp | // UNSUPPORTED: c++98, c++03, c++11, c++14
// <algorithm>
// template <class PopulationIterator, class SampleIterator, class Distance,
// class UniformRandomNumberGenerator>
// SampleIterator sample(PopulationIterator first, PopulationIterator last,
// SampleIterator out, Distance n,
/... | TEST | 0.875405 | 7.494885 |
b9216f24-004d-443d-a878-a1da2c9efe4f | jizhang-cmu/autonomy_stack_diablo_setup | src/slam/dependency/gtsam/gtsam/3rdparty/Eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
Eigen::MatrixXf m(2,2);
m << 1, 2,
3, 4;
//get location of maximum
MatrixXf::Index maxRow, maxCol;
float max = m.maxCoeff(&maxRow, &maxCol);
//get location of minimum
MatrixXf::Index minRow, m... | ALGO | 0.999646 | 4.010038 |
f586d54f-c855-4160-ae43-bf23ab363994 | rohit141914/LeetCode | 0318-maximum-product-of-word-lengths/0318-maximum-product-of-word-lengths.cpp | class Solution {
public:
int maxProduct(vector<string>& w) {
int l=w.size();
int ans=0;
for(int i=0;i<l-1;i++){
unordered_set<char>st(w[i].begin(),w[i].end());
for(int j=i+1;j<l;j++){
bool flag=false;
for(int k=0;k<w[j].size();k++){
... | ALGO | 0.999972 | 5.371121 |
0e4ac8d3-9c0e-4c38-bbe5-33746991c3a1 | evialbert/LeetCode | 0796-rotate-string/0796-rotate-string.cpp | class Solution {
public:
bool rotateString(string& s, string& goal) {
return s.size()==goal.size() && (s+s).find(goal)!=-1;
}
}; | ALGO | 0.999935 | 5.86488 |
d89a648e-c366-4bf5-b98e-af30ce746c0e | TianYe2017/Run_Length_Encoder | run_length_encode.cpp | #include "stdafx.h"
#include "run_length_encode.h"
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
bool Is_All_Scaned(vector<run_length_data> in)
{
bool out = true;
int i = 0;
for (vector<run_length_data>::iterator it = in.begin(); it != in.end(); it++)
{ ... | ALGO | 0.965828 | 3.425064 |
6a905810-8b15-4775-b72b-711789ec12d1 | govoyager/interview-preparation-material | MISC questions/6.cpp | //Program for reversing the linked list using recursion
//For simplicity all the elments from the input are added to the starting of linked list
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
Node *next, *prev;
};
void addNode(Node **temp_head,int data)
{
Node* new_node = ne... | ALGO | 0.999926 | 5.428387 |
f738e0c3-cc2c-4336-a33d-0f819fe807c9 | Shivansh722/aviator | 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.998756 | 6.772262 |
76852498-6ad2-42e5-9d97-97fcd425e9c4 | CrimsonTheLegoBuilder/MyBaekjoonSolve | Cpp/boj_solve/MKC5_B.cpp | /*
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstring>
#include <cassert>
typedef long long ll;
typedef long double ld;
//typedef double ld;
const ld INF = 1e17;
const ld TOL = 1e-7;
const ld PI = acos(-1);
const int LEN = 50005;
inline int sign... | ALGO | 0.999807 | 4.974682 |
482643cf-aa8a-4e6d-bcc5-a9fd6d2e7f9e | ishandutta2007/codeforces | noam13/normal/1508/B.cpp | #include <bits/stdc++.h>
#define int int64_t
#define vi vector<int>
#define ii pair<int,int>
#define vb vector<bool>
#define vvi vector<vi>
#define vvb vector<vb>
#define vii vector<ii>
#define vvii vector<vii>
#define x first
#define y second
#define pb push_back
#define loop(i,s,e) for(int i=s;i<e;i++)
#define loopr(... | ALGO | 0.9996 | 3.687634 |
e09e082d-bbba-4892-89a4-11a138c90af4 | CaptainGoGo007/Library-System | forloopprac1.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int even_sum = 0;
int odd_sum = 0;
int odd_count = 0;
int even_count = 0;
int nums;
for(int i = 1; i <= n; i++){
cin >> nums;
if(i % 2 == 0){
even_sum += nums;
... | ALGO | 0.999928 | 3.894686 |
bf68deec-73bb-4778-8bea-b975561e1e76 | Iam-Sodhi/DSA | BinarySearchProblem.cpp/Advanced Problem/PageAllocationproblem.cpp | #include <iostream>
using namespace std;
// If n - no of pages in n diff books(ascending order) & m - no of students
// All the books have to be divided among m students consecutively.Allocate the pages in such a way that
//*****maximum pages allocated to a student in minimum.*****
bool ispossible(int pages[], int n, i... | ALGO | 0.99991 | 4.413449 |
a1742550-a12d-4e7c-b423-91316546b641 | AniketKul/CMPS229_OpenLambda_Ceph | experiments/single-node/docker/boost/libs/geometry/doc/src/examples/algorithms/make_inverse.cpp | // Boost.Geometry (aka GGL, Generic Geometry Library)
// QuickBook Example
//[make_inverse
//` Usage of make_inverse and expand to conveniently determine bounding box of several objects
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/... | ALGO | 0.984142 | 6.819036 |
efde7a00-d6ee-4e10-b098-1d68a58548ee | MKraienhorst/rnm_D | Eigen/bench/dense_solvers.cpp | #include <iostream>
#include "BenchTimer.h"
#include <Eigen/Dense>
#include <map>
#include <vector>
#include <string>
#include <sstream>
using namespace Eigen;
std::map<std::string,Array<float,1,8,DontAlign|RowMajor> > results;
std::vector<std::string> labels;
std::vector<Array2i> sizes;
template<typename Solver,type... | TOOL | 0.998582 | 6.343297 |
a8aa8e19-d558-467e-9436-3dd51b2226ee | ramosjuanr/frameworks_av | media/module/codecs/amrnb/dec/src/d3_14pf.cpp | /*
------------------------------------------------------------------------------
Pathname: ./audio/gsm-amr/c/src/d3_14pf.c
Functions: decode_3i40_14bits
Date: 01/28/2002
------------------------------------------------------------------------------
REVISION HISTORY
Description: Modified to place file in t... | ALGO | 0.999716 | 6.115746 |
aeda07c0-c013-4163-b620-3aa18153341f | nova-video-player/aos-libtorrent | examples/make_torrent.cpp | #include "libtorrent/entry.hpp"
#include "libtorrent/bencode.hpp"
#include "libtorrent/torrent_info.hpp"
#include "libtorrent/storage.hpp"
#include "libtorrent/create_torrent.hpp"
#include <functional>
#include <cstdio>
#include <sstream>
#include <fstream>
#include <iostream>
#ifdef TORRENT_WINDOWS
#include <direct.... | TOOL | 0.860837 | 6.513428 |
f69aba07-ae0a-4d57-840b-b6d3f95f7f99 | prudhvi9121/LeetCode | 678-valid-parenthesis-string/valid-parenthesis-string.cpp | class Solution {
public:
bool checkValidString(string s) {
int low = 0, high = 0;
for (char c : s) {
if (c == '(') {
++low;
++high;
} else if (c == ')') {
low = max(0, low - 1);
--high;
} else if (c =... | ALGO | 0.999726 | 4.983442 |
ada32540-e16e-45ca-a54b-9f0377844d1f | Gauravlamba1109/LeetCodeQuestions | 202-happy-number/202-happy-number.cpp | class Solution {
public:
bool isHappy(int n) {
unordered_map<int,bool>m;
while(n!=1 && m.find(n)==m.end()){
m[n]=1;
int nn = 0;
while(n>0){
nn+= (n%10)*(n%10);
n=n/10;
}
... | ALGO | 0.999964 | 6.478379 |
95050070-59b2-4e59-ba96-dbc6babf4fcd | luqin2007/Obsidian-Vault | _resources/codes/Cpp/this_func.cpp | #include<iostream>
using namespace std;
int main() {
auto fact = [](this auto self, int n) -> int {
return n ? n * self(n - 1) : 1;
}
cout << fact(5) << end;
return 0;
} | ALGO | 0.999837 | 5.801846 |
045e5fb2-3524-473a-8991-e75b8885d2d0 | hyunstory/CodingTestPractice | Baekjoon/CPP/16236.cpp | #include <iostream>
#include <queue>
#include <deque>
#include <tuple>
#include <cstring>
#include <algorithm>
using namespace std;
#define dir_num 4
#define MAX 21
struct BabyShark {
int cur_size;
int cur_eaten;
int cur_x;
int cur_y;
};
int N;
int result;
int map[MAX][MAX];
int timeCount[MAX][MAX];
bool check... | ALGO | 0.999917 | 3.603154 |
c3e602e2-1a1e-47b9-9ab2-015055ad598b | anubhav1148/DS-lab | Program3.cpp | /* Q: Write a program to accept N integers from the user and store them in an array. Sort the array in ascending order using
Bubble sort. Then accept another number from the user, search whether that number exists in the array using Binary
Search. If it does, display its index and if it doesn't, then prin... | ALGO | 0.999929 | 5.090795 |
d8f4ed83-2a02-41cc-b80d-b18132569fbf | moon1198/Leetcode | hot100/solution543.cpp | #include <bits/stdc++.h>
#include "TreeNode.h"
using namespace std;
//左侧最深,加右侧最深,为该节点值
int postorder(TreeNode *root, int &maxdia) {
if (root == nullptr) {
return 0;
}
int left = postorder(root->left, maxdia) + 1;
int right = postorder(root->right, maxdia) + 1;
maxdia = max(maxdia, left + r... | ALGO | 0.99989 | 5.86024 |
20a1cec4-3b66-4042-aa1f-720865f2f7da | moazamdepar/24k-0868 | Lab 8/Task4.cpp | #include <iostream>
#include <string>
using namespace std;
class Car;
class InventoryManager {
public:
void updateCar(Car& car, string newModel, double newPrice);
void displayCar(const Car& car);
};
class Car {
private:
string model;
double price;
friend class InventoryManager;
friend void ... | TOOL | 0.850497 | 6.59093 |
f3a83726-37d0-48b0-bb54-492911fc8496 | greg-of-Earth/HuffmanTree | .ccls-cache/@home@runner@huffman/main.cpp | //Gregory Calderon
//881477990
//CS 236 Advanced Data Structures Online
//Fall 2023
#include <iostream>
using namespace std;
#include "Huffman.h"
#include <limits>
void ShowMenu();
void GetInput();
enum MenuOptions{
INPUT = 1,
QUIT = 0,
};
int main() {
ShowMenu();
}
//get user input string to be coded
void ... | ALGO | 0.99299 | 3.790583 |
8c23a609-a359-4a1d-adcf-630044106a45 | StrawHatWess/Competitive-Programming-Solutions | Atcoder/B201/B.cpp | //Never stop trying
#include "bits/stdc++.h"
using namespace std;
#define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
typedef long long ll;
#define int ll
typedef string str;
typedef long double ld;
typedef pair<int, int> pi;
#define fi first
#define se second
typedef vector<int> vi;
typedef vector... | ALGO | 0.999842 | 4.062928 |
cb154d6f-6069-422e-b036-16c0aa1e251c | man02123/leetcode-solutions | 0930-binary-subarrays-with-sum/0930-binary-subarrays-with-sum.cpp | class Solution {
public:
int numSubarraysWithSum(vector<int>& nums, int g) {
unordered_map<int ,int> mp;
int csum = 0;
mp[0]++;
int ans = 0;
for(int i = 0;i<nums.size();i++){
csum += nums[i];
if(mp.find(csum-g) != mp.end()){
... | ALGO | 0.999934 | 6.461123 |
624eb57b-77a1-4efe-9e5b-e5ddc853cf3a | Daniil-Tevs/bfu-oop-labs | lab1/src/CalculatorCentralDifferential.cpp | #include "../inc/CalculatorCentralDifferential.h"
double CalculatorCentralDifferential::evolveDifferential(double x, std::function<double(double)> func) {
return (func(x + m_accuracy) - func(x - m_accuracy)) / (2.0 * m_accuracy);
}
| ALGO | 0.999416 | 5.672701 |
4d8cafdc-0683-4729-ae2f-f911b5a4df94 | swarnilk29/dsa-revision | practice-questions/8-triangleTypes.cpp | #include <iostream>
using namespace std;
int main() {
// Declare the variable speed1 and initialize it with the value 36 (speed in km/h)
float speed1 = 36.0;
// Convert the speed from km/h to m/s using the formula: 1 km/h = 5/18 m/s
float speedInMps = speed1 * (5.0 / 18.0);
// Display the convert... | TOOL | 0.95945 | 5.630582 |
aa90632c-f349-4ce5-98cd-5b1c03c450b9 | ArsenyPogosov/olympiad_programs | informatics.mccme.ru/Почти беспрефиксные коды.cpp | #include <fstream>
#include <vector>
//#include <queue>
//#include <list>
//#include <map>
#include <algorithm>
//#include <math>
#include <string>
using namespace std;
vector<string> solve(vector<string> Codes, vector<string> prefics, int k)
{
if (Codes.size() == 0) return{};
if (k == 0)
{
vector<string> res(0);... | ALGO | 0.999954 | 3.188944 |
e3271903-3fec-45c3-b498-299c7d7f2a0e | Prajwal-ak-0/binary-search | Graphs/DetectCycleInUndirectedGr.cpp | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
// Detect cycle in an undirected graph using Depth First Search (DFS)
// Idea: Traverse the graph using DFS. If we visit a node that is already visited and is not the parent of the current node, a cycle exists.
// Time Complexity: O(V+E), wher... | ALGO | 0.999983 | 7.176814 |
b5839e29-116c-4b7e-b1df-2fa5f699f33c | nantr0nic/cpp-learning | projects/practice/codewars/spinWords.cpp | /*
Write a function that takes in a string of one or more words, and
returns the same string, but with all words that have five or more letters reversed.
Strings passed in will consist of only letters and spaces.
Spaces will be included only when more than one word is present.
*/
#include <iostream>
#include <string>
... | ALGO | 0.999824 | 6.623456 |
6688f50d-1c70-4346-a9ab-7770ed986458 | HughHieuTran/solved-leetcode-question | cppBlind75/16-validParenthes.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
bool isValid(string s)
{
vector<char> vec;
for (char c : s)
{
switch (c)
{
case '{':
case '[':
case '(':
vec.push_back(c);
... | ALGO | 0.999106 | 6.053458 |
dfa41ed4-4d75-41a4-bf5d-ca38d6d84456 | Drske/IMO | lab2/src/solvers/lssolvers/gls_tsp_solver.cpp | #include <algorithm>
#include <random>
#include "gls_tsp_solver.h"
#include "../../moves/move.h"
#include "../../move_generator/move_generator.h"
using namespace std;
TPaths GLSSolver::solve()
{
// printf("Solving Greedy Local Search\n");
vector<Move *> (*get_moves)(TPaths) = nullptr;
default_random_eng... | ALGO | 0.999781 | 4.642878 |
280c7a9d-f201-443b-a135-c9f3700e7065 | DalilaDeveloperMobile/Avalie-Atendimento | 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 |
ac95a377-5932-43e7-9e42-e38c469e7c74 | bsc-mem/Mess-Paraver | libs/boost_1_79_0/libs/metaparse/example/calculator/main.cpp | #include <boost/metaparse/repeated.hpp>
#include <boost/metaparse/sequence.hpp>
#include <boost/metaparse/lit_c.hpp>
#include <boost/metaparse/last_of.hpp>
#include <boost/metaparse/first_of.hpp>
#include <boost/metaparse/space.hpp>
#include <boost/metaparse/int_.hpp>
#include <boost/metaparse/foldl_reject_incomplete_s... | ALGO | 0.97138 | 7.298875 |
6b3477c4-009f-429c-b31e-821605dfa242 | phumipatc/C_Competitive_Programming | C++ - 2561/Camp 2.3/Rapid_3/RT_Pizza.cpp | /*
Author : Phumipat C.
School : RYW
Language: C++
*/
#include<bits/stdc++.h>
using namespace std;
int a[20];
int main(){
int n = 8,maxx = 0;
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
a[i+n] = a[i];
}
for(int i=1;i<=2*n;i++)
a[i]+=a[i-1];
for(int i=4;i<=2*n;i++){
... | ALGO | 0.999624 | 3.228539 |
97e5753e-16d7-459a-b658-0ab5c083f1d1 | dangarmol/algorithms-and-data-structures | Software Engineering Algorithmic Techniques/Other/29.cpp | //Daniel Garcia Molero
//Juan Alberto Camino Saez
//Grupo 14
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void printDarts(const vector<int> §orList, const int &objectivePoints, const vector<vector<int>> &matrix) {
size_t i = sectorList.size() - 1;
if(matrix[i + 1][object... | ALGO | 0.999966 | 4.712871 |
f7e156aa-d67e-44c7-98f5-83a5e9a92d74 | Techriss/leetcode | 643.cpp | #include <iostream>
#include <vector>
using namespace std;
double findMaxAverage(vector<int>& nums, int k) {
long long sum = 0, maxsum = 0;
for (int i = 0; i < k; i++) sum += nums[i];
maxsum = sum;
for (int i = k; i < nums.size(); i++) {
sum = sum - nums[i-k] + nums[i];
maxsum = max(sum... | ALGO | 0.999623 | 5.374102 |
059e60e9-0f7e-4a0b-b686-d2b33121f96d | nourhan-mohame/codeday12 | 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 |
777245de-cbad-4175-8791-6cada6241ed0 | Anurag-Dutta/DSA | DP/n'thFibonacci_Memoization.cpp | #include "bits/stdc++.h"
#include "conio.h"
using namespace std;
const int N = 10e5;
int dp[N];
int fib(int n)
{
if (n == 0)
{
return 0;
}
if (n == 1)
{
return 0;
}
if (n == 2)
{
return 1;
}
if (dp[n] != -1)
{
return dp[n]; // Memoization : ... | ALGO | 0.99997 | 4.616201 |
5fc32bdf-a112-4334-a947-7288309b9411 | nguyentandata3/cplusplus | Time/0114/BASIC003.cpp | //Đếm số lượng chữ số chẵn của số tự nhiên n.
#include <iostream>
using namespace std;
int demSoLuongSoChan(int n);
int main()
{
//khai bao
int n;
//xu ly
cin>>n;
cout<<demSoLuongSoChan(n);
//tra ve
return 0;
}
int demSoLuongSoChan(int n)
{
int dem = 0;
while (n!=0)
{
if(... | ALGO | 0.999244 | 4.625234 |
e5b5087b-c21f-4f7c-8c5d-3c5e4b2bd00b | kimslor/Coding_Projects | UOA Assignments/COMPSYS202_Discrete_Structures/StringRelation.cpp | #include "StringRelation.h"
#include <unistd.h>
/*
* Assign SetMembers.
*/
void StringRelation::setInput(SetOfStrings *s)
{
SetMembers=s;
}
/*
* It splits a pair "a,b" into a vector of strings "a", "b".
* Returns the string vector.
*/
vector<string> StringRelation::makeTokens(string pair){
vector<string> out;
... | ALGO | 0.992472 | 5.252166 |
2ff8b8ef-b5f2-48ef-a647-1fbc79568abb | prakashupes/CompetitiveProgramming | trie/001_Trie.cpp | #include<iostream>
using namespace std;
typedef struct TrieNode
{
TrieNode *nodes[26];
bool isEnd;
TrieNode()
{
isEnd=false;
for(int i=0;i<26;i++)
{
nodes[i]=NULL;
}
}
} TrieNode;
void insert(TrieNode *root, string word)
{
TrieNode *ref=root;
for(in... | ALGO | 0.999967 | 4.134744 |
b41f3d13-34d2-48a3-9bc6-9b41003ce6d9 | jdlyga/Practice-Problems | 8/robot/robot.cpp | #include <iostream>
#include <deque>
using namespace std;
class PathNode
{
public:
PathNode(int row, int col) : row(row), col(col) {};
int row;
int col;
PathNode * right = NULL;
PathNode * down = NULL;
PathNode * parent = NULL;
};
///////////////////////////////////////////////////////////... | ALGO | 0.999916 | 4.817454 |
03b66aca-f45e-4099-92ab-0b3602c3a14f | Smitascode/DSA-Coding-Challenge | Maximum Strength of a Group.cpp | class Solution {
public:
long long maxStrength(vector<int>& nums) {
if(nums.size()==1)return nums[0];
long long int ans = 1;
int mx = INT_MIN;
bool a = false, b = false;
int c = 0;
for(auto &i: nums){
if(i>0)a = true;
if(i==0)b = true;
... | ALGO | 0.999979 | 5.401921 |
60e368b4-7978-48b4-8eb0-3d433fb6410a | opehn/codetree-TILs | 240916/정렬된 숫자 위치 알아내기/indices-of-sorted-array.cpp | #include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
int nums[n];
int sorted[n];
int result[n];
for(int i = 0; i < n; i++){
cin >> nums[i];
sorted[i] = nums[i];
}
sort(sorted, sorted + n);
for(int i = 0; i < n; i++){
... | ALGO | 0.999995 | 3.971758 |
5c17452f-6ca9-45fb-8c5a-65fafc68baf0 | androschen/codeforces | ArraysSum.cpp | #include<bits/stdc++.h>
#define PI 3.14159265358979323846
#define ll long long int
#define ull unsigned long long int
#define MAX 1000007
using namespace std;
void solve(){
int n,k;
cin>>n>>k;
int a[n];
for(int i=0;i<n;i++){
cin>>a[i];
}
int diff=0;
for(int i=0;i<n-1;i++){
if(a[i]<a[i+1]){
diff++;
}... | ALGO | 0.999823 | 3.653964 |
c5f33b7d-e095-489c-8a3e-b0ff39a80992 | mipt-alexa/4sem | hw3/task4.cpp | #include <iostream>
#include <unordered_set>
#include <string>
#include <utility>
#include <random>
#include <array>
#include <vector>
#include <fstream>
#include <functional>
unsigned int hash0(const char* str, unsigned int length)
{
unsigned int b = 378551;
unsigned int a = 63689;
unsigned int hash... | ALGO | 0.973334 | 5.188904 |
002e099d-dd8c-4826-81a8-abac33dabfe5 | Jackmzw/stanford_algorithm | Algorithm1/Assignment6/2sum.cpp | #include <iostream>
#include <fstream>
#include <unordered_set>
#include <vector>
bool exist_2sum(int t, const std::unordered_set<int64_t>& set){
for(int64_t k : set){
if(2*k != t && set.find(t-k) != set.end()){
return true;
}
}
return false;
}
int main(){
std::ifstream fil... | ALGO | 0.999475 | 4.621156 |
2bbae6dd-1c52-4e80-a11f-fb028f82af49 | ishandutta2007/codeforces | yfhuang/normal/633/A.cpp | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(int argc, const char * argv[]) {
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
bool flag=false;
for(int i=0;i*a<=c;i++){
if((c-i*a)%b==0) flag=true;
}
if(flag) puts("Yes");
else puts("No");
return 0;... | ALGO | 0.999957 | 3.486467 |
fc4c8ec2-63d4-498f-a3f9-af2a7c5c7c35 | chiragsidana/programming | practice/dp/bitonic_subsequence.cpp | #include <bits/stdc++.h>
//#define int long long
#define endl "\n"
#define PI 3.141592653589793238
#define MOD 1000000007
#define FastIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define vi vector<int>
#define vb vector<bool>
#define vc vector<char>
#define pii pair<int,int>
#define vvi vector<vector<int>>
#defi... | ALGO | 0.99972 | 3.554953 |
4a68ac7c-d4cd-47d1-a188-877725b6f262 | pegasus-lynx/Junk | CS203_Algorithms/opt_sieve.cpp | // C++ program to generate all prime numbers less than N in O(N).
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll MAX_SIZE = 10000001;
// isPrime[] : isPrime[i] is true if number is prime
// prime[] : stores all prime number less than N
// SPF[] : stores the smallest prime factor of a... | ALGO | 0.999933 | 5.119997 |
53edf985-b7b5-4ac6-b049-64b22f5a9089 | tudelft3d/PSSNet | step-1/3rd_party/CGAL/examples/Periodic_2_triangulation_2/p2t2_hierarchy.cpp | #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
#include <CGAL/Periodic_2_Delaunay_triangulation_traits_2.h>
#include <CGAL/Periodic_2_triangulation_hierarchy_2.h>
#include <CGAL/Periodic_2_triangulation_face_base_2.h>
#include <CGAL/Triangulation_h... | ALGO | 0.984184 | 4.901959 |
a8afb653-25f8-45bd-b57f-036b46aa9364 | viftode4/PBINFOOOO | Info/Stock Arbitraging/main.cpp | #include <bits/stdc++.h>
using namespace std;
int n, m, mini = 9999999, maxi, sum;
int main()
{
cin >> n >> m >> sum;
for( int i = 1; i <= n; i++ )
{
int x;
cin >> x;
mini = min( x, mini );
}
for( int i = 1; i <= m; i++ )
{
int x;
... | ALGO | 0.999958 | 3.635124 |
ddcbd0c9-2f25-4875-86d9-7b8b16aca2d5 | PorametKeawubol/codef | 2024/fdsdf.cpp |
#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(), a.end()
#define pb push_back
#define sz(a) ((int)a.size())
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
using pii = pair<int, int... | ALGO | 0.999931 | 5.596957 |
ed7c0656-8505-4d91-9710-966d6d83f4d9 | ShashiRanjan1211/CNS_LAB | rsa.cpp | #include <iostream>
#include <cmath>
#include <bits/stdc++.h>
#include <vector>
using namespace std;
bool isPrime(int n)
{
if (n <= 1)
{
return false;
}
for (int i = 2; i <= sqrt(n); i++)
{
if (n % i == 0)
{
return false;
}
}
return true;
}
int ... | ALGO | 0.999678 | 4.860394 |
93305c39-8b97-4bfd-b70e-892e71502d22 | egor-lobarev/algorithms | Q.cpp | #include <iostream>
int main() {
int N;
std::cin >> N;
long long S = 0;
int a, b;
for (int i = 0; i < N; i++) {
std::cin >> a >> b;
if (b > a) {
std::swap(a, b);
}
S += a;
}
std::cout << S;
return 0;
} | ALGO | 0.999919 | 3.9054 |
3deb8f5c-fe36-4efe-a02d-d49ba17d30a6 | hashiryo/Library | test/yukicoder/911.test.cpp | // competitive-verifier: PROBLEM https://yukicoder.me/problems/no/911
// competitive-verifier: TLE 0.5
// competitive-verifier: MLE 128
#include <iostream>
#include <vector>
#include <algorithm>
#include "src/Misc/Automaton.hpp"
using namespace std;
signed main() {
cin.tie(0);
ios::sync_with_stdio(0);
int N;
cin >>... | ALGO | 0.999788 | 3.557041 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.