uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
ae18fd54-ff17-49da-8544-8c8c0c48af93 | leandrojoseereneta/Unit_5_Calculator_Ereneta | 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 |
87276309-95dd-49da-8f38-2cfa1af20b12 | dittoo8/algorithm_cpp | SWEA/1216.cpp | #include <iostream>
#include <string>
#define MAX 100
using namespace std;
string map[MAX];
int check(int x, int y){
for(int k=MAX;k>=2;k--){
int width = k,height = k;
for(int t = 0;t<=k/2;t++){
if((y+k-1)< MAX) {
if(map[x][y+t]!= map[x][k-t+y-1]) width = 1;
}... | ALGO | 0.998982 | 3.356622 |
65046d13-bbad-4f13-8845-9ee9649f5c0f | Tulsya/inheritance-and-polymorphism | 2 задание2(наследование и полиморфизм).cpp |
#include <iostream>
class Figure {
protected:
std::string name_;
public:
std::string get_name() { return name_; }
virtual void print_info() {
std::cout << "\n" << name_ << ":\n";
}
};
class Triangle : public Figure {
protected:
int a_ = 0;
int b_ = 0;
int c_ = 0;
int A_ = 0;... | TOOL | 0.921976 | 4.717922 |
345350a6-d315-4a31-8cbe-0fd89fe4b654 | Narcos101/Problem-solving-on-different-websites | RecursiveMethod2.cpp | #include<iostream>
using namespace std;
struct Node{
int data;
Node* next;
};
Node *end1 = NULL;;
Node* Insert(Node*head, int data){ /*Recursive method uses Implicit stack(Stack in the memory)
therefore, Time Complexity = O(n), Space Complexity = O(n) */
N... | ALGO | 0.999918 | 4.338608 |
950299ce-9932-4bc4-aa1f-0497027f4e76 | Rajbirsakib/Codeforces_Solution | 744A - Casimir's String Solitaire.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
string s;
while(t--){
cin>>s;
int a=0,b=0,c=0;
for(int i=0;i<s.size();i++){
if(s[i]=='A') a++;
else if(s[i]=='B') b++;
else c++;
}
if(a+c==b) cout<<"YES"<<e... | ALGO | 0.999592 | 4.581746 |
bcd6e2df-5b87-4eb3-ac56-c2d51165a847 | acassis/emlinux-ssd1935 | libs/oss/others/APL/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/inter_36.cpp | /*
------------------------------------------------------------------------------
Filename: inter_36.cpp
------------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
; INCLUDES
---------------------------------------... | ALGO | 0.995655 | 5.733025 |
9a4abff7-e828-4610-99d5-594b763b8406 | uxth/leetcode | cpp/319.bulb-switcher.cpp | /*
* @lc app=leetcode id=319 lang=cpp
*
* [319] Bulb Switcher
*
* https://leetcode.com/problems/bulb-switcher/description/
*
* algorithms
* Medium (45.37%)
* Likes: 519
* Dislikes: 1071
* Total Accepted: 82.7K
* Total Submissions: 182.5K
* Testcase Example: '3'
*
* There are n bulbs that are initi... | ALGO | 0.999931 | 6.725994 |
cb23e20c-8685-4d6e-91d7-fab349e2b8d1 | bubbleShaker/atcoder_library | abc/389/a.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
cout<<(s[0]-'0')*(s[2]-'0')<<endl;
return 0;
} | ALGO | 0.999031 | 3.269052 |
1197c1a1-15e2-4854-98c8-397e42d4bf21 | AaronBattershell/ACM | Queen.cpp | //**********************************************************************************************************
// Aaron Battershell
// 3/16/13
// http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2489
//**************************************************************************... | ALGO | 0.999186 | 3.227644 |
aa03e667-95dd-4c15-9997-6841fa4b57ae | PRANAVJARANDE/CodeForces | F - Unfair Game.cpp | #include <bits/stdc++.h>
using namespace std;
#define MOD (int)(1e9 + 7)
#define ll long long
int main()
{
ios::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0) ;
int t;cin >> t;
vector<vector<vector<ll>>>dp(201,vector<vector<ll>>(201,vector<ll>(201,0)));
for(int i=0;i<201;i++)
{
for(int ... | ALGO | 0.999721 | 4.495764 |
35a970ed-9cca-43ad-a40e-7164c348ba4e | ML-UCV/ML-CodeBert-DistinctSolutions | Raw Dataset/ctc/kosaraju/train/90fca23a-a456-431c-a8d5-093274538988.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
const char iname[] = "ctc.in";
const char oname[] = "ctc.out";
vector <int> Go[100005], Gi[100005], G[100005];
void read_in(vector <int>* Go, vector <int>* Gi, int& n, const char iname[])
{
ifstream in(iname);
... | ALGO | 0.999943 | 4.503798 |
5112b06c-ac0d-41fb-abfb-cd6326d1d5ca | raincross7/code-similarity | codes/train_code/problem192/problem192_312.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using Graph = vector<vector<bool>>;
const int MOD = 1e9 + 7;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int N, K;
... | ALGO | 0.999983 | 4.552787 |
a3a27a0c-d84e-41d5-b472-b5710f4ed4aa | AlxndrKlbk/CS-course | C++/dummies/problems/maximum_average_subarray/solution.cpp | #include <vector>
#include <chrono>
#include <iostream>
#include <cassert>
using timer = std::chrono::high_resolution_clock;
class Solution {
public:
double findMaxAverage(std::vector<int>& nums, int k) {
if (nums.size() < k) {
return 0;
}
double max = std::numeric_limits<dou... | ALGO | 0.999744 | 6.731837 |
c761ac62-0199-42ac-b0da-93adbac50786 | yixiaogithub66/tongji_university_Advanced_programming_for_beginner | 第一课(6).cpp | #include <iostream>
using namespace std;
int input_distance() {
int d;
cout << "˵ľ룺" << endl;
cin >> d;
return d;
}
double calculate_time(int d) {
double time = d / 0.01;
return time;
}
void print(double time) {
cout << "Ҫ" << time << "굽" << endl;
}
/*int main() {
int distance = input_di... | ALGO | 0.978713 | 3.069549 |
096089a7-885a-4ad0-89df-c75f5e7a3a06 | Md-Nasiat-Hasan-Fahim/Problem-Solving-with-C | .acmx/solutions/Codeforces - Educational Codeforces Round 83 (Rated for Div. 2)/Problem_2_Speeding_Ticket.cpp | #include<bits/stdc++.h>
using namespace std;
#define FastIO ios_base::sync_with_stdio(false), cin.tie(0)
#define endl '\n'
#define int long long
#define all(x) x.begin(),x.end()
#define pb push_back
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define check(x) cout << (#x) << " is " << (x) << endl;
const int mod ... | ALGO | 0.997511 | 3.398995 |
283667a1-8edb-4d7e-ac0f-2c7b718129e4 | muhammadalmuzahid/CompetitiveProgrammingRepository | OnlineJudgeSoutions/CodeForcesGym/2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest/L_Bridge_Renovation.cpp | #include <bits/stdc++.h>
#define debug(x) cout << #x << " = "; cout << x << '\n';
using namespace std;
typedef long long ll;
const int ARRAY_SIZE = (int) 2e6+3;
void idea() {
int n;
cin >> n;
int ans = 0;
if (n <= 6) {
cout << n + 1 << '\n';
return;
}
if (n % 2 == 0) {
... | ALGO | 0.999758 | 3.433949 |
d7ca58db-5711-4abb-b7f3-c15bae3f72b6 | CmsMartin/POI | POI2005/P3420.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000010;
int Fa[MAXN] , N , Num[MAXN] , Ans;
int Find(int i) {
return Fa[i] == i ? i : Fa[i] = Find(Fa[i]);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> N;
for(int i = 1; i <= N; i++) {
Fa[... | ALGO | 0.999943 | 4.253617 |
0b58750f-c2b7-4159-824d-b28bfcf506b6 | zhwang026/ga_tsp_ros | ga/src/ga_tsp/src/ga.cpp | // 用GA算法解决TSP问题
#include "ga.h"
#include <string>
#include <cmath>
#include <algorithm>
#include <random>
#include <visualization_msgs/Marker.h>
#include <visualization_msgs/MarkerArray.h>
#include <geometry_msgs/PoseStamped.h>
#include <geometry_msgs/PoseArray.h>
using namespace std;
GA::GA()
{
ROS_INFO("sta... | ALGO | 0.999997 | 4.017031 |
52e9627d-579d-461b-8c6b-95265d23fd4a | TIG-KI/Data-Structure | method.cpp | #include<stdio.h>
#include<stdlib.h>
#include "method.h" //ͷļ
//ijʼ
void InitList(Sqlist *&L)
{
L = (Sqlist*)malloc(sizeof(Sqlist));
if(!L->elem)
{
return exit(1);
}
L->length = 0;
}
//Ĵ
void ListCreated(Sqlist *&L, ElemType *a, int n)
{
int i;
//L.elem = new ElemType[MAXSIZE];
... | ALGO | 0.998604 | 3.198586 |
23da1486-9bbb-459b-b193-95127b2ad927 | firiexp/contest_log | atcoder/ABC/126A.cpp | #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>
static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;
template<class T> constexpr T INF = ::nu... | ALGO | 0.999955 | 3.615538 |
840dd42c-5ccf-4394-89b9-c32aba44fb1a | TengFeiyang01/Algorithm | bishi/10-13DIDI/p.cpp | #include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
using i64 = long long;
void solve() {
int n, m;
std::cin >> n >> m;
std::vector<int> a(n), b(m, -1);
std::set<int> st;
for (int i = 0; i < m; ++i) {
st.insert(i);
}
for (int i = 0; i < n; ++i) {
std::cin >> a[i];
int x = a... | ALGO | 0.999994 | 3.584192 |
c7422f0d-e496-4fed-b8fd-a3dc2bf11552 | ishandutta2007/codeforces | bidzilya/normal/781/B.cpp | #include <algorithm>
#include <iostream>
#include <map>
#include <string>
#include <vector>
using namespace std;
class TKuhnSolver {
public:
void Init(int n_, int m_) {
n = n_;
m = m_;
g.clear();
g.resize(n);
}
void AddEdge(int from, int to) {
g[from].push_back(to);... | ALGO | 0.999996 | 5.074681 |
a78f203e-0c33-4cc1-a683-63174bf0335f | plosan/Fractional-Step-Method | code/schemes.cpp | #include "schemes.h"
// Upwind-Difference Scheme
double schemeUDS(double varNeg, double varPos, double m) {
// Parameters: fix a direction (i, j or k) then
// - varNeg variable var at the node in the negative side of the direction
// - varPos variable var at the node in the positive side of the dir... | ALGO | 0.999923 | 5.267875 |
ce93198c-9c55-47e5-8fff-2f1a431d0e9e | nuo534202/Competitve-Programming | Atcoder/Atcoder Beginner Contest/ABC385/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int a[5];
for (int i = 1; i <= 3; i++) cin >> a[i];
sort(a + 1, a + 4);
if (a[1] + a[2] == a[3] || (a[1] == a[2] && a[2] == a[3])) puts("Yes");
else puts("No");
return 0;
}
| ALGO | 0.999987 | 4.092856 |
e6c3917b-10c9-440d-ab00-920cbb873929 | dtc2025ag/MOAI | thirdparty/SEAL-4.1-bs/native/src/seal/util/uintarithmod.cpp | #include "seal/util/common.h"
#include "seal/util/uintarith.h"
#include "seal/util/uintarithmod.h"
#include "seal/util/uintcore.h"
using namespace std;
namespace seal
{
namespace util
{
bool try_invert_uint_mod(
const uint64_t *operand, const uint64_t *modulus, size_t uint64_count, uint64_... | ALGO | 0.998493 | 7.002706 |
588a0c96-7783-4c24-98cb-3dae583c3462 | kimmstop/PS | BOJ_prob/Search_Sort/C++/BOJ_11650.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
int N;
bool compare(pair<int,int> a, pair<int,int> b)
{
if(a.first == b.first){
return a.second < b.second;
}
else
return a.first < b.first;
}
int main()
{
cin >> N;
vector<pair<int,int>> loc;
int x,y;
for... | ALGO | 0.999883 | 4.672819 |
8c13cd36-93d3-4f81-85a1-8214c320bdbc | iamdeveloperz/Programmers | 프로그래머스/1/68935. 3진법 뒤집기/3진법 뒤집기.cpp | #include <string>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
int solution(int n) {
int answer = 0, count = 0;
string three;
while (n) {
three += to_string(n % 3);
n /= 3; ++count;
}
vector<int> temp;
for (int i = 0; i < three.length(); ++i)... | ALGO | 0.999892 | 4.596005 |
63a24b0c-0352-4a7a-bf15-fb0b9bd04549 | Sup3rFire/CP | loaling/A_Arrival_of_the_General.cpp | #include <bits/stdc++.h>
using namespace std;
// loal is a cute girl
#define ll long long
#define ld long double
#define pow2(x) (x)*(x)
#define le left
#define ri right
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define pll pair<long, long>
c... | ALGO | 0.999967 | 3.601784 |
da22249e-fb5e-46e0-805c-6fba3e1f9b8b | JahidulHasanSuhel/Competitive-programming | Codeforces/p.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
#define Suhel() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);
#define mem(a,b) memset(a, b, sizeof(a))
int main(){
... | ALGO | 0.999901 | 4.2583 |
b38d504d-3157-4832-8600-afcae80d3337 | DetectiveGot/Coding | CrackNCode/pretoi20/glue_cheese.cpp | #include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define tpi tuple<ll,int,int>
#define siz(x) (int)(x.size())
#define deb(x) cerr << "[" << #x << ": " << x << "] "
using namespace std;
const int N = 1001, dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
ll dist[N][N], dist2[N][N], a[N][N];
bool vis[N][N], vis2... | ALGO | 0.999791 | 3.588423 |
d446c2a7-82b2-49bc-8ec8-0d5f5f49f660 | L0ric0/gslcpp | gslcpp/src/poly.cpp | // gslcpp
#include "gslcpp/poly.hpp"
#include "gslcpp/exception.hpp"
#include "gslcpp/poly/solver.hpp"
#include "gslcpp/util.hpp"
// gsl
#include <gsl/gsl_poly.h>
// stllib
#include <complex>
#include <functional>
#include <memory>
#include <vector>
namespace gslcpp::polynomial
{
using gslcpp::util::conversion:... | ALGO | 0.997528 | 6.635419 |
7362dc60-a5f3-460f-9e8c-ae755d09a81f | gyahu/Tarea1Algoritmos | main.cpp | #include <stdio.h>
#include <vector.h>
#include <boost/filesystem.hpp>
using namespace std;
/* Moves the different values to the corresponding bucket */
void redirect(string batch, std::vector<float> pivots, std::vector<FILE *> buckets, int index){
std::istringstream batch(batch);
std::vector<strings> coordinates;
... | ALGO | 0.987555 | 4.147961 |
efa328e6-4d84-46ac-bed1-66abbb5313fb | MoeinGhaniyoun/LLVM-SLH-RISCV | libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/ranges_stable_partition.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
// indirect_unary_predicate<projected<I, Proj>> Pred>
// requires permutable<I>
// subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {}); ... | TEST | 0.992701 | 7.929128 |
950f2298-723d-4e4d-8b99-69457ea3de12 | leblance7/CPlusPlus | pointers/pointer.cpp | #include <iostream>
int main() {
int firstvalue, secondvalue;
int * mypointer;
//Both are the same, or clos e by one decimal..
std::cout << "\nmypointer address: " << &mypointer << std::endl;
std::cout << "mypointer value: " << mypointer << std::endl;
mypointer = &first... | TOOL | 0.981119 | 3.380322 |
1c1fa9e5-7f7b-40a3-b2be-a8dfd6da69e0 | pranay595/LeetCode-Solutions | 15-3sum/15-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
int n = nums.size();
if(n<=2)
return {};
sort(nums.begin(),nums.end());
vector<vector<int>> ans;
for(int i=0;i<n-1;i++){
if( i==0 || (i>0 && nums[i]!=nums[i... | ALGO | 0.999913 | 5.749905 |
0ea60660-40d9-480e-8211-69a5e2d88873 | ishandutta2007/codeforces | mhq/normal/1753/B.cpp | #ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int maxN = 5e5 + 10;
int cnt[maxN];
int n, x;
int a[maxN];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#ifdef DEBUG
fr... | ALGO | 0.999997 | 3.874043 |
83a96a43-6cfe-4c8b-9d46-7326add1bc69 | mwpowellhtx/player-game-scheduler | src/game-scheduler/candidate_analysis.cpp | #include "candidate_analysis.h"
#include "../../tools/cpplinq/cpplinq.hpp"
namespace sched {
candidate_analysis::overall_t::overall_t()
: sum(), min(), max(),
mean(), variance(), stdev() {
}
candidate_analysis::overall_t::overall_t(overall_t const & other)
: sum(other.sum), min(o... | ALGO | 0.94533 | 6.382409 |
4927a2b5-6ce0-4f9f-b008-8761800af9a0 | hari-kadumuri/coding | OptimalStrategyForAGame.cpp | // We have an array of integers. This two player game is select any value on the either side of the array to be removed. The removed value will be added to
// that person's score. Then the second person will get the turn to do the same. The process repeats until the array is empty. The following code
// returns the max... | ALGO | 0.999806 | 4.799818 |
f3a01f12-7d6f-4a87-9e70-4c5a1bd65788 | Leyla475/4 | Source4.cpp | #include <iostream>
#include <string>
#include <regex>
int main() {
std::string text = "23.09.2089 // 45.1.3000 // 32.19.2000 // 4.9.2012 // 23:50:23 // 1:23:22 // 77:01:20 ";
std::regex regular("([^1-9][1-9]|0[1-9]|[12][0-9]|3[01])""\.""([1-9]|0[1-9]|1[012])""(.)""([0-9]{4})");
std::regex regular2("([^1-... | TOOL | 0.891569 | 3.173868 |
49b0b9df-6297-4a55-9ded-3ea482d79799 | ywen19/AINote | algorithm/习题4-2/前缀/Main.cpp | #include <bits/stdc++.h>
using namespace std;
const int M = 505, L = 1000005;
// 基础Trie树问题
// c:trie树上的边,c[x][y]表示从节点x出发(x从1开始),字符为y的边(y范围是0到25)
// sz:sz[x]表示x节点的子树中终止节点的数量(子树包括x自身)
// cnt:trie树上节点的数目
int c[L][26], sz[L], cnt;
// 将字符串s加入到trie树中
// s:所要插入的字符串
void add(char *s) {
int x = 0;
for (; *s; ++s) {
... | ALGO | 0.999977 | 4.656494 |
132155b3-f6ea-426a-b944-7ef21c56ae97 | wridzer/Grad_HKU | godot-4.4-dev3/core/math/dynamic_bvh.cpp | /**************************************************************************/
/* dynamic_bvh.cpp */
/**************************************************************************/
/* This file is part of: */
/* ... | ALGO | 0.986948 | 6.697394 |
f50ce472-f2a0-4df2-af3d-1feae2a5734c | Sagar-Anigere/sagar | src/modules/ekf2/EKF/aid_sources/optical_flow/optical_flow_control.cpp | /**
* @file optical_flow_control.cpp
* Control functions for optical flow fusion
*/
#include "ekf.h"
#include <ekf_derivation/generated/compute_flow_xy_innov_var_and_hx.h>
void Ekf::controlOpticalFlowFusion(const imuSample &imu_delayed)
{
if (!_flow_buffer || (_params.flow_ctrl != 1)) {
stopFlowFusion();
ret... | ALGO | 0.983971 | 7.879208 |
39f0b56e-4299-40bc-92cf-1a6a255ba6d1 | MdMostafizurRahaman/Random-Code | context_free_grammer1.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
cout << "S-->A1B" << endl;
cout << "A-->0A|e" << endl;
cout << "B-->0B|1B|e" << endl;
cout << "Enter String:";
cin>>s;
bool flag=false;
int number_of_zero = 0;
//acceptation check
for(int i = 0; i < s.size(); i++... | ALGO | 0.999972 | 3.832863 |
31ff3249-3d5c-40ce-88e3-60ae0d0da105 | TCGBench/TCGBench | data/partially_correct_code/partially_correct_code_noip/P1030/80-100_5.cpp | #include <iostream>
#include <cstring>
using namespace std;
int find(char* str, char c, int n){
while (--n)if (str[n] == c)return n;
return -1;
}
void f(char* in, char* post, char* pre, int len){
if (len == 0)return;
pre[0] = post[len-1];
if (len == 1)return;
int pos = find(in, pre[0], len);
... | ALGO | 0.999992 | 3.766718 |
85be191a-42bd-444c-b53a-08d0086208aa | jaemin098/Baekjoon-Online-Judge | 29790/BOJ-29790.cpp | #include <iostream>
using namespace std;
int main() {
int n, u, l;
cin >> n >> u >> l;
if(n >= 1000) {
if(n >= 1000 && u >= 8000 && l >= 260) {
cout << "Very Good" << endl;
}
else if((n >= 1000 && u >= 8000) || (n >= 1000 && l >= 260)) {
cout << "Very Good" << endl;
}
else {
... | ALGO | 0.997528 | 6.000127 |
2b8ef273-e036-4ba9-b6b8-ffce18d97046 | shubham-up-47/DSA_Codes | #C++/String/number_to_string_code.cpp | #include <bits/stdc++.h>
using namespace std;
// returning all (string codes) from given number when ('a'=1, 'b'=2 ........ 'y'=25, 'z'=26)
int returnStringCodes(string str, string strCode[])
{
if(str.size()==0)
{ strCode[0] = "";
return 1; }
int n=0, n1, n2;
stri... | ALGO | 0.999747 | 3.925868 |
cc39d499-2c60-42b2-a4ac-ffc9f05e51be | Ishwarendra/Contests | CODECHEF/Starters99/C__good.cpp | #include "bits/stdc++.h"
#ifdef LOCAL
#include "F:\CPP\Debug\debug.h"
#else
#define print(...) 1;
#endif
using i64 = long long;
void solve()
{
int n;
std::cin >> n;
std::vector a(n, std::array<int, 2>());
for (auto &[x, y] : a)
std::cin >> x >> y;
int ans = 1e9;
std::vector<int> one... | ALGO | 0.999959 | 4.933564 |
76d845c2-169a-4e45-84b6-d5f81728d29d | nunocsleite/SFLA-ETP-Toronto | MOEA/lib/MainApp.cpp | #include <iostream>
#include <vector>
#include <fstream>
#include "TestSetDescription.h"
#include "Data.h"
#include "ETTPInit.h"
#include "MOEA.h"
#include "eoSFLA.h"
#include "eoETTPEval.h"
#include "Repairing.h"
#include "eoEvolutionOperator.h"
#include "TorontoTestSet.h"
#include "ITC07TestSet.h"
#include <string>
... | ALGO | 0.891484 | 4.333241 |
63d62ef6-5cb8-4e04-9447-3ddfd1c3c667 | daedaldan/usaco | Practice/Training Gateway/Chapter 2/Section 2.4/The Tamworth Two/ttwo.cpp | /*
ID: daniel25
TASK: ttwo
LANG: C++
*/
#include <iostream>
#include <string>
#include <fstream>
#include <map>
using namespace std;
struct direction {
int row;
int col;
};
int farmerVisited[10][10][4];
int cowVisited[10][10][4];
char grid[10][10];
int farmerDirection = 0;
int cowDirection = 0;
int farmerLo... | ALGO | 0.999945 | 4.302779 |
f14ebb82-8fcb-4918-8dce-5705c92a61ef | harshgau/SdeSheetChallenge | Striver SDE Sheet/day7/Add Two Numbers As Linked Lists.cpp | #include <bits/stdc++.h>
/****************************************************************
Following is the class structure of the Node class:
class Node
{
public:
int data;
Node *next;
Node(int data)
{
this->data = data;
... | ALGO | 0.999948 | 5.732092 |
48b7caf0-5dcc-47ac-95f1-a22bdb1014f9 | pingchungchang/CP | CF1763B.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define fs first
#define sc second
void solve(){
ll n,k;
cin>>n>>k;
pll arr[n];
for(auto &i:arr)cin>>i.fs;
for(auto &i:arr)cin>>i.sc;
multiset<ll> st;
for(auto &i:arr)st.insert(i.sc);
priority_que... | ALGO | 0.999952 | 4.038889 |
9c702fe3-f95e-4792-b1e4-f5205287464a | acrnm148/BOJ_cpp | 입출력/2442_별찍기-5.cpp | #include<iostream>
using namespace std;
int main()
{
int N, total;
scanf("%d",&N);
total = N;
for(int i=1; i<=N; i++)
{
for(int j=N; j>i; j--) printf(" ");
for(int k=1; k<=total-(N-i); k++) printf("*");
printf("\n");
total++;
}
} | ALGO | 0.999949 | 3.418134 |
4b0cd8d2-a174-4d0e-a997-409c9b01634d | fatemehkarimi/codeforces-solutions | codeforces-863C.cpp | //https://codeforces.com/problemset/problem/863/C
//C. 1-2-3
#include <iostream>
#include <vector>
#include <map>
#define lld long long int
using namespace std;
int visited_before(vector <pair <int, int> > & visited, pair <int, int> state)
{
for(int i = 0; i < (int)visited.size(); ++i)
if(visited[i] == state)
... | ALGO | 0.999955 | 4.107321 |
8874d932-831a-44d8-9e75-386381691cbd | Naveen110501/Hackerrank | misha and nice sets.cpp | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
unsigned long long int l,r,g,T,no_of_Terms;
cin>>T;
while(T--)
{
cin>>l>>r>>g;
unsigned long long int first=0,last=0;
if( g>r)
{
cout<<"0"<<endl;
continue;
}
if(l%g==0) first=l;
else first=l+(g-l%g);
if(r%g==0) last=r;
... | ALGO | 0.9999 | 3.664765 |
8c7f3966-af18-43c1-b3a1-b0cf412760c9 | V4IDIK/DSA | bubble_sort.cpp | #include <iostream>
#include <vector>
class BubbleSort {
public:
static void sort(std::vector<int>& arr) {
int n = arr.size();
for (int i = 0; i < n-1; i++) {
bool swapped = false;
for (int j = 0; j < n-i-1; j++) {
if (arr[j] > arr[j+1]) {
... | ALGO | 0.99978 | 6.001662 |
28c809c6-a8d2-4a32-9851-d0dfdf06cf31 | flybird119/mediastream-plus | codecs/libjpeg/jidctint.cpp | #define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdct.h" /* Private declarations for DCT subsystem */
#ifdef DCT_ISLOW_SUPPORTED
/*
* This module is specialized to the case DCTSIZE = 8.
*/
#if DCTSIZE != 8
Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */
#endif
... | ALGO | 0.999323 | 5.739525 |
c61080fe-e54b-4bc6-b59d-44af6d7cf3b1 | ishandutta2007/codeforces | jdurie/normal/1556/B.cpp | #pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
template<class T, class S>
ostream& operator << (ostream &o, const pair<T, S> &p) {
return o << '(' << p.first << ", " << p.second << ')';
}
template<template<class, class...> cla... | ALGO | 0.999782 | 4.302461 |
6a2efe54-78b6-4f60-a573-6a499c86a6c9 | vcuaya/c-plus-plus | PrimeNumber/PrimeNumber.cpp | #include <iostream>
using namespace std;
/**
* @brief Checks if a number is prime.
*
* This function uses recursion to determine if a given number n is prime.
* It checks divisibility starting from 2 up to n-1.
*
* @param n The number to check for primality.
* @param x The current divisor being checked.
* @... | ALGO | 0.99984 | 6.130267 |
65275450-45fe-426c-ad3c-1207c8accf47 | raincross7/code-similarity | codes/train_code/problem107/problem107_177.cpp | #include <iostream>
#include <vector>
class Point{
private :
int x; //X point of grid
int y; //Y point of grid
int path; //number of path
bool roadWork; //roadWork flag
public :
Point() : x(), y(), path(), roadWork() {}
// ~Point() = default;
void setX(int i) { x = i; }
void setY(int i) { y = i; }
void se... | ALGO | 0.999096 | 4.355463 |
9a08366c-54bc-4864-8a82-6ab1f8df672c | jyotsanashyama/DSAcodes.cpp | Recursion/recursion_fibonacci.cpp | #include<iostream>
using namespace std;
///1st two fibonacci no is fixed: 0 and 1
int fib(int n){
///base case: smallest problem whose ans is already known
///here two base cases is required as fibonacci have two fixed numbers 0 and 1
if(n==0){
return 0;
}
if (n==1){
... | ALGO | 0.999946 | 4.224292 |
65fc7c64-7994-4d1e-bfc2-52d1bef81c47 | xxpcb/PnP-Camera | ConsoleApplication1/eigen/doc/examples/class_FixedVectorBlock.cpp | #include <Eigen/Core>
#include <iostream>
using namespace Eigen;
using namespace std;
template<typename Derived>
Eigen::VectorBlock<Derived, 2>
firstTwo(MatrixBase<Derived>& v)
{
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
}
template<typename Derived>
const Eigen::VectorBlock<const Derived, 2>
firstTwo(c... | TOOL | 0.966037 | 5.212729 |
ac37f314-2f5d-4486-8f9b-3054a5bb5c97 | QbitQuantum/Basics | Исходники/VrCommon.cpp | // -1 to 1 range on panelMatrix, returns -2,-2 if looking away from the panel
Vector2f GazeCoordinatesOnPanel( const Matrix4f & viewMatrix, const Matrix4f panelMatrix, const bool floatingPanel )
{
// project along -Z in the viewMatrix onto the Z = 0 plane of activityMatrix
const Vector3f viewForward = MatrixForward(... | ALGO | 0.998145 | 5.97046 |
79f08284-fd9e-4167-b979-c152b3978197 | windbicycle/oru-ros-pkg | grasping_oru/aass_icr/libqhull-ours/Qhull-2011.2/src/libqhullcpp/QhullVertexSet.cpp | #//! QhullVertexSet -- Qhull's linked Vertexs, as a C++ class
#include "QhullVertex.h"
#include "QhullVertexSet.h"
#include "QhullPoint.h"
#include "QhullRidge.h"
#include "QhullVertex.h"
using std::string;
using std::vector;
#ifdef _MSC_VER // Microsoft Visual C++ -- warning level 4
#pragma warning( disable : 4611... | TOOL | 0.91971 | 5.744426 |
fa1e7623-f7ef-43f3-b873-3142cddc3fe4 | lubas569/st-brn--octo-palma | tests/test_pairs_decoding.cpp | #include <cstdio>
#include <cstdlib>
#include <memory>
#include <vector>
#include <gtest/gtest.h>
#include <faiss/IndexIVF.h>
#include <faiss/AutoTune.h>
#include <faiss/VectorTransform.h>
#include <faiss/IVFlib.h>
namespace {
typedef faiss::Index::idx_t idx_t;
/***************************************************... | TEST | 0.932899 | 7.01046 |
62db7ade-2700-4a54-942d-d0d5b941343d | endixk/c-playground | boj/src/0094/Q9498.cpp | // BOJ 9498 [Grading]
// Supported by GitHub Copilot
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
cout << "FFFFFFDCBAA"[N/10] << endl;
}
| ALGO | 0.999168 | 4.344937 |
2281c41a-c4c3-4a03-b2cf-cea174450bcd | opensource-hisense/SmartTV-SeriesVidaaU7_NT | oss/part1/boost/boost_1_73_0/libs/math/example/lambert_w_diode.cpp | /*! brief Example of using Lambert W function to compute current through a diode connected transistor with preset series resistance.
\details T. C. Banwell and A. Jayakumar,
Exact analytical solution of current flow through diode with series resistance,
Electron Letters, 36(4):291-2 (2000)
DOI: doi.org/10.1049... | ALGO | 0.998552 | 6.088542 |
3d64861d-9a45-4ee1-b6fd-4440b7756262 | Johniel/uva | 230.cpp | #include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
struct Book{
string t, a;
Book(string _t, string _a) : t(_t), a(_a) {}
};
bool operator < (const Book &a, const Book &b)
{
if(a.a != b.a)return a.a < b.a;
return a.t < b.t;
}
pair<string, string> sep(string s)
{
st... | TOOL | 0.966836 | 3.851614 |
d1e22026-c586-4fca-9cff-c8afe11169b7 | bethanyyk/ucla-coursework | com-sci-32/hw 2/mazequeue.cpp | #include <queue>
#include <iostream>
using namespace std;
class Coord
{
public:
Coord(int rr, int cc) : m_r(rr), m_c(cc) {}
int r() const { return m_r; }
int c() const { return m_c; }
private:
int m_r;
int m_c;
};
bool pathExists(char maze[][10], int sr, int sc, int er, int ec)
// Return true if t... | ALGO | 0.999948 | 4.686034 |
2aab8af9-da63-4b4f-9614-95f9689875d0 | Akhileshramks/LeetCode_Solution | 0044-wildcard-matching/0044-wildcard-matching.cpp | class Solution {
public:
bool wildcardmatching(int i,int j,string& s, string& p,vector<vector<int>> &dp){
if(i<0 && j<0) return true;
else if(i<0){
for(int m = 0;m<=j;m++){
if(p[m]!='*'){
return false;
}
}
return... | ALGO | 0.999989 | 5.081748 |
8de21d13-b07c-4468-9063-3cb778d3e961 | eng-arvind/Data-structure-using-CPP | check.cpp | #include<iostream>
using namespace std;
int fun(int n)
{
if(n)
{
fun(n-1);
cout<<n<<" ";
fun(n-1);
fun(n-1);
}
}
int main()
{
int n;
cin>>n;
fun(n);
}
| ALGO | 0.999949 | 3.936503 |
62dc897f-6e9e-4816-a2d7-4bb5b4c2bb72 | pvthuyet/CppInAction | lib/boost_1_70_0/libs/chrono/example/min_time_point.cpp | // min_time_point.cpp ----------------------------------------------------------//
#include <boost/chrono/typeof/boost/chrono/chrono.hpp>
#include <boost/type_traits.hpp>
#include <iostream>
using namespace boost::chrono;
template <class Rep, class Period>
void print_duration(std::ostream& os, duration<Rep, Perio... | TOOL | 0.854 | 5.73795 |
3fc2869c-5324-4779-8202-225a2c3748fc | InsaneX4/progs | codeforces/WinterSale.cpp | #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
double x = 15;
double p = 20;
double y = 10;
//cin >> x >> p;
double mp = (p*100)/(100-x);
//mp = round((mp*100))/100;
cout << fixed << setprecision(2)... | ALGO | 0.998241 | 3.441809 |
b9c42128-bc29-4813-af6a-b04afcd65c3e | eth-sri/synthetiq | include/eigen-3.3.9/doc/examples/tut_arithmetic_scalar_mul_div.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace Eigen;
int main()
{
Matrix2d a;
a << 1, 2,
3, 4;
Vector3d v(1,2,3);
std::cout << "a * 2.5 =\n" << a * 2.5 << std::endl;
std::cout << "0.1 * v =\n" << 0.1 * v << std::endl;
std::cout << "Doing v *= 2;" << std::endl;
v *= 2;
std::cout << ... | ALGO | 0.988614 | 3.669638 |
e56ef7b7-1b05-4378-ad0e-9b3e58f70010 | PavloKravetsVilnius/Assignments | Assignment5_Task1.cpp | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
int main() {
const int numStudents = 10;
const int numSubjects = 4;
vector<vector<int>> grades(numStudents, vector<int>(numSubjects));
vector<double> studentAverages(numStudents);
vector<double> subjectAverages(numSubjec... | ALGO | 0.995602 | 6.751775 |
58e6a3ea-a900-4594-91e5-39b9c2cc1d53 | ashhek/Leetcode_solution | 0463-island-perimeter/0463-island-perimeter.cpp | class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
int ans=0;
int n=grid.size();
int m=grid[0].size();
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(grid[i][j]==1){
ans+=4;
if(i>0&&grid[i-1][j... | ALGO | 0.999867 | 6.029744 |
588d4de0-10fb-46fe-99f8-7b1b6a6af02c | Nishant5789/My_Tech_Notes | stack/valid_paretnesis.cpp | #include<bits/stdc++.h>
using namespace std;
#define MAX 1000
class Stack
{
int Top;
public:
string arr[MAX]; //Maximum size of Stack
Stack() { Top = -1; }
void push(string x)
{
arr[++Top]=x;
}
void pop()
{
if(Top>=0)
Top--;
}
bool empty()
... | ALGO | 0.999835 | 3.605229 |
8a7ce355-7a61-43fb-86f4-116d01cc2259 | MedAzizTousli/Competitive-Programming-Solutions | Codeforces/Educational Codeforces Round 86/A_Road_To_Zero.cpp | #include <bits/stdc++.h>
#define ll long long
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end))) // rep(i, 1, 5) --> {1,2,3,4} // rep(i, 5, 1) --> {4,3,2,1} // rep(it, end(v), begin(v)) --> *it
using namespace std;
int main()
... | ALGO | 0.999132 | 3.396412 |
7d2cda10-7431-48d4-a7fa-35a3cde29304 | justintelmo/tapblaze-spinwheel-client | cocos2d/extensions/Particle3D/PU/CCPUInterParticleCollider.cpp | #include "CCPUInterParticleCollider.h"
#include "extensions/Particle3D/PU/CCPUParticleSystem3D.h"
NS_CC_BEGIN
// Constants
const float PUParticle3DInterParticleCollider::DEFAULT_ADJUSTMENT = 1.0f;
const PUParticle3DInterParticleCollider::InterParticleCollisionResponse PUParticle3DInterParticleCollider::DEFAULT_COLLIS... | TOOL | 0.916656 | 6.909686 |
0e1ffbd2-aa22-4c34-a46d-76fdd268b913 | sarvex/leetcode-lua | solution/0800-0899/0822.Card Flipping Game/Solution.cpp | class Solution {
public:
int flipgame(vector<int>& fronts, vector<int>& backs) {
unordered_set<int> s;
int n = fronts.size();
for (int i = 0; i < n; ++i)
if (fronts[i] == backs[i])
s.insert(fronts[i]);
int ans = 9999;
for (int& v : fronts)
... | ALGO | 0.999925 | 5.451608 |
bea71c92-462f-4155-b2c7-0eca837deab2 | namanjain007/Competitive-Programming-Template | c18.cpp | #include <bits/stdc++.h>
#define int long long
#define uint unsigned int
#define ld long double
#define showoff ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define RFOR(i,a,b) f... | ALGO | 0.999822 | 4.643166 |
c01e7087-8767-43cd-91a4-8c1d255b9c3c | rajephon/programmers_training | cpp/level2_getMinSum.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int getMinSum(vector<int> A, vector<int> B) {
int answer = 0;
while (A.size() > 0) {
std::vector<int>::iterator a_min = std::min_element(A.begin(), A.end());
std::vector<int>::iterator b_max = std::max_element(B.beg... | ALGO | 0.999849 | 5.375882 |
5cea986d-e067-4290-ba34-1604c0b39139 | indrakanti/9x_ComputerVision_- | 02_ImageFiltering/02_LinearFiltering/03_GaussianFilter/gaussianPyramid.cpp | #include <opencv2/opencv.hpp>
#include <iostream>
cv::Mat applyGaussianFilter(const cv::Mat& image, int kernelSize, double sigma) {
cv::Mat result;
cv::GaussianBlur(image, result, cv::Size(kernelSize, kernelSize), sigma);
return result;
}
cv::Mat downsampleImage(const cv::Mat& image) {
cv::Mat downsam... | TOOL | 0.95825 | 6.490932 |
eba7cdb5-f75a-4597-8590-85146732c2e5 | OpenGVLab/Ask-Anything | video_chat_text/video_chat_with_ChatGPT/models/grit_src/third_party/CenterNet2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp | namespace detectron2 {
template <typename T>
void box_iou_rotated_cpu_kernel(
const at::Tensor& boxes1,
const at::Tensor& boxes2,
at::Tensor& ious) {
auto num_boxes1 = boxes1.size(0);
auto num_boxes2 = boxes2.size(0);
for (int i = 0; i < num_boxes1; i++) {
for (int j = 0; j < num_boxes2; j++) {
... | ALGO | 0.991402 | 7.187095 |
a6408a78-0fc5-4f55-9b9c-3b717497aff5 | Itadakimashu/XPSC_BATCH_O3 | Week 02/problemB.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int t; cin >> t;
while(t--){
int n; cin >> n;
int h = -1;
map<int,int> k;
for(int i = 0; i < n; i++){
int x; cin >> x;
k[x]++;
if(k[x] >= 3) h = x;
}
cout << h << endl;
... | ALGO | 0.999922 | 3.925909 |
45f4fcb5-6f0b-43e4-8fde-184a408988d9 | sahilwep/DSA-Workspace | Leetcode/Easy/94.Binary_Tree_Inorder_Traversal.cpp | /*
// 94. Binary Tree Inorder Traversal
// Observations:
* We are given a binary tree, & we need to traverse it in InOrder
* InOrder: traversal order (left) -> (root) -> (right)
// Example 1:
Input: root = [1,null,2,3]
[1]
\
... | ALGO | 0.99998 | 7.067374 |
edc1a0cf-a02c-4297-9b46-5d12929d4631 | abhisri45/algoAndDS | graphs/bfs.cpp | #include<iostream>
#include<vector>
#include<map>
#include<queue>
void printAdjacencyList(std::map<char, std::vector<char>> adjmap)
/*
function to print adjanceyList
*/
{
std::map<char, std::vector<char>>::iterator it = adjmap.begin();
for( ; it!=adjmap.end(); it++)
{
std::cout << "Map: " << it->fi... | ALGO | 0.99998 | 4.652052 |
3f1e1ebb-2413-413e-938d-f0330105b90b | AbdallahHossam0/Leet-Code-Solution | Transpose Matrix/Solutions/solution1.cpp | class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& matrix) {
auto s1{matrix.size()};
auto s2{matrix[0].size()};
vector<vector<int>> ret(s2, vector<int>(s1, 0));
for(size_t i = 0; i < s2; ++i){
for(size_t j = 0; j < s1; ++j){
ret[i]... | ALGO | 0.999961 | 6.446598 |
740195e6-2a29-40c5-beac-f94c6c150c85 | kkafar/algo | algorytmy/drzewa/sciezka-korzen-wezel.cpp | /*
Wyznaczanie ścieżki z korzenia do każdego z węzłów drzewa.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DLA DRZEWA ZRÓWNOWAŻONEGO I UPORZĄDKOWANEGO
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(wg następującej def: binarne drzewo jest zrównoważone i uporządkowane, jeśli na wszystkich
poziomach za w... | ALGO | 0.999996 | 4.725744 |
d5bb6c6b-f52d-47a5-b86c-175cb83149a8 | Ilyagu/Algorithms_and_data_structures | Module1/Task4/main.cpp | #include <iostream>
#include <cassert>
using namespace std;
template <class T>
struct Train_Time {
T arrival = 0;
T departure = 0;
};
template <class T>
struct DefaultComparator {
bool operator()(const T &l, const T &r) {
return l < r;
}
};
template <class T, class Comparator = DefaultCompar... | ALGO | 0.999919 | 5.16573 |
38c6cd1d-85ec-4c55-89c4-52637eb686f8 | siddharthkadu/LeetCode | 0392-is-subsequence/0392-is-subsequence.cpp | class Solution {
public:
bool isSubsequence(string s, string t) {
int n=s.size();
int m=t.size();
int i=0,j=0;
while(i<n && j<m){
if(s[i]==t[j]){
i++;
}
j++;
}
return i==n;
}
}; | ALGO | 0.99993 | 6.227037 |
23646a01-d00e-4c5f-8232-6e96dd4fe501 | jHoon0223/Cpp_Self-Study | BOJ/2021/Bruteforcing/2798.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> v, answer;
for (int i = 0; i < N; i++) {
int a;
cin >> a;
v.push_back(a);
}
//sort(v.begin(), v.end());
/*for (int i = 0; i < N; i++)
... | ALGO | 0.999993 | 3.780931 |
43d92ac2-4356-41e1-93cb-c079fb203e4a | Void-Anvesha/Leetcode | 2106-find-greatest-common-divisor-of-array/find-greatest-common-divisor-of-array.cpp | class Solution {
public:
int gcd(int a,int b)
{
while(b!=0)
{
int temp=b;
b=a%b;
a=temp;
}
return a;
}
int findGCD(vector<int>& nums) {
int mini=INT_MAX;
int maxi=INT_MIN;
for(int i=0;i<nums.size();i++)
{
maxi=max(maxi,num... | ALGO | 0.999969 | 5.593491 |
6a9ca57a-4010-4da0-83b1-228d7526e663 | raincross7/code-similarity | codes/train_code/problem151/problem151_183.cpp | #include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする
//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい
// https://github.com/atcoder/live_library
// cppdbg: test.exeのterminalに標準入力を打てる
#define ALL(x) x.begin(),x.end()
#define get_tp(t,i) get<i>(... | ALGO | 0.998799 | 5.160008 |
226c2cfb-f65f-4528-9279-2fc7507f7e44 | junhwan26/PS | 2019 NYPC/우산.cpp | #include<stdio.h>
int umb[10];
int main()
{
int n,m,bc;
int cnt=0;
scanf("%d %d %d",&n,&m,&bc);
for(int i=0;i<m;i++)
{
int a,b;
scanf("%d %d",&a,&b);
if(b==1)
umb[a]++;
if(b==1&&umb[bc]==0)
cnt++;
bc=a;
}
printf("%d",cnt);
}
| ALGO | 0.999764 | 3.19769 |
3a8e504c-17e8-42ed-b81f-82f3ff1ee071 | Ikaron/fiesta-filter | FilterLib/src/FilterUtils.cpp | #include "FilterLib/FilterUtils.h"
#include <format>
#include <sstream>
#include <chrono>
#include <ctime>
#include <iostream>
#include <conio.h>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
bool ParseOctet(std::string_view str, uint8_t& octet)
{
octet = 0;
char* pEnd;
errno = 0;
uint64_t val = s... | TOOL | 0.97785 | 5.827708 |
15b67ae6-eec5-4a15-b3c2-0196f9f65ca6 | onethousent/mirea | indystrialka/13 Практика/EquationsSolver.cpp | #include <iostream>
#include <cmath>
class EquationsSolver {
private:
double coefficients[8];
void calculateRoots(int equationType);
void solveByBruteForce(int equationType);
void displayEquation(int equationType, double root1, double root2);
public:
void solveEquations();
};
#include "Equation... | ALGO | 0.999492 | 3.647835 |
0ebdbc65-9ff9-4c63-933d-401460ebcbab | soyyuz/opencv-contrib-ARM64 | opencv/opencv_contrib-master/modules/ximgproc/src/lsc.cpp | /*
"Superpixel Segmentation using Linear Spectral Clustering"
Zhengqin Li, Jiansheng Chen, IEEE Conference on Computer Vision and Pattern
Recognition (CVPR), Jun. 2015
OpenCV port by: Cristian Balint <cristian dot balint at gmail dot com>
*/
#include <map>
#include <queue>
#include "precomp.hpp"
using namespac... | ALGO | 0.996804 | 4.971089 |
54f409cb-9d49-4bc2-896b-fa9680f28083 | ggnkua/Atari_ST_Sources | Docs/cpptut/SOURCE/VARDEF.CPP | // Chapter 1 - Program 5
#include <iostream.h>
int index;
main()
{
int stuff;
int &another_stuff = stuff; // A synonym for stuff
stuff = index + 14; //index was initialized to zero
cout << "stuff has the value " << stuff << "\n";
stuff = 17;
cout << "another_stu... | ALGO | 0.978334 | 3.066232 |
20775e70-4b72-462b-8d43-cff1fadfa468 | ashib11/Sub_Zero_ | D_Matryoshkas.cpp | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
#define ll long long
#define pi acos(-1.0)
#define ull unsigned long long
#define endl "\n"
#define all(v) v.begin(), v.end()
#define allr(v) v.r... | ALGO | 0.9997 | 4.351736 |
e9417fad-1d98-4810-8334-66cc3193d22a | nish591/DS-A-Assignment | AddLargeIntegers.cpp | #include<iostream>
#include<string>
#include<bits/stdc++.h>
using namespace std;
string addLargeIntegers(string a, string b){
int i,na =a.size(),nb = b.size();
string str1 = min(na,nb) == na ? b : a, str2;
str2 = str1 == b ? a : b;
int n1 = str1.size(), n2 = str2.size();
string res ="0";
if(n1!=... | ALGO | 0.999819 | 4.893742 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.