uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
14cbb77a-7dab-48b8-86a7-453757aa99b5 | ankyyy/naive | quick.cpp | #include <iostream>
using namespace std;
int partition(int arr[],int start,int end)
{
int pivot=arr[end];
while(start<end)
{
if(arr[start]<pivot)
start++;
if(arr[end]>pivot)
end--;
if(arr[start]==arr[end])
start++;
else if(start<end)
{
int temp=arr[start];
arr[start]=arr[end];
arr[end]=t... | ALGO | 0.99986 | 3.662136 |
9f68e2c3-0f71-426e-98c3-5cd42b3d4ac4 | ghazal1998rabiei/Kattis | lostlineup.cpp | #include <bits/stdc++.h>
using namespace std;
int n, a[103], x;
int main(){
cin >> n;
a[0] = 1;
for(int i = 2; i <= n; i++){
cin >> x;
a[x + 1] = i;
}
for(int i = 0; i < n; i++)
cout << a[i] << " ";
cout << endl;
} | ALGO | 0.999959 | 3.394583 |
e5a3f2a8-5f2a-4e11-8996-495bb6a46c59 | ngoctrung344/AVL_THCTDL-TG | AVL/AVL/Main.cpp | #include "Header.h"
int main() {
treeAVL root;
init(root);
int choice,n;
int value;
while (true) {
printMenu();
cin >> choice;
switch (choice) {
case 1:
cout << "Nhap gia tri phan tu can chen: ";
cin >> n;
for (int i = 0; i < ... | ALGO | 0.99836 | 3.902337 |
bc06ff94-0248-4111-acc9-68628a81188e | jmanday/Master | TFM/library/boost_1_63_0/libs/signals/example/maximum.cpp | // Boost.Signals library
// For more information, see http://www.boost.org
#include <algorithm>
#include <iostream>
#include <boost/signals/signal2.hpp>
template<typename T>
struct maximum {
typedef T result_type;
template<typename InputIterator>
T operator()(InputIterator first, InputIterator last) const
{... | ALGO | 0.910319 | 5.350942 |
70bf880e-0fb5-4001-906f-d4f4dc06ab08 | crazy-kid/learning-boost | boost_1_88_0/libs/compute/perf/perf_stl_search.cpp | #include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
#include "perf.hpp"
int rand_int()
{
return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);
}
int main(int argc, char *argv[])
{
perf_parse_args(argc, argv);
std::cout << "size: " << PERF_N << std::endl;
// create ve... | ALGO | 0.983287 | 5.696832 |
cda3f85f-309b-4728-9384-bc9cbd72d1e8 | mushkul/Vanderbilt-CP | solutions/gpt-4o/1076.cpp | #include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> x(n);
for (int i = 0; i < n; ++i) {
cin >> x[i];
}
multiset<int> low, high;
auto add = [&](int val) {
if (low.empty() || val <= *low.rbegin()) {
... | ALGO | 0.999997 | 3.913718 |
4dd5c816-ecef-4383-bd9f-7afd28017e40 | SoldierDown/vtk | ThirdParty/verdict/vtkverdict/V_WedgeMetric.cpp | /*
*
* WedgeMetric.cpp contains quality calculations for wedges
*
* This file is part of VERDICT
*
*/
#include "VerdictVector.hpp"
#include "verdict.h"
#include <algorithm>
#include <cmath> // for std::isnan
namespace VERDICT_NAMESPACE
{
extern double tri_equiangle_skew(int num_nodes, const double coordinates[... | TOOL | 0.993789 | 5.494377 |
00176b70-0870-493c-b750-38e778b21050 | Beisenbek/Summer2021PP1 | w2/day1/14.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main(){
string str = "49";
int x = atoi(str.c_str());
cout << sqrt(x) << endl;
int y = stoi(str);
cout << sqrt(x) << endl;
return 0;
} | ALGO | 0.99442 | 3.34679 |
1f454997-b428-48d6-aa60-f2f9d4f114d9 | poneciak57/OI-prep-2023-2024 | archive1-11.11.2k23/EKAP_kaprekar/main.cpp | #include <bits/stdc++.h>
#include <cmath>
typedef long long ll;
typedef std::string str;
template <typename T>
using vec = std::vector<T>;
ll num_sum(ll num) {
ll sum = 0;
while(num > 0) {
sum += num % 10;
num /= 10;
}
return sum;
}
ll how_much_go_back(ll num) {
return ((ll)log10(num) + 1) * 9;
}
... | ALGO | 0.999921 | 5.727246 |
a9fc9f2a-ea25-4086-9650-1d8b285979d2 | timduru/platform-frameworks-base | tools/split-select/Main.cpp | #include <algorithm>
#include <cstdio>
#include "aapt/AaptUtil.h"
#include "Grouper.h"
#include "Rule.h"
#include "RuleGenerator.h"
#include "SplitDescription.h"
#include "SplitSelector.h"
#include <androidfw/AssetManager.h>
#include <androidfw/ResourceTypes.h>
#include <utils/KeyedVector.h>
#include <utils/Vector.h... | TOOL | 0.978914 | 6.459566 |
fb1f1edc-c7d1-4b6d-a385-1b3bf29248bb | Apapath77/Custom_llvm_Project | llvm/lib/CodeGen/BranchFolding.cpp | #include "BranchFolding.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/ProfileSummaryInfo.h"
#include "llvm/CodeGe... | ALGO | 0.999271 | 4.13128 |
fd59c731-8c86-4301-b262-da5bc5df2125 | xfDing815/ORBSLAM2_RGBD_AR | Thirdparty/g2o/g2o/stuff/string_tools.cpp | #include "string_tools.h"
#include "os_specific.h"
#include "macros.h"
#include <cctype>
#include <string>
#include <cstdarg>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <iterator>
#if (defined (UNIX) || defined(CYGWIN)) && !defined(ANDROID)
#include <wordexp.h>
#endif
name... | TOOL | 0.872157 | 6.049948 |
83daf0c5-db4e-40c5-b595-46318ac84acd | nicoesve/riemtan | src/log_euclidean_cpp.cpp | #include <RcppEigen.h>
// [[Rcpp::depends(RcppEigen)]]
// Forward declarations
Eigen::MatrixXd safe_logm_cpp(const Eigen::MatrixXd& X);
Eigen::MatrixXd dexp_cpp(const Eigen::MatrixXd& a, const Eigen::MatrixXd& x, int num_points = 100);
Eigen::MatrixXd dlog_cpp(const Eigen::MatrixXd& sigma, const Eigen::MatrixXd& h, in... | ALGO | 0.998572 | 5.828492 |
63b88414-07ac-4dfe-8672-83b15899c57a | gz7seven/PCL | examples/outofcore/example_outofcore.cpp | #include <pcl/io/pcd_io.h>
#include <pcl/console/print.h>
#include <pcl/point_types.h>
#include <pcl/PCLPointCloud2.h>
#include <pcl/outofcore/outofcore.h>
#include <pcl/outofcore/outofcore_impl.h>
#include <pcl/outofcore/boost.h>
using namespace pcl::outofcore;
typedef OutofcoreOctreeBase<OutofcoreOctreeDiskContai... | ALGO | 0.961043 | 6.621573 |
046ae022-f23d-4471-b065-1e86ccd50f45 | whs24/2025-Qt | hw/1/HW1 Q3/Main.cpp | #include "TemplateMax.h"
#include <string>
#include <iostream>
using namespace std;
int main()
{
int i = 1;
int j = 2;
cout << "Max(i, j): " << Max(i, j) << endl;
double f1 = 11.1;
double f2 = 22.2;
cout << "Max(f1, f2): " << Max(f1, f2) << endl;
string s1 = "AAAAA";
string s2 = "BBBBB";
cout << "Max(s1, s2):... | ALGO | 0.943348 | 4.235347 |
7386e84b-52a9-405e-a9fa-fd651ca37704 | Mr-Wiseguy/tex_sampling_rom | tools/soundconv/main.cpp | #include <cstdint>
#include <cstdlib>
#include <iostream>
#include <filesystem>
#include <vector>
#include <unordered_set>
#include <fmt/core.h>
#include "wave.h"
#include "fx.h"
#include "aifc.h"
namespace fs = std::filesystem;
using namespace std::string_literals;
std::unordered_set sample_extensions {
".wav"... | TOOL | 0.886201 | 6.427413 |
a7757158-605b-481a-8e30-05a98746c3a5 | ankan-ekansh/Competitive-Programming | Codeforces practice/1108C.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
ll modularExponentiation(ll x,ll n,ll M){
if(n==0)
return 1;
else if(n%2 == 0)
return modularExponentiation((x*x)%M,n/2,M);
return (x*modularExponentiation((x*x)%M,(n-1)/2,M))%M;
}
ll binaryExponentiation(ll x,ll n){
if(n=... | ALGO | 0.999982 | 3.88559 |
df53d6eb-f00a-4b41-a837-84efdb2e3a43 | rndudals/Algorithm_PS | 프로그래머스/정수 삼각형.cpp | #include <string>
#include <vector>
using namespace std;
int arr[501][501];
int dp[501][501];
int solution(vector<vector<int>> triangle) {
int size = triangle.size();
int answer = 0;
for(int i=0;i<size;i++){
for(int j=0;j<=i;j++){
arr[i+1][j+1]=triangle[i][j];
}
}
int m... | ALGO | 0.999949 | 5.364895 |
88760367-277e-44bf-8632-bc5811a0e3fc | Yosuamuliawan19/algorithm-bank | Past Contests/Indonesia_National_Competition_2017/incprep/c.cpp | #include<iostream>
#include<stdio.h>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cctype>
#include<iomanip>
#include<vector>
using namespace std;
int main(int argc, char const *argv[])
{
string a, b;
while ( cin >> a ){
}
while(getline(cin , a)){
getline(cin , b);
long long... | ALGO | 0.999734 | 3.907419 |
00c24097-17e5-4b6e-b8ad-63f142bb5e62 | sahanurmondal/competitive-programming | URI/even-and-odd-1259.cpp | // author: Rodrigo Alves
// judge: URI
// problem: Even and Odd
// url: https://www.urionlinejudge.com.br/judge/en/problems/view/1074
// status: AC
#include <bits/stdc++.h>
using namespace std;
int main()
{
long N, number;
scanf("%ld", &N);
vector<long> even_numbers;
vector<long> odd_numbers;
while (N--) {... | ALGO | 0.999174 | 4.742967 |
2c7f8a5b-1720-453e-995c-a32e08c6891c | jayjay1509/ecole | c++/projet 06.09.20223/chasse au tresor/maps chasse au tresor.cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
#include "calcu chasse au tresore.h"
int cases[width * height];
#define width 4
#define height 4
//c'est pour randomiser un nombre de l'array qui fais 4 par 4 pour savoir se se trouvera le tresor
int tresor() {
int randomValue = rand() % (width * height);
... | TOOL | 0.872436 | 3.173344 |
400e3262-1441-420d-8fed-f9e303f32ec6 | GyanPrakashRaj/dsacamp | 01 Arrays & Vectors/pairs 03.cpp | #include<iostream>
#include<vector>
#include<unordered_set>
using namespace std;
vector<int> pairSum(vector<int> arr,int Sum){
//Logic
unordered_set<int> s;
vector<int> result;
for(int i=0;i<arr.size();i++){
int x = Sum - arr[i];
if(s.find(x)!=s.end()){
result.push_back(x);
result.push_back(arr[i]);
... | ALGO | 0.999988 | 4.724313 |
325c7602-0f8e-4ff7-99d9-4567c4bcbcff | Tonmoy-saha18/Data-Structure | Project181/Project181/Source.cpp | #include<stdio.h>
#include<stdlib.h>
struct node
{
int value;
node *next;
};
struct node *insert(node *s,int value)
{
struct node *current;
struct node *newnode=(node*)malloc(sizeof(node));
newnode->value=value;
newnode->next=NULL;
if(s==NULL)
{
s=newnode;
}
else
{
current=s;
while(current->next!=NULL)... | ALGO | 0.999937 | 3.233373 |
e77c40e5-2b98-4739-a9ac-3bcc929e7174 | sohag16030/ACM-Programming | Uva/uva11332.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int fun(ll n)
{
int s=0,rem;
while(n>0)
{
rem=n%10;
s=s+rem;
n=n/10;
}
if(s>9)
fun(s);
else if(s>=1&&s<=9)
return(s);
}
int main()
{
ll n,m,i,j,k,l;
while(cin>>m)
{
if(m... | ALGO | 0.999958 | 4.40903 |
67f0bfc4-7302-4e3c-94c3-5abc23e20e5c | ToothedTomb/c-BathSpaUni | Chapter-5-Functions/Exercises/GoCompare.cpp | /*
Write a program that passes two Strings into a function called compareStrings.
This function should test whether or not the two Strings have the same value.
If the Strings are equal, the function should return the boolean value TRUE to the main function,
otherwise it should return the boolean value FALSE. Final... | TOOL | 0.984528 | 5.177701 |
ae9387b1-ecca-463d-8324-0ff58f87e043 | ishandutta2007/codeforces | gromah/normal/1141/A.cpp | #include <cstdio>
#include <algorithm>
using namespace std;
int a, b;
int Get(int x, int y)
{
if (y % x) return -1;
y /= x;
int res = 0;
for (; y > 1 && (y % 2 == 0 || y % 3 == 0); res ++)
y /= (y % 2 == 0 ? 2 : 3);
return y == 1 ? res : -1;
}
int main()
{
scanf("%d%d", &a, &b);
p... | ALGO | 0.999978 | 4.050088 |
ba5bfbcd-1e60-472d-8f05-b6780f325628 | randompitch/Data-Structures-Algorithms | Recursion/basics(pow n fib).cpp | #include <iostream>
#include <vector>
using namespace std;
#define mod = 1e9+7
vector<int> se;
int pow(int n, int p){
if(p==1) return n;
else{
return n * pow(n,p-1);
}
}
int fib(int n){
if(n==0 || n==1) return n;
else return fib(n-1) + fib(n-2);
}
int main()
{
cout ... | ALGO | 0.999511 | 4.211294 |
8fdcb24d-90ae-408e-a09d-ec58740d8c09 | Richmond-Antor/Codechef-Problem-solving-rating-100-to-500 | Overspeeding Fine.cpp | #include<iostream>
using namespace std;
int main(){
int t,x;
cin>>t;
for( int i =1; i<=t; i++){
cin>>x;
if( x<=70){
cout<<0<<endl;
}
else if(x>70 && x<=100){
cout<<500<<endl;
}
else{
cout<<2000<<endl;
}}
}
| ALGO | 0.999425 | 3.509889 |
e2193b3f-10e4-424a-a382-e6389b74c51b | 52North/IlwisObjects | core/geos/src/noding/IntersectionFinderAdder.cpp | #include <vector>
#include <geos/noding/IntersectionFinderAdder.h>
#include <geos/noding/SegmentString.h>
#include <geos/noding/NodedSegmentString.h>
#include <geos/algorithm/LineIntersector.h>
#include <geos/geom/Coordinate.h>
using namespace geos::geom;
namespace geos {
namespace noding { // geos.noding
void
Inte... | ALGO | 0.998586 | 5.315789 |
8e37916d-53c2-43f9-806e-ab121769e0cc | MasterKtos/EvoSim | Source/EvoSim/AI/Pathfinding/AIManager.cpp | #include "AIManager.h"
#include "AINode.h"
#include "AINodeHeap.h"
#include "EvoSim/Map/Tile.h"
// Sets default values
AAIManager::AAIManager()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = false;
}
// Called whe... | ALGO | 0.96437 | 4.686555 |
e6b49fcb-5e5d-43e1-9661-1a8e1cab02bf | moa20016/CSE3150 | Exercise1/t4.cpp | #include <iostream>
#define MAX(a,b) (a < b) ? b : a
using namespace std;
int main() {
int a = 5, b = 10;
cout << "a is "
<< a
<< " and b is "
<< b
<< endl;
int aa = a, bb = b;
int a_save = a, b_save = b;
int m = MAX(a++,b++);
int mm = max(aa++,bb++);
cout << "max of ... | ALGO | 0.987355 | 3.623084 |
6f8269c9-fad2-4a8e-842c-8679cc013ef4 | jpdotcom/comp_prog-archive | Auto_Upload_Codeforces/Codeforces_Round_788_Div_2/D_Very_Suspicious.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define FOR(b) for(int i=0;i<b;i++)
typedef std::vector<int> vi;
typedef std::pair<int,int> pi;
#define mp(a,b) make_pair(a,b)
typedef long long ll;
typedef std::priority_queue<pi> pq;
#define end... | ALGO | 0.999657 | 3.780202 |
c5154b1e-19cc-4b01-9fca-d65980d9694d | 113bommy/LogicalErrorFixCodeT5 | logicalErrorFix_CodeT5_Linenumber/model/cpp/CodeT5_LineNumber_cpp_gold/Problem_164_gold_757.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 50, LOGN = 17;
const int INF = (int)1e9;
int n, k;
int ord[N], in[N], tim = 0;
char las[N];
int lc[N], rc[N];
int res[N];
string str;
void dfs(int v) {
if (lc[v] != -1) dfs(lc[v]);
ord[tim] = v;
in[v] = tim++;
if (rc[v] != -1) dfs(rc[v]);
}
void sol... | ALGO | 0.999991 | 3.978198 |
82c3659f-cd94-4a1b-b712-7ff7b05ac1d2 | RoshanFarakate/LeetCodeDSA | LinkedList/206.ReverseALinkedList.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* reverseList... | ALGO | 0.999763 | 5.762436 |
1fc2d8eb-22f6-4ae3-a6fe-47248aef5a40 | underscoreanuj/Codes | LeetCode/1-100/70_climbing_stairs.cpp | class Solution
{
public:
int climbStairs(int n)
{ // simply fibonacci numbers
if (n <= 0)
return 0;
if (n == 1)
return 1;
if (n == 2)
return 2;
int f = 1, s = 2, ret = 0;
for (int i = 0; i < n - 2; ++i)
{
ret = f + ... | ALGO | 0.999951 | 5.776711 |
a33055f2-5fa5-4684-a0dc-79a844358679 | coolyuyuyu/leetcode | algorithm_1000-1999/1291-Sequential Digits/main.cpp | class Solution {
public:
vector<int> sequentialDigits(int low, int high) {
queue<int> q;
for (int d = 1; d <= 9; ++d) {
q.push(d);
}
vector<int> ret;
while (!q.empty()) {
int num = q.front();
q.pop();
if (num > high) {
... | ALGO | 0.999955 | 6.38819 |
7b7263a7-ac03-4b7b-a23e-2d61216fc3a7 | chaithanya580/Data-structure- | insertion sort.cpp | #include <stdio.h>
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
void printArray(int... | ALGO | 0.999987 | 5.545618 |
ac1411c0-ec6c-4f63-b7d3-25314aefffa1 | qq456cvb/RealTimeTrack | RealTimeTrack/TraceWorker.cpp | #include "TraceWorker.hpp"
#include "TraceManager.hpp"
#include "Configuration.hpp"
TraceWorker::TraceWorker(TraceManager* manager, int id)
{
this->delegate = manager;
this->id = id;
reconstruction = new Reconstruction ( *delegate->getRefMesh(), *delegate->getRealCamera(), wrInit, radiusInit, nUnCons... | TOOL | 0.856579 | 4.937091 |
943c5c37-32d6-4193-afee-d8f9f0383084 | kohyatoh/contests | pku/2424/2424.cpp | #include <stdlib.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
int size[3];
vector<int> v[3];
int to_time(const string& s) { return atoi(s.c_str())*60+atoi(s.c_str()+3); }
int main() {
for(;;) {
rep(i, 3) cin >> size[i];... | ALGO | 0.992469 | 3.64697 |
b648c737-0af9-4efc-b19a-1a0379f450ff | lakshya-8000cr/DSA | LINKEDLIST/reverselinkedlist.cpp | #include<iostream>
#include<vector>
using namespace std ;
class Node {
public:
int data ;
Node* Next;
public:
Node(int data1 , Node* Next1){
data = data1;
Next = Next1;
}
public:
Node(int data1){
data = data1;
Next = nullptr;
}
};
Node* Convert(v... | ALGO | 0.999369 | 5.051224 |
b4c9d14b-20e9-4209-8402-593ce6c58993 | richcole/Griff | sarl3/sarl_sat_main.cpp | #include "sarl_sat.h"
#include <errno.h>
int main(int argc, char **argv)
{
if ( argc != 2 ) {
fprintf(stderr, "Usage: sarl_sat <input.cnf>\n");
exit(-1);
}
FILE *inp = fopen(argv[1], "r");
if ( ! inp ) {
fprintf(stderr, "Error: unable top open file: '%s'\n", argv[1]);
fprintf(stderr, " %s\n... | ALGO | 0.994785 | 4.220763 |
31650076-bab8-4b57-a508-fc2e81f4eb12 | Abhinav-Kosta/ACC45DAYSOFCODE-2024 | Day25-Chef_And_Strings.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin >> t;
while(t--){
int n;
cin >> n;
long long sum = 0;
vector<int> arr(n);
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = 1; i < n; i++){
sum ... | ALGO | 0.99966 | 4.595119 |
a4f7d49c-e7fd-4033-b37d-f88bc6c410a4 | awaisaltaf5/DSA-LAB-CODE | Task7_LinearSearch.cpp | #include <iostream>
using namespace std;
int main()
{
int length = 5;
int arr[5] = {1, 2, 3, 4, 5};
int flag = 0;
int element;
cout << "Enter Element to search:";
cin >> element;
int i = 0;
while (i < length)
{
if (arr[i] == element)
{
flag++;
... | ALGO | 0.99655 | 3.920397 |
3d371af7-e1cb-492b-8b58-5727ac561401 | SimonBerens/competitive-programming | problems/codeforces/1190/B.cpp | // https://codeforces.com/contest/1190/problem/B
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<typename K> using hset = gp_hash_table<K, null_type>;
template<typename K, typename V> using hmap = gp_hash_table<K, V>;
using namespace std;
#define all(x) (x).be... | ALGO | 0.999971 | 3.870893 |
d344fd85-c18e-49c3-93d2-2dbc2d99d0e6 | gauri-singh/LeetCodeQuestions | 821-shortest-distance-to-a-character/821-shortest-distance-to-a-character.cpp | class Solution {
public:
int findMinDistance(int index, vector<int> occurence){
int min =9999;
for(int i=0;i<occurence.size();i++){
if(min> abs(occurence[i]-index)){
min=abs(occurence[i]-index);
}
}
return min;
}
vector<int> fillOcc... | ALGO | 0.999983 | 5.850362 |
61b05e2b-ca46-4b14-8f00-bbe5406f843e | MakinoRuki/TopCoder | SRM754Div1Easy.cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <unordered_set>
#define N 3010
using namespace std;
typedef long long ll;
class MoreSquares {
public:
int X[N], Y[N];
int countLocations(int n, int sx, int sy, vector <int> xp, vector <int> yp) {
unordered_s... | ALGO | 0.999773 | 3.488631 |
2c11bcb2-0885-4589-8e9b-1893de2494e9 | owlpaw20/CPArchive | NOIP & CSP/[NOIP 2022] 建造军营.cpp | #include <stack>
#include <vector>
#include <cstring>
#include <iostream>
namespace FastIO {
const int MAX_BUF = 1 << 20;
char buf[MAX_BUF], *__p1, *__p2;
char pbuf[MAX_BUF], *pp = pbuf;
char getchar() { return (__p1 == __p2 && (__p2 = (__p1 = buf) + fread(buf, 1, MAX_BUF, stdin), __p1 == __p2) ? EOF : *__p1+... | ALGO | 0.999826 | 4.741029 |
bcdc1b79-27ac-431b-b2f0-cd02f5ebeb97 | HuangStomach/leetcode | 801-900/844.cpp | /**
* 844. 比较含退格的字符串
* 给定 S 和 T 两个字符串,当它们分别被输入到空白的文本编辑器后,判断二者是否相等,并返回结果。 # 代表退格字符。
* 注意:如果对空文本输入退格字符,文本继续为空。
*/
#include <string>
using namespace std;
class Solution {
public:
bool backspaceCompare(string S, string T) {
int i = S.length() - 1, j = T.length() - 1;
int skipS = 0, skipT = 0;
... | ALGO | 0.998056 | 5.727314 |
5bace225-6626-4446-9661-9d1aee0d8bcf | fginez/easter | DataPascoa/Pascoa_Gauss.cpp | #include "Pascoa_comum.h"
#include "Pascoa_Gauss.h"
void getValores_Gauss(const unsigned int ano, unsigned int* x, unsigned int* y)
{
if ( 1582 <= ano && 1699 >= ano ) {
*x = 22;
*y = 2;
}
else if ( 1700 <= ano && 1799 >= ano ) {
*x = 23;
*y = 3;
}
else if ( 1800 <= ano && 1899 >= ano ) {
*x = 23;
*y ... | ALGO | 0.996698 | 4.529662 |
5f8e5fe3-8418-47f5-9bd0-5d83e1f9a611 | yukienomiya/competitive-programming | UVa/11332_Summing_Digits/main.cpp | #include <iostream>
#include <string>
using namespace std;
int main() {
int value;
while (cin >> value) {
if (value == 0) break;
while (value >= 10) {
string s = to_string(value);
value = 0;
for (int i = 0; i < s.length(); i++) {
value += s[i] - '0';
}
}
cout << val... | ALGO | 0.999816 | 4.758641 |
ea419e8a-cbe2-4937-82b7-ded4be78aa98 | iamRishant/Leetcode | 3751-maximum-frequency-after-subarray-operation/maximum-frequency-after-subarray-operation.cpp | class Solution {
public:
int maxFrequency(vector<int>& nums, int k) {
int ans=0;
set<int> st;
int n=nums.size();
for(int i=0;i<n;i++){
if(nums[i]==k) ans++;
st.insert(nums[i]);
}
int maxi=0;
for(auto it: st){
int cu... | ALGO | 0.999947 | 6.214471 |
19d97887-6313-4ae1-ba6e-7b87962e7d08 | anujsoni1228/LeetCode-Questions | 0374-guess-number-higher-or-lower/0374-guess-number-higher-or-lower.cpp | /**
*Forward declaration of guess API.
*@param num your guess
*@return -1 if num is higher than the picked number
* 1 if num is lower than the picked number
* otherwise return 0
*int guess(int num);
*/
class Solution
{
public:
int guessNumber(int n)
{
... | ALGO | 0.999985 | 5.375536 |
a97d36cb-66d6-4f39-8a80-4ce769a9f25f | ZhouWeikuan/zoj | zju.finished/1269.cpp | #include<iostream>
using namespace std;
// ret value indicate :
// > 0 a valid result
// ==0 not valid and may continue
// < 0 a unvalid result and break immediately;
int calc(int p, int n){
int left = p;
int ret = 1;
while(left){
if(n%p !=1 )
ret = 0;
n = n - n/p - 1;
if(n < 0)
return -1;
lef... | ALGO | 0.999931 | 3.942954 |
25bc4712-b9d6-425e-b9b9-8b239a7cc7f7 | ljy9912/ORB_slam3_ros2 | src/ORB_SLAM3/Thirdparty/eigen-3.4.0/doc/examples/Tutorial_BlockOperations_colrow.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::MatrixXf m(3,3);
m << 1,2,3,
4,5,6,
7,8,9;
cout << "Here is the matrix m:" << endl << m << endl;
cout << "2nd Row: " << m.row(1) << endl;
m.col(2) += 3 * m.col(0);
cout << "After adding 3 times the first colu... | ALGO | 0.968426 | 3.576145 |
a114aeac-d03a-4425-af01-085557b7c802 | Kunallion/LeetCode | 0190-reverse-bits/0190-reverse-bits.cpp | class Solution {
public:
uint32_t reverseBits(uint32_t n) {
int i, count=0;
uint32_t num=0;
vector<int> arr;
while(n>0)
{
i = n%2;
n = n/2;
arr.push_back(i);
count++;
}
if(count<32)
{
for(i=0 ... | ALGO | 0.999964 | 5.822867 |
34e499d1-5c09-46ec-93c7-ab25442d20fa | ragu-manjegowda/self-driving-car | Term02-SensorFusion-Localization-and-Control/MPC-Quizzes/mpc_to_line/src/Eigen-3.3/bench/benchEigenSolver.cpp |
// g++ -DNDEBUG -O3 -I.. benchEigenSolver.cpp -o benchEigenSolver && ./benchEigenSolver
// options:
// -DBENCH_GMM
// -DBENCH_GSL -lgsl /usr/lib/libcblas.so.3
// -DEIGEN_DONT_VECTORIZE
// -msse2
// -DREPEAT=100
// -DTRIES=10
// -DSCALAR=double
#include <iostream>
#include <Eigen/Core>
#include <Eigen/QR>
#in... | TOOL | 0.987255 | 5.772194 |
9dd3a2d9-7778-49a1-9fff-4f8d7cf9bbb4 | ShafayetSadi/GeeksforGeeks | Data Structures and Algorithms/07. Sorting/03_selectionSort.cpp | /*
Selection sort finds the minimum or maximum element in the array and swap that
with the first or last element.
Selection sort does less memory writes compared to quicksort, mergesort,
insertionsort etc. But Cycle sort is optimal in terms of memory writes.
It is the basic idea for Heap Sort.
It is not a stable sort ... | ALGO | 0.999945 | 5.088668 |
212e02b1-793d-424f-9937-4b40d2b95daa | Endlessodds/My-C- | Projects/Project43.cpp | #include <iostream>
using namespace std;
void sumAndAverage(int arr[], int size) {
int sum = 0;
for (int i = 0; i < size; i++) {
sum += arr[i];
}
double average = (double)sum / size;
cout << "Sum: " << sum << ", Average: " << average << endl;
}
int main() {
int arr[100], size;
cout... | TOOL | 0.979379 | 6.25178 |
716cb362-85e3-45f2-ab71-dce4a48b7abc | Kecheng-Ye/My_Leetcode | Problem/By section/LinkedList/Problem 328/problem_328.cpp | #include <bits/stdc++.h>
using namespace std;
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* oddEvenList(ListNode* head) {... | ALGO | 0.999957 | 5.89969 |
fc2cf5ea-20ab-4d1e-a490-725c368ead27 | gilbertoalexsantos/judgesolutions | Solved/UVA/@UVA 11495 - Bubbles and Buckets/11495 - Bubbles and Buckets.cpp | //Author: Gilberto Alexandre dos Santos
//Website: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2490
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int passos = 0;
int array[100000];
void merge(int vetor[], int inicio, int meio, int fim) {
... | ALGO | 0.999963 | 4.366399 |
ee9f1c6a-d074-4ad3-b560-aa8b9c5a72da | sgc109/problem_solving | boj/15944.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 0x3c3c3c3c;
const ll infl = 0x3c3c3c3c3c3c3c3c;
struct Node{
int i, j, d;
};
int N, M, D;
string pane[503];
int dist[503][503];
bool in_range(int i, int j){
return 0 <= i && i < N && 0 <= j && j < M;
}
bool is_cand(int i, int ... | ALGO | 0.999814 | 4.953306 |
68f7d497-288f-4e31-8ccc-508be84e4097 | KyroNa/old_LINC_PIXY_ROS | linc_pixy_ros/libpixyusb/common/src/calc.cpp | #include "calc.h"
void hsvc(uint8_t r, uint8_t g, uint8_t b, uint8_t *h, uint8_t *s, uint8_t *v, uint8_t *c)
{
uint8_t min, max, delta;
int hue;
min = MIN(r, g);
min = MIN(min, b);
max = MAX(r, g);
max = MAX(max, b);
*v = max;
delta = max - min;
if (max>50)
{
//if (delt... | TOOL | 0.954232 | 4.342352 |
c6b55bfe-213b-4b79-9870-ed82e8da1dd8 | Xuechun-Hu/possion_reconstrction | libigl/tutorial/203_CurvatureDirections/main.cpp | #include <igl/avg_edge_length.h>
#include <igl/cotmatrix.h>
#include <igl/invert_diag.h>
#include <igl/massmatrix.h>
#include <igl/parula.h>
#include <igl/per_corner_normals.h>
#include <igl/per_face_normals.h>
#include <igl/per_vertex_normals.h>
#include <igl/principal_curvature.h>
#include <igl/read_triangle_mesh.h>
... | ALGO | 0.968948 | 5.776041 |
11a77bd1-a1d4-4ece-ab42-1bfdf9e3723a | ishandutta2007/codeforces | kshitij_sodani/normal/1616/C.cpp | //#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl '\n'
llo it[101];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
llo t;
cin>>t;
while(t--){
llo ... | ALGO | 0.999896 | 3.775214 |
e1af5f05-5457-45af-befe-109abec18773 | zarif98sjs/Competitive-Programming | AtCoder/Contest/Beginner Contest 175/E.cpp |
/** Which of the favors of your Lord will you deny ? **/
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define F first
#define S second
#define ALL(x) (x).begin(), (x).end()
#define READ freopen("alu.txt", "r", stdin)
#define WRITE ... | ALGO | 0.999452 | 3.994115 |
dc6d4ea2-459e-4a60-a6a5-be989b7c960e | ujjuengineer/DSA-with-CPP | module-8 array and vector/d.arrayAndPointer2.cpp | #include<iostream>
using namespace std;
int main() {
int arr[]={4,2,6,1,7};
int* ptr = arr; // giving address of arr to pointer
cout<< *ptr<<"\n"; //same as cout<< ptr[0]; this printed out first element of array this is because avi pointer me array ka address hai and we know address of array = addr. of 1s... | ALGO | 0.996919 | 3.566087 |
1bd765ec-4b62-4e58-8f1b-eda3b4f27ff7 | seanjparker/competitive-programming | CodeForces/Contests/1005/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int m;
for (int i=0;i<n;i++){
cin>>m;
cout<<m-!(m&1)<<" ";
}
cout<<endl;
}
| ALGO | 0.999969 | 3.679298 |
7a23c107-f3af-4bd8-8f9b-01e0cb8b700b | RadhikaMohanan/Solved_problems | 9520/main.cpp | #include <iostream>
#include <cmath>
//441. Arranging Coins
using namespace std;
int main()
{
cout << "Enter the number" << endl;
int n;
cin>>n;
int ct=0;
unsigned int num = 2 * n;
int ans = static_cast<int>(sqrt(num + 0.25) - 0.5);
cout<<ans<<endl;
return 0;
}
| ALGO | 0.999351 | 3.663618 |
a748cead-ece2-4b3e-96af-1334819ad9d6 | rudrakh22/CodingNinjas-DSA-course | TREE/SecondLargest.cpp | #include <iostream>
#include <queue>
#include <vector>
using namespace std;
template <typename t>
class TreeNode
{
public:
t data;
vector<TreeNode<t> *> children;
TreeNode(t data)
{
this->data = data;
}
~TreeNode()
{
for (int i = 0; i < children.size(); i++)
{
... | ALGO | 0.999592 | 3.943116 |
c968cdfa-fd77-4318-b078-459d0f106b6a | MainFrameKuznetSov/LeetCode | 391-perfect-rectangle/perfect-rectangle.cpp | class Solution {
public:
bool isRectangleCover(vector<vector<int>>& rectangles) {
map<pair<int,int>,int>mp;
for(auto it:rectangles)
{
++mp[{it[0],it[1]}];
++mp[{it[2],it[3]}];
--mp[{it[0],it[3]}];
--mp[{it[2],it[1]}];
}
int chk=... | ALGO | 0.999924 | 6.01748 |
cafb7b7f-7f14-4348-a873-bd756241d159 | rishabh644/Daily_Challenge | Standard_DSA/Binary_Tree/Vertical_Order_Traversal_Of_Binary_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.999977 | 6.289783 |
fd9e081a-0d43-4465-81e6-767e6fdeca68 | SummerS-tars/CodeServerCodeStore | CodeDocuments/codes/1_1cpp_basicgrammar/7class_structure_pointer_reference/7example3try2.cpp | #include <iostream>
using namespace std;
class Solution
{
public :
int sum = 0 ;
int getSum ( int n )
{
sum += n ;
( n ) && ( getSum ( n - 1 ) ) ;
//短路操作: only n>0 才会进入后面这一部分
return sum ;
}
}; | ALGO | 0.99986 | 3.950485 |
c88c85ab-317b-46a2-be9e-8d6e55e05585 | mahimalmuntashir/CodeForces | 600-699/651B-BeautifulPaintings.cpp | #include <iostream>
#include <algorithm>
#include <vector>
int main(){
int n; std::cin >> n;
std::vector<int> beauty(n, 0);
for(int p = 0; p < n; p++){std::cin >> beauty[p];}
sort(beauty.begin(), beauty.end());
int count(1), maxCount(1);
for(int p = 1; p < n; p++){
if(beauty[p] == beau... | ALGO | 0.999811 | 4.199723 |
f9a9cac2-0c61-441e-9626-a631b4c09bac | taniaban2712/dsaRepo | CodeForces problems/checkingcodeforces.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
ll t=0;
cin>>t;
string s="codeforces";
while(t--){
char ch;
cin>>ch;
int flag=0;
for(int i=0;i<s.length();i++){
if(ch==s[i]){
flag=1;
break;
... | ALGO | 0.99984 | 3.901697 |
0b5b4322-0b57-4437-b80d-a2c7d81f003c | RootGaurav/Leetcode | 590. N-ary Tree Postorder Traversal/590.cpp | // Definition for a Node.
class Node {
public:
// int val;
vector<Node*> children;
Node() {}
Node(int _val) {
val = _val;
}
Node(int _val, vector<Node*> _children) {
val = _val;
children = _children;
}
};
class Solution {
public:
vector<int> postorder(Node* ro... | ALGO | 0.999979 | 5.824025 |
51647ab5-99be-4506-a57a-08d52287170d | akashyadav10101998/lab6 | lab_6_q5.cpp | #include<iostream>
using namespace std;
/*
Q5: write a prog, with a func that takes 2 int param, adds them together and returns the sum
*/
int func1(int a, int b){
int sum = a + b;
return sum;
}
/*
write a prog with a function that takes two int param, finds the maximum, then returns the maximum
*/
i... | ALGO | 0.994658 | 4.372881 |
c0be84ca-b1f9-4b46-8152-05c51fb7a4d4 | mono-1729/AtCoder_cpp | ARC/169/b.cpp | #include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr int IINF = 100... | ALGO | 0.999894 | 3.564801 |
cdb86385-2556-47da-932b-04310ace9786 | andreiarnautu/Algorithmic-Problems-Part-3 | packmen.cpp | /**
* Worg
*/
#include <deque>
#include <string>
#include <iostream>
int n;
std::string str;
bool get_verdict(std::deque<int>& packmen, std::deque<int>& food, const int& time) {
if (food.empty()) {
return true;
}
if (packmen.empty()) {
return false;
}
int x1, x2, y;
if (p... | ALGO | 0.999798 | 3.866923 |
4ddfbdc7-c576-4288-b11b-73305efbb883 | Manju567/coding_Leetcode-solutions | solution/0400-0499/0494.Target Sum/Solution2.cpp | class Solution {
public:
int findTargetSumWays(vector<int>& nums, int target) {
int s = accumulate(nums.begin(), nums.end(), 0);
if (s < target || (s - target) % 2 != 0) return 0;
int n = (s - target) / 2;
vector<int> dp(n + 1);
dp[0] = 1;
for (int& v : nums)
... | ALGO | 0.99998 | 6.087796 |
28158f7a-3ade-4752-9803-bd9311b61795 | tieanminer/BitCrack | CryptoUtil/checksum.cpp | #include "CryptoUtil.h"
#include <stdio.h>
#include <string.h>
static unsigned int endian(unsigned int x)
{
return (x << 24) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00) | (x >> 24);
}
unsigned int crypto::checksum(const unsigned int *hash)
{
unsigned int msg[16] = { 0 };
unsigned int digest[8] = { 0 };
/... | TOOL | 0.972907 | 6.079969 |
b1ebbcff-4f9d-47fc-8ec8-7e8082ac89a7 | jinjinlinlin/test7 | test7/test.cpp | #define _CRT_SECURE_NO_WARNINGS 1
//ӡһ
//
#include<stdio.h>
int main()
{
int line = 0;
scanf("%d", &line);
int i = 0;
//ϰ
for (i = 0; i < line; i++)
{
int j = 0;
//ո
for (j = 0; j < line - 1 - i; j++)
{
printf(" ");
}
//*
for (j = 0; j< 1 + 2 * i; j++)
{
printf("*");
}
printf("\n");
}
... | ALGO | 0.999954 | 3.243998 |
150bb35b-7136-4f16-a871-c24408898865 | danast2/Lafore_studying_examples_cpp | pointers/practice_11.cpp | #include <iostream>
using namespace std;
void centimize(float*);
const int MAX = 5;
int main(){
float arr[MAX] = {11, 12, 13, 14, 15};
centimize(arr);
for (int i = 0; i < MAX; i++){
cout << arr[i] << endl;
}
return 0;
}
void centimize(float* array){
for (int i = 0; i < MAX; i++)... | ALGO | 0.999584 | 3.439009 |
598459d2-3815-4c30-885f-a33f8123b141 | slimepiki/atcoder | abc071/b/main.cpp | using namespace std;
using ll = long long;
using ull = unsigned long long;
#include <bits/stdc++.h>
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
cerr << " " << to_string(H);
debug_out(T...);
}
#ifdef __LOCAL
#define debug(...) ... | ALGO | 0.999837 | 4.899626 |
15658299-5c97-4ec7-967e-98c55632bee4 | soshubh/Leetcode | Medium/673. Number of Longest Increasing Subsequence.cpp | // https://leetcode.com/problems/number-of-longest-increasing-subsequence/
class Solution {
public:
int findNumberOfLIS(vector<int>& nums) {
int ml = 0;
int a = 0;
int n = nums.size();
vector<int> dp(n, 1), c(n, 1);
for (int i = 0; i < n; i++)
{
for (int j = 0;... | ALGO | 0.99999 | 6.317644 |
c4fc7127-5f8f-471f-8189-7eebacb9e9a0 | sarvex/leetcode-racket | solution/2500-2599/2546.Apply Bitwise Operations to Make Strings Equal/Solution.cpp | class Solution {
public:
bool makeStringsEqual(string s, string target) {
auto a = count(s.begin(), s.end(), '1') > 0;
auto b = count(target.begin(), target.end(), '1') > 0;
return a == b;
}
}; | ALGO | 0.999922 | 5.969481 |
91ca77f3-6c39-42fa-abab-bbcfcc40d46b | MDzimah/Competitive-programming-practice | Acepta el Reto/158_LosSaltosDeMario.cpp | #include <iostream>
void res() {
int muros,altMuro,altMuroAux,salA = 0,salB = 0;
std::cin >> muros;
std::cin >> altMuro;
for (int f = 1; f < muros; ++f) {
std::cin >> altMuroAux;
if (altMuro < altMuroAux) ++salA;
else if (altMuro > altMuroAux) ++salB;
altMuro = altMuroAux;
}
std::cout << salA << ' ' <... | ALGO | 0.999545 | 3.703621 |
d09d403c-9273-4752-a5eb-03f117027d30 | RaplesWojtyla/My-Competitive-Programming-Archive | codeForce/Edu Contest/b2.cpp | #include <bits/stdc++.h>
using namespace std;
bool nonDes()
{
int n, prev = 0;
cin >> n;
int nums[n];
for (int i = 0; i < n; ++i) cin >> nums[i];
vector<int> ans({nums[n - 1]});
for (int i = n - 2; i >= 0; --i)
{
if (nums[i] > ans.back())
{
ans.push_back(nums[... | ALGO | 0.998619 | 5.56842 |
91e91c74-dd96-4d5d-aabf-8ca4597e336b | naringcode/cpp-study-notes | Ranges/Additional/implementation_of_invoke.cpp | // Update Date : 2025-02-05
// OS : Windows 10 64bit
// Program : Visual Studio 2022
// Version : C++20
// Configuration : Debug-x64, Release-x64
#include <iostream>
#include <concepts>
#include <type_traits>
#include <utility>
// https://en.cppreference.com/w/cpp/utility/functional/invoke
// std::invoke() 내에서 사용하는 ... | TOOL | 0.934485 | 7.5008 |
132c6982-3b45-4baf-acb7-fbc598a9df25 | Parveen0811/Bubble-sort-visualizer | main.cpp | #include <iostream>
#include <raylib.h>
using namespace std;
int main () {
InitWindow(1200, 800, "sorting");
SetTargetFPS(40);
int height[24];
int i=0,j=0;
for(int k=0;k<24;k++){
height[k]= rand() % 800;
}
while(!WindowShouldClose()){
BeginDrawing();
for(int k... | ALGO | 0.999447 | 4.077027 |
13de07b1-02fe-41c4-b0f3-0a2814b527a3 | hjiang13/LLMs-in-IR | POJ-104/74/556.cpp | #include <iostream>
using namespace std;
int b=0;
void main()
{
int m,n,i,j,k,a[100]={
0}
,I,t;
cin >> "%d%d",&m,&n);
for(i=m; i<=n; i++)
{
for(j=2; j<=i/2; j++)
{
if(i%j!=0) k=1;
else {
k=0; break; }
}
if(k==1)
{
I=0; t=i;
while(t>0)
{
I=I*10+t%10; t=t/10; }
if(I==i)
{
a[b]=i; b++; }
}
}
if(a[0]==0)
cout << "no\n");
e... | ALGO | 0.999969 | 3.27287 |
b634a7b4-d5c0-4e77-b720-f7a30983726b | thegamer1907/Code_Analysis | DP/2464.cpp | #include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define ins insert
#define sb substr
#define sp fixed<<setprecision
#define bp __builtin_popcount
#define pll pair<ll,ll>
#define pld pair<ld,ld>
using namespace std;
ll A[10... | ALGO | 0.999966 | 4.23958 |
0c3370d2-2bc9-487a-ba48-aa8f468958a8 | algorithm006-class02/algorithm006-class02 | Week_01/G20200343030462/LeetCode_20_462.cpp | class Solution {
public:
bool isValid(string s) {
std:stack<char> stackBrackets; //放括号的栈
for(auto &bracket : s)
{
switch(bracket)
{
case '(' :
stackBrackets.push(')');
break;
case '{':
... | ALGO | 0.997385 | 6.016582 |
6bc18e6c-6a8d-4deb-bc34-9b15f56037f6 | jakovmitrovski/competitive-programming-algo-cpp | national/olympiad/medali.cpp | #include <bits/stdc++.h>
using namespace std;
int dp[30001][4];
vector<int> v;
int res(int ind, int last)
{
if (ind == v.size())
return 0;
if (dp[ind][last] != -1)
return dp[ind][last];
int ans = 1 << 25;
for (int i = last; i <= 3; i++)
if (v[ind] == i)
ans = m... | ALGO | 0.999903 | 4.213372 |
17e7fa87-afa4-4601-8afc-392154cb195a | deepaksingh1008/DSA | recurrsion/Combination_Sum_II.cpp | //question-link = https://www.geeksforgeeks.org/problems/combination-sum-ii-1664263832/1
class Solution{
void solve(vector<int> &arr, int target, int start, vector<int> ¤t, vector<vector<int>> &result){
if(target == 0){
result.push_back(current);
return;
}
... | ALGO | 0.999916 | 5.80689 |
f27a8423-5cd3-47b8-8990-a84187bdc38d | fushime2/competitive | atcoder/arc/arc031/a.cpp | #include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
string name;
string poyo;
cin >> name;
int n = name.size();
for(int i=0; i<n; i++) {
poyo[i]... | ALGO | 0.999969 | 3.584667 |
8e88d327-59aa-46e5-826b-a671dae1ab98 | morris821028/UVa | volume121/12108 - Extraordinarily Tired Students.cpp | #include <stdio.h>
int main() {
int n, cases = 0;
while (scanf("%d", &n) == 1 && n) {
int A[32], B[32], C[32], D[32];
int sleep = 0, awake = 0, cycle = 1;
for (int i = 0; i < n; i++) {
scanf("%d %d %d", &A[i], &B[i], &C[i]);
D[i] = A[i] + B[i];
cycle *= D[i];
}
int ret = -1;
for (int time = 1; t... | ALGO | 0.999914 | 3.24675 |
caab5447-6875-49ec-ab70-df3e911eea63 | vinsonleelws/LeetCode | 49-Group Anagrams.cpp | /*Given an array of strings, group anagrams together.
Example:
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
["ate","eat","tea"],
["nat","tan"],
["bat"]
]
Note:
All inputs will be in lowercase.
The order of your output does not matter.*/
class Solution {
public:
vector<vector<string>>... | ALGO | 0.99999 | 6.304587 |
1a8dd0cc-e135-4c41-8721-6aac270c1681 | AbdullahAswad/CPP-work | Palindrome.cpp | /*
Write a program that finds the sum of the digits of the largest five-digit palindrome that is divisible by 6.
*/
#include <iostream>
using namespace std;
int main()
{
int a, b, c, d, e;
int x = 10000;
int sum;
int pal;
while (x <= 99999){
a = x / 10000;
b = x / 1000 % 10;
c = x / 100 % 10;
d = x / 10 % 10;
e = ... | ALGO | 0.999899 | 6.181235 |
3b6a5315-f61c-476a-8e61-426f72f96079 | ishandutta2007/codeforces | abc864197532/normal/1618/G.cpp | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair <int, int>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
void abc() {cout << endl;}
template <typename T, t... | ALGO | 0.999951 | 4.098466 |
af38a938-df73-4be1-aeea-6e1ee707078b | hustvl/BMaskR-CNN | detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.cpp | namespace {
// implementation taken from Caffe2
template <typename T>
struct PreCalc {
int pos1;
int pos2;
int pos3;
int pos4;
T w1;
T w2;
T w3;
T w4;
};
template <typename T>
void pre_calc_for_bilinear_interpolate(
const int height,
const int width,
const int pooled_height,
const int ... | DATA | 0.904785 | 7.041143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.