uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
065d0997-aca9-4964-ab15-e5c6a985df7a | landaudiogo/CP | uVA/p10901v2.cpp | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include <queue>
#define FileIn(file) freopen(file".inp", "r", stdin)
#define FileOut(file) freopen(file".out", "w", stdout)
#define FOR... | ALGO | 0.999697 | 3.271934 |
87226312-b1d4-44fc-af8c-60569faa5819 | robertmuresan/Arobs | Main.cpp | #include "Algorithms.hpp"
#include "List.hpp"
#include "ListNode.hpp"
#include "Queue.hpp"
#include "PriorityQueue.hpp"
#include "SynchronizedPriorityQueue.hpp"
#include "Task.hpp"
#include "TaskScheduler.hpp"
#include "Vector.hpp"
#include <iostream>
int main()
{
int array[10] = { 0, 3, 9, 2, 5, 6, 9, 31, 4, 0 ... | TOOL | 0.994719 | 3.852627 |
11a2c4b1-54c6-4c80-889a-00f6b203bc79 | abhishek18124/PPCPPOct2023 | Lecture 24/007CheckSorted.cpp | #include<iostream>
using namespace std;
bool f(int X[], int n, int i) {
// base case
if (i == n - 1) {
// check if X[n-1...n-1] is sorted
return true;
}
// recursive case
// check if X[i...n-1] is sorted
return X[i] < X[i + 1] and f(X, n, i + 1);
}
int main() {
int X[] = {1, 2, 3, 4, 5};
int n = s... | ALGO | 0.999932 | 5.136081 |
86fd6b65-5de9-4188-81eb-bbe669764433 | keywet06/code | CF/CF1641C.cpp | #include <bits/stdc++.h>
template <typename Type1, typename Type2>
inline Type1 &Mid(Type1 &x, Type2 y) {
return x < y ? x : (x = y);
}
const int M = 10000005;
struct Node {
int l, r, s;
Node() {}
Node(int L, int R, int S) : l(L), r(R), s(S) {}
};
int Cnt = 0;
Node Seg[M];
int main() {
std::io... | ALGO | 0.999905 | 5.000528 |
4d4c58ea-dd0d-4a16-99f0-06e0c4cfa85f | MihaplAyMF/study | cpp/Stephen Prata/Examples/Chapter 3/exceed.cpp | // exceed.cpp -- exceeding some integer limits
#include <iostream>
#define ZERO 0 // makes ZERO symbol for 0 value
#include <climits> // defines INT_MAX as largest int value
int main()
{
using namespace std;
short sam = SHRT_MAX; // initialize a variable to max value
unsigned short sue = sam;// ok... | ALGO | 0.885464 | 3.933163 |
fea6a812-9a9f-457f-b963-2361ea5c0798 | ayushpatel5475/CPP-GFG-CODES | 01. BASICs of C++/02. FLow, Control, Function and Loops/Lec_12.cpp | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
int a=9,b=2,x=100;
cout<<pow(a,b)<<"\n";
cout<<log10(x);
return 0;
} | ALGO | 0.939568 | 3.572984 |
e9aec3f0-e901-4156-8b8e-8cc6f7c6fb6e | ornob011/HackerRank | ACM_ICPC_Team.cpp |
#include<bits/stdc++.h>
using namespace std;
int acm(string &a, string &b, int length)
{
int topicsKnown=0;
for(int i=0; i<length; i++)
{
if(a.at(i)=='1' or b.at(i)=='1')
topicsKnown++;
}
return topicsKnown;
}
int main()
{
freopen("/home/ornob/Downloads/Practice/input.txt", "r", stdin);
freopen("... | ALGO | 0.999936 | 3.559805 |
ebfd7046-b3af-427b-9ee6-55b90a7f177d | SiddharthVerma2206/LeetCode | TUF/Medium/MaxOnes.cpp | class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int max=0;
int n= nums.size();
int ans=0;
for(int i=0 ;i<n;i++)
{
if(nums[i]==1)
ans++;
else{
if(max < ans)
max=ans;
ans=0;
}
}
if(max<ans)
m... | ALGO | 0.999974 | 6.044707 |
6b59e7d6-1485-415a-908d-102aa31f2a5a | Ricxel/PROGRAMMAZIONE_1 | LAB/30-nov-2023/albero_binario/coda/coda.cpp | #include <iostream>
#include "coda.h"
using namespace std;
static coda Q;
static bool coda_vuota() {
return (Q.head == NULL);
}
void coda_init() {
Q.head = NULL;
}
bool coda_enqueue(char *s) {
bool risultatoOperazione;
listaCoda nuovoNodo = new (nothrow) nodoCoda;
if (nuovoNodo==NULL) {
... | TOOL | 0.966717 | 4.2846 |
918109e1-ec0a-4955-ba05-1f4408055060 | Cellul4r/Comp_Programming | Codeforces/1556B.cpp | /*
* author : cellul4r
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
#define all(x) x.begin(), x.end()
const char nl = '\n';
const int N =1e5+1;
const int INF = 1e9+7;
const ll LINF = 1e18+7;
... | ALGO | 0.999489 | 4.47345 |
e0d70229-a972-4d19-a766-a94562466a36 | voka/Backjoon | 20210524/2042_세그먼트트리_구간합.cpp | #include<algorithm>
#include<iostream>
#include<vector>
#include<math.h>
#define Loop(i,s,n) for(int i=s;i<n;++i)
typedef long long ll;
using namespace std;
int N,M,K;
int tree_size;
ll init_tree(vector<ll> &arr, vector<ll> &tree, int node, int start, int end)
{
if (start == end)
return tree[node] = arr[s... | ALGO | 0.999964 | 4.229538 |
28807828-4b62-4dda-bb73-5f4462646e0c | ishandutta2007/codeforces | alon-tanay/normal/1419/D1.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
long int n, a;
vector<long int> p;
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for(int i = 0; i < n; i ++) {
cin >> a;
p.push_back(a);
}
cout << (n-1)/2 << endl;
... | ALGO | 0.999731 | 3.063127 |
2a6c7f44-a57c-44db-b7a9-2a0b51280aa8 | CPcoding0930/ACMPractice-C- | LargestSubsequence/Source.cpp | #include <queue>
#include <iostream>
#include <string>
using namespace std;
char largest(string s) {
char c = 'a';
for (int i = 0; i < s.length(); i++) {
if (s.at(i) > c) {
c = s.at(i);
}
}
return c;
}
string eraseStr(string s, char c) {
for (int i = 0; i < s.length(); i++) {
if (c == s.at(i)) {
s = ... | ALGO | 0.999874 | 4.325223 |
263ef2f3-75b3-4e11-99f8-6e3cb59e3667 | sagilyp/OOP | 1/matrix.cpp | #include <iostream>
#include "matrix.h"
namespace mtr{
void input(Matrix& matrix){
std::cout << "Enter number of rows >> " << std::endl;
try{
matrix.rows = getNum<int>(0);
std::cout << "Enter number of columns >> " << std::endl;
matrix.columns = getNum<int>(0);
... | ALGO | 0.998698 | 3.42845 |
b00b783b-f36c-48c8-8917-a3fad2bd5e3b | ishandutta2007/codeforces | leapfrog/normal/1419/A.cpp | #include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x)
{
x=0;char c=getchar(),f=0;
for(;c<'0'||c>'9';c=getchar()) if(!(c^45)) f=1;
for(;c>='0'&&c<='9';c=getchar()) x=(x<<1)+(x<<3)+(c^48);
if(f) x=-x;
}
template<typename T>inline void write(T x) {{if(x<0) putchar('-'),x=-x;}{if(x>9) ... | ALGO | 0.999891 | 3.909877 |
6caea0bd-5a98-4ed2-877c-3b148e078f5e | rohyunsang/Algorithm | TwoPointer/B[2467].cpp | #include <iostream>
#include <vector>
using namespace std;
#define MAX 2123456789; // MAX 2123456789 로 설정하기.
int main() {
int n;
cin >> n;
vector<int> v;
for(int i = 0; i < n; i++) {
int x;
cin >> x;
v.push_back(x);
}
int min = MAX;
int leftPointer = 0;
int rightPointer = 0;
int start = 0;
int end... | ALGO | 0.999993 | 4.191135 |
2602c427-6ecf-4917-8b02-344cc674ad8d | bhoomisrivastava/GFG-codes | Difficulty: School/Vowel or Not/vowel-or-not.cpp | //{ Driver Code Starts
#include<bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution{
public:
string isVowel(char c){
if(c=='a'|| c=='e'|| c=='i'|| c=='o'|| c=='u' || c=='A'|| c=='E'|| c=='I'|| c=='O'|| c=='U')
{
return "YES";
}
else
{
return "NO";
}
// code here
... | ALGO | 0.995714 | 5.863722 |
3ddbd26e-5de8-4dc0-8fab-6b58a16988dd | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_2950_60.cpp | #include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int INF = 1000000000;
const long long LINF = 4000000000000000000ll;
void prepare() {}
int n, k, h;
int m[100005], v[100005];
pair<pair<int, int>, int> lem[100005];
int ans[100005];
bool f(double t) {
int cur = n - 1;
for (int i = k; i > 0;... | ALGO | 0.999993 | 3.151186 |
fa4c05f6-b671-4214-bb0a-a99a75e081f2 | Hinski2/CP | codeforces/problems/Vlad and a Sum of Sum of Digits/cpp1266.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>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v){
for(const auto &u: v){
os << u << ' ';
}
return os;
}
te... | ALGO | 0.999615 | 5.158624 |
c86af93a-1b7b-47a3-af86-8f90ee0b5c90 | hsiuyee/CSES | Sorting and Searching/CSES Problem Set Nested Ranges Count.cpp | // refer to: https://www.geeksforgeeks.org/cses-solutions-nested-ranges-check/
// we can see graph [ {} ] think this correctness
#include <algorithm>
// #include <bits/stdc++.h>
#include <deque>
#include <cmath>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <set>
#include <map>
#include <tuple>
#in... | ALGO | 0.999958 | 3.438409 |
f9ccabb0-6004-4d0c-9ec2-0521020f3f66 | JYOTHIkudipudi/GeekForGeek | KthDistinctElement.cpp | /* K-th distinct element
Difficulty: BasicAccuracy: 38.6%Submissions: 5K+Points: 1
Given an array of n integers. Find the kth distinct element.
Example 1:
Input:
n = 6, k = 2
arr = {1, 2, 1, 3, 4, 2}
Output:
4
Explanation: 1st distinct element will be 3
and the 2nd distinct element will be 4. As
both the ele... | ALGO | 0.999962 | 6.077201 |
ef9fd737-e01d-49dc-bdf7-271198558bd0 | homedory/codetree-TILs | 240123/연속한 K개의 숫자/k-numbers-in-a-row.cpp | #include <iostream>
#include <unordered_set>
using namespace std;
int main() {
int N, K, B;
unordered_set <int> missing_num;
cin >> N >> K >> B;
for (int i = 0; i < B; i++) {
int a;
cin >> a;
missing_num.insert(a);
}
int sum = 0;
for (int i = 1; i <= K; i++) {
... | ALGO | 0.999915 | 3.679165 |
25354f6c-aa8e-4719-b8ae-3e51f81e790c | karmineg/CPP-algorithms-data-structures | Algoritmos/Exercícios 12/Aula08_EX12_6.cpp | /* 6 - Faa um programa para realizar operaes sobre um vetor V[5]. O programa dever exibir um menu com as seguintes opes:
a) Gerar vetor - o programa dever gerar V com nmeros aleatrios, sendo que o intervalo deve ser informado pelo
usurio, ou seja, ler dois nmeros inteiros X e Y, sendo que o intervalo para a gerao dos n... | TOOL | 0.912992 | 3.425635 |
0b7746e4-0abe-4f66-8cf8-3ef1a94d4163 | ContaCtcore/Gcontact | dep/ACE_wrappers/ace/ACE_crc_ccitt.cpp | // $Id: ACE_crc_ccitt.cpp 80826 2008-03-04 14:51:23Z wotte $
#include "ace/ACE.h"
ACE_RCSID (ace,
ACE_crc_ccitt,
"$Id: ACE_crc_ccitt.cpp 80826 2008-03-04 14:51:23Z wotte $")
namespace
{
/*****************************************************************/
/* ... | TOOL | 0.993308 | 6.750813 |
50821024-732d-4d3d-a98b-87489b412ee2 | syed0369/LeetcodeSolutions | Daily-Solutions/2024-05-09-Maximize-Happiness-of-Selected-Children.cpp | /********************************************
Solution to LeetCode Daily Question 05-09-2024.
Problem:
You are given an array happiness of length n, and a positive integer k.
There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n chi... | ALGO | 0.999996 | 5.971594 |
0ad52848-2d50-4d8a-9632-8cd96de2b3dc | CleMTales/College | Prog1/Atvd 4.cpp | #include <stdio.h>
#include<stdlib.h>
main()
{
float n1,n2,n3;
printf("Programa para mostrar o maior numero dentre tres.\n");
printf("Digite um numero: ");
scanf("%f", &n1);
printf("Digite outro numero: ");
scanf("%f", &n2);
printf("Digite outro numero: ");
scanf("%f", &n3);
if (n1>n2 and n1>n3)
printf... | ALGO | 0.996281 | 3.244826 |
fcc7a5b5-f5bd-49c3-a4bd-126c40262bd5 | Sharmildamor/SE_Assignment_M2 | SHARMIL__M2/SHARMIL__m2_Extra/module_2_6_3.cpp | /* Write a C program that counts the number of words in a sentence entered by the user.
Challenge: Modify the program to find the longest word in the sentence.
Ans. */
#include<stdio.h>
main()
{
char str[10];
int i, count=0;
printf("\n\n\t Enter any string : ");
scanf("%s",&str);
for(i=0; str[i]!='\0'; i++)... | ALGO | 0.999081 | 3.153392 |
ad8de0a0-a196-4696-bb89-4095579a3fcc | YolieQQQ/AtCoder | abc150/a.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define xrep(i,a,b) for(int i=int(a);i<int(b);++i)
using ll = long long;
int main() {
int K, X;
cin >> K >> X;
int all = K*500;
if(all>=X) {
cout << "Yes" << endl;
}
else {
c... | ALGO | 0.999897 | 3.250138 |
492c74cf-2522-4cab-94ee-b47ad506abd1 | simplewithalex/MyLeetCodeSln | LeetCode/0406.根据身高重建队列.cpp | #include "header.h"
/*
д˳һȺվһС
ÿһ(h, k)ʾh˵ߣkǰߴڻh
дһ㷨ؽС
ע⣺
1100ˡ
ʾ
:
[[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]
:
[[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]]
*/
class Solution {
public:
vector<vector<int>> reconstructQueue(vector<vector<int>> &people)
{
if (people.empty()) return{};
sort(people.begin(),... | ALGO | 0.999999 | 5.446256 |
99467540-3fe8-41a5-b47a-b998c34da39f | pandayed/LeetCode | 130-surrounded-regions/130-surrounded-regions.cpp | class Solution {
public:
bool solver(vector<vector<char>>& board, int i, int j, int r, int c, vector<vector<bool>> &visited){
// cout << "er" << endl;
if((i>=r or j>=c) or (i<0 or j<0)){
return false;
}
if(board[i][j]=='X'){
return true;
... | ALGO | 0.99991 | 5.679609 |
524bb84d-3e3c-41f5-b75a-7f92a3a2eb21 | Nura-Alam-Naim/CSE246 | Faractional_Knapsack.cpp | //|ADMIRAL_AUDITORE|//
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
#define nl "\n"
#define sp ' '
#define yes cout << "YES" << nl
#define no cout << "NO" << nl
#define all(v) v.begin(), v.end()
#define pb push_back
#define ff first
#define ss second
const ll N = 1e6 + ... | ALGO | 0.999517 | 4.258651 |
ddbe5cd8-54e3-48de-b79d-d229238f48c9 | GopherTeen/template | Category/03_Graph/最长路.cpp | // TopoSort + DP
//
// 计算一张 DAG 中的最长路径,在执行前可能需要使用 dijkstra 重构一张正确的 DAG
//
struct DAG {
int n;
vector<vector<pair<int, i64>>> g;
vector<int> deg;
vector<i64> dis;
public:
explicit DAG(int n) { init(n); }
void init(int n) {
this->n = n;
g.assign(n, {});
deg.assign(n, 0);
... | ALGO | 0.999606 | 5.472977 |
6c1520d2-07ed-4e20-a528-418d9c442202 | sency90/boj | 11653-1.cpp | #include <stdio.h>
int main() {
long long n;
scanf("%lld", &n);
for(long long i=2; i*i<=n; i++) {
while(n%i == 0) {
printf("%lld\n", i);
n/=i;
}
}
if(n!=1) printf("%lld\n", n);
return 0;
}
| ALGO | 0.999973 | 4.251439 |
2e196ab3-aaa4-4f3d-9616-982a32c654ee | chongin12/Problem_Solving | acmicpc.net/old/4225.cpp | #include <bits/stdc++.h>
using namespace std;
struct pos{
long double x, y;
pos(){x=0,y=0;}
pos(long double x, long double y):x(x),y(y){}
};
vector<pos> v;
int ccw(pos a, pos b, pos c){
long double t=(a.x*b.y+b.x*c.y+c.x*a.y)-(a.y*b.x+b.y*c.x+c.y*a.x);
if(t>0) return 1;
if(t<0) return -1;
return 0;
}
long double... | ALGO | 0.999818 | 4.221766 |
925650e1-d6cd-42a2-816e-0f7a49c0532b | MostafaAshraf98/Problem-Solving | Array/Leetcode/1817.FindingtheUsersActiveMinutes.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define sf(n) scanf("%d", &n)
#define sff(n, m) scanf("%d%d",&n,&m)
#define sfl(n) scanf("%I64d", &n)
#define sffl(n, m) scanf("%I64d%I64d",&n,&m)
#define sfs(s) scanf("%s",s... | ALGO | 0.999486 | 5.092671 |
5520846b-0403-43bf-9b16-993e213ecf86 | HJWAJ/acm_codes | CF/20120630/A.cpp | #include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#include<string>
#include<vector>
using namespace std;
char s[15];
char tmp[15];
char ans[15];
bool pal(int a)
{
char ss[15];
memset(ss,0,size... | ALGO | 0.999997 | 3.254446 |
5ba4222d-3c5b-4aba-9492-ca72aa6c7b96 | zarathustr/PX4Flow-opencv | opencv/modules/imgproc/src/moments.cpp | #include "precomp.hpp"
// The function calculates center of gravity and the central second order moments
static void icvCompleteMomentState( CvMoments* moments )
{
double cx = 0, cy = 0;
double mu20, mu11, mu02;
assert( moments != 0 );
moments->inv_sqrt_m00 = 0;
if( fabs(moments->m00) > DBL_EPSIL... | ALGO | 0.999016 | 3.130382 |
dc980ede-328f-4c8b-9972-43f28de5ab81 | sarvex/leetcode-tsh | solution/1300-1399/1329.Sort the Matrix Diagonally/Solution.cpp | class Solution {
public:
vector<vector<int>> diagonalSort(vector<vector<int>>& mat) {
int m = mat.size(), n = mat[0].size();
for (int k = 0; k < min(m, n) - 1; ++k)
for (int i = 0; i < m - 1; ++i)
for (int j = 0; j < n - 1; ++j)
if (mat[i][j] > mat[i +... | ALGO | 0.999987 | 5.868963 |
0bdcdc19-5e0e-493c-ae40-7809cc01b0d0 | rahul-aggarwal000005/Data-Structures-and-Algorithms | Day-17/Height of a 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.999695 | 6.356932 |
8f4c4731-d3f9-4f6e-a830-68bb9e34c6fe | walkccc/LeetCode | solutions/825. Friends Of Appropriate Ages/825.cpp | class Solution {
public:
int numFriendRequests(vector<int>& ages) {
int ans = 0;
unordered_map<int, int> count;
for (const int age : ages)
++count[age];
for (const auto& [ageA, countA] : count)
for (const auto& [ageB, countB] : count)
if (request(ageA, ageB))
if (ageA ... | ALGO | 0.999077 | 6.061577 |
01791fae-0187-4213-8259-fa10e59eed12 | MartinTschechne/ASL-hdbscan | src/common/vector.cpp | #include <common/vector.h>
#include <cstdlib>
#include <immintrin.h>
#include <cstdio>
void vector_init(vector* vec) {
if (vec) {
vec->capacity = VECTOR_DEFAULT_CAPACITY;
vec->size = 0;
vec->elements = (void**)aligned_alloc(
32, vec->capacity * sizeof(void*));
}
}
vector* v... | TOOL | 0.949604 | 5.527409 |
9c9b5c52-37b8-4f71-ab1f-a7338fb45244 | jonah-chen/bears-v-babies | src-game/play-swap.cpp | #include "server.hpp"
unsigned char Game::play_swap(unsigned int swap, unsigned int head1, unsigned int head2)
{
if (head1 == head2)
{
std::cout << "swapping a head with itself is not supported\n";
return 0;
}
// ensure the cards are actually heads
Card& h1 = lut.at(head1);
Car... | WEB | 0.965777 | 3.624039 |
7d0a5db0-9d44-44e4-b16a-94cf2259fe45 | weijilin/ListNode_11 | test-10_24/test-10_24/源.cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct Node {
char val;
struct Node *left;
struct Node *right;
} Node;
typedef struct ReturnType {
Node * root; // ĸڵ
int used; // õֵ
} ReturnType;
// A B D F # # # # C # E # G # #
// CreateTree Ҫֵ
// 1. Node *... | ALGO | 0.999854 | 4.031646 |
5a92f825-71c2-4d7d-88b6-dc857ab49b07 | Lucerna00/BOJ | implementation/18238.cpp | #include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
char c = 'A';
int temp = 0, answer = 0;
string input;
cin >> input;
for (int i = 0;i < (int)(input.length());i++) {
temp = abs(input[i] - c... | ALGO | 0.999729 | 3.829312 |
2be85a4a-4d52-4250-87e8-9bfebcb0c4f5 | Roswellii/PAT_practice | 0215_cars_on_campus_sample.cpp | # include <cstdio>
# include <algorithm>
# include <string>
# include <map>
# include <iostream>
# include <vector>
using namespace std;
const int debug = 0;
const int sizea = 10050;
const int range = 24*60*60;
int sumcnt[range];
string ToWatch(int time_point)
{
char str[50];
sprintf(str,"%02d:%02d:%02d",time... | ALGO | 0.99731 | 3.871796 |
ec3e58af-9c9a-451a-b8fa-a54a22d71725 | Girishg17/LeetcodeSolutions | 0015-3sum/0015-3sum.cpp | class Solution {
public:
vector<vector<int>> threeSum(vector<int>& nums) {
vector<vector<int>> ans;
// Sort the input array to avoid duplicate combinations
sort(nums.begin(), nums.end());
for(int i=0;i<nums.size()-2;i++){
if(i == 0 || nums[i-1] != nums[i]){
... | ALGO | 0.999914 | 5.899088 |
0543592c-0066-4957-b099-273774bb5d0d | visitorckw/leetcode-solution | AC_submissions/202.happy-number.264050784.ac.cpp | /*
* @lc app=leetcode id=202 lang=cpp
*
* [202] Happy Number
*/
// @lc code=start
class Solution {
public:
unordered_map<int,bool> table;
bool isHappy(int n) {
if(n==1) return true;
if(table[n]) return false;
table[n]=true;
int cnt=0;
vector<int>vec;
while(n)... | ALGO | 0.999955 | 5.631818 |
33699fd4-d55a-4b96-a53e-9e60b4d4d53b | xpharry/coding-battle | leetcode/cpp/081.cpp | /*
* Binary Search
*
* Time: O(lgn)
*
*/
class Solution {
public:
bool search(vector<int>& nums, int target) {
int lo = 0, hi = nums.size()-1;
int mid;
while(lo<=hi) {
mid = (hi-lo)/2 + lo;
if(nums[mid] == target) return true;
if(nums[mid] > ... | ALGO | 0.999986 | 6.431003 |
78163a4a-c7b7-49b2-940f-ad1daf6cabaa | Octavi-Staging/android_frameworks_av | media/module/codecs/amrwb/dec/src/lagconceal.cpp | /*
------------------------------------------------------------------------------
Filename: lagconceal.cpp
Date: 05/08/2007
------------------------------------------------------------------------------
REVISION HISTORY
Description:
--------------------------------------------------------------------------... | ALGO | 0.998596 | 7.799687 |
94ebadcc-4883-4765-85ae-d7894828a7bf | kyucho1009/BOJ | BOJ15652.cpp | #include <bits/stdc++.h>
using namespace std;
int N;
int M;
int arr[10];
void func(int num)
{
if (num == M)
{
for (int i = 0; i < M; i++)
cout << arr[i] << " ";
cout << "\n";
return;
}
for (int i = 1; i <= N; i++)
{
if (num == 0)
{
ar... | ALGO | 0.999961 | 4.021366 |
a1da03f6-25e3-444c-b3d2-32d729f0727a | Soledad89/HeadPoseEstimation | main.cpp | /*#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui.hpp>*/
#include <opencv2/opencv.hpp>
#include "PAW.h"
#include "Triangle.h"
#include <iostream>
#include <stdio.h>
#include <time.h>
#include <string>
#include <algorithm>
#include <set>
using namespace c... | ALGO | 0.972067 | 3.054847 |
fa03a733-f6d5-4284-9ff3-80236c3a5e56 | Azad88101/DSA_Practice | inCppByLov/Recursion 90/class4/1 minimum no of coins/minCoinsUsingRecursion.cpp | #include <iostream>
#include <vector>
#include <climits>
using namespace std;
// int findMin(vector<int> arr, int target)
// {
// if (target == 0)
// {
// return 0;
// }
// if (target < 0)
// {
// return INT_MAX;
// }
// int mini = INT_MAX;
// for (int i = 0; i < arr.size... | ALGO | 0.999979 | 5.270849 |
ca644e46-6d83-4a77-8478-7b17d19f562b | pooja170422/leetcode-solutions | 1421-find-numbers-with-even-number-of-digits/find-numbers-with-even-number-of-digits.cpp | class Solution {
public:
int findNumbers(vector<int>& nums) {
int n = nums.size();
int ans = 0;
for (int i = 0; i < n; i++) {
int num = nums[i];
int cnt = 0;
while (num > 0) {
num = num / 10;
cnt++;
}
... | ALGO | 0.999938 | 6.007452 |
adce4296-3fa8-4d27-ae63-49683c1fbb77 | Hissane/Competitive-Programming | JuniorTraining/CF344-D2-A.cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
int n, groups = 0, cur = 0, prev;
cin >> n;
for(int i = 0; i < n; i++){
prev = cur;
cin >> cur;
if(prev != cur){
groups++;
}
}
cout << groups;
return 0;
} | ALGO | 0.999929 | 3.999309 |
9f43342f-041f-469b-a006-aaa799555f0f | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_11567_23.cpp | #include <bits/stdc++.h>
using namespace std;
const int Q = 5;
const long long K = 10000;
long long f[Q];
map<long long, long long> g[Q];
long long ask(long long l, int num, vector<long long> *las = NULL) {
if (num < 0) return 0;
if (las == NULL && g[num].count(l)) return g[num][l];
if (las == NULL && l >= K) ret... | ALGO | 0.999536 | 3.351902 |
1fa81e47-ef7e-4c85-aba0-d8b4c2ae10fb | ishandutta2007/codeforces | magga/normal/1278/B.cpp | #include<bits/stdc++.h>
using namespace std;
long long int dp[100000]{0};
void pre(){
for(long long int i=0;i<100000;i++){
dp[i]=(i*(i+1))/2;
}
}
void solve(){
long long int a,b;cin>>a>>b;
a=abs(a-b);
long long int i =0;
while(true){
if(dp[i]>=a && (dp[i]-a)%2==0){
break;
}
i... | ALGO | 0.999871 | 3.834488 |
3bbec94a-2213-4546-9109-d2c8e763e79b | lahifkhan/super_problem_solver_zone | weak 2/day8/C_Insert_and_Equalize.cpp | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false); cin.tie(NULL);
#define ll long long
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define mod 1000000007
#define endl "\n"
ll gcd(ll a,... | ALGO | 0.999845 | 4.415891 |
92631ff4-341f-4cf0-8ddd-14c1d6b93ed8 | rishabhagg7/Coding-Ninjas-Introduction-to-Cpp-and-Data-Structure-in-Cpp | Introduction to Cpp/Test 1/Pyramid_Number_Pattern.cpp | /*
Print the following pattern for the given number of rows.
Pattern for N = 4
1
212
32123
4321234
*/
#include<iostream>
using namespace std;
int main()
{
// Write your code here
//Take Input
int N;
cin >> N;
//Output
for(int i = 0; i < N; i++)
{
//Spaces
for(... | ALGO | 0.999974 | 4.668696 |
b2a86478-892d-4ecf-9b8b-4381b81d1374 | LeviMatias/TPF-Micromachines | server/Game/Box2D/Box2D/Collision/b2DynamicTree.cpp | #include <Box2D/Collision/b2DynamicTree.h>
#include <memory.h>
b2DynamicTree::b2DynamicTree()
{
m_root = b2_nullNode;
m_nodeCapacity = 16;
m_nodeCount = 0;
m_nodes = (b2TreeNode*)b2Alloc(m_nodeCapacity * sizeof(b2TreeNode));
memset(m_nodes, 0, m_nodeCapacity * sizeof(b2TreeNode));
// Build a linked list for th... | ALGO | 0.995572 | 7.802995 |
f8c2f30a-61c6-4907-8b75-a7df7c18e22a | ifradK/Competitive-Programming-Solutions | C++ Programs/Make It Increasing.cpp | #include<iostream>
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl '\n'
#define ll long long
using namespace std;
int main()
{
fastio;
ll t,n,i;
cin>>t;
while(t--)
{
cin>>n;
ll a[n],cnt=0;
bool flag=false;
... | ALGO | 0.999808 | 4.135795 |
781f3ce3-2121-4c97-a254-dda08c234b49 | otakaikai/test | StaticTest/CAStarWayFind.cpp | #include "CAStarWayFind.h"
#include "assert.h"
#include <complex>
#include <map>
SPoint* CAStarWayFindHelper::findExceptPointPtr( const std::map<SPoint*, int>& mapPoint, const int x, const int y )
{
for( std::map< SPoint*, int>::const_iterator it = mapPoint.begin(); it != mapPoint.end(); ++it )
{
if( it->first && ... | ALGO | 0.999449 | 3.568951 |
406b3604-6f7c-4e39-b90b-471ef504471d | Georgeliu424/Game3001_Labs | Lab3/include/GLM/test/core/core_func_integer_find_lsb.cpp | // This has the programs for computing the number of trailing zeros
// in a word.
// Max line length is 57, to fit in hacker.book.
#include <cstdio>
#include <cstdlib> //To define "exit", req'd by XLC.
#include <ctime>
int nlz(unsigned x) {
int pop(unsigned x);
x = x | (x >> 1);
x = x | (x >> 2);
x = ... | ALGO | 0.998775 | 5.181464 |
e9098b88-8816-4d5d-a166-86540e43cbad | baeksangha/algorithm_problem_solving | jongman/BOGGLE.cpp | #include <iostream>
#include <string>
using namespace std;
char word[5][5];
int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
int isInRange(int x, int y) {
if(0 <= x && x < 5 && 0 <= y && y < 5)
return 1;
return 0;
}
string hasWord(int x, int y, string str) {
if(str.length() == ... | ALGO | 0.999856 | 4.844066 |
cd357226-dde3-43cd-bfcb-398189ac23f6 | Ankit-Basu/cpp_assignments | cpp assignments/day36.cpp | //Question 1
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i) cin >> a[i];
if (n % 2 == 0) cout << max(a[0], a[1]) << endl;
... | ALGO | 0.999906 | 5.311531 |
a2a29500-4fb4-4ae7-ae85-09b09095bc03 | sheshanathkumar/coding | Bit_Lucky.cpp | #include <bits/stdc++.h>
using namespace std;
int main (){
int test;
scanf ("%d", &test);
while (test --){
long long num, sum = 0;
scanf ("%lld", &num);
for ( long long i = 3; i<= num; i++){
bitset <32> b(i);
if ( b.count() == 2)
sum = sum + i... | ALGO | 0.999092 | 3.634174 |
d1e15950-6027-4af0-8aee-774edc223f83 | ishandutta2007/codeforces | fengzhengwei/normal/840/B.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
char gc(){static char buf[1<<16],*s,*t;if(s==t){t=(s=buf)+fread(buf,1,1<<16,stdin);if(s==t)return EOF;}return *s++;}
//#define getchar gc
int read()
{
char c;
int w=1;
while((c=getchar())>'9'||c<'0')if(c=='-')w=-1;
int ans=c-'0';
while((c=getchar())... | ALGO | 0.999969 | 3.864029 |
10ad3a01-bed2-439e-9b9d-0f4a53a1f2ab | Hagemii/asio-rdma | libs/endian/example/conversion_use_case.cpp | // endian/example/conversion_use_case.cpp
// This program reads a binary file of fixed length records, with a format defined
// in a header file supplied by a third-party. The records inserted into a vector,
// and the vector is sorted. The sorted records are then written to an output file.
// Full I/O error tes... | DATA | 0.898378 | 6.147862 |
7b35e904-2780-4b88-b3a6-1ec0a5bda53d | Yash-Singh1/competitive-programming | usaco/january-2021/bronze/problem-3/main.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> a(n), b(n);
for (ll i{0}; i < n; ++i) {
cin >> a[i];
}
for (ll i{0}; i < n; ++i) {
cin >> b[i];
}
sort(a.begin(), a.end());
s... | ALGO | 0.999918 | 4.120142 |
9192d8f1-40b3-4ebf-b175-f0799319b5d1 | yzzupgo/MFTCG | Data/abc123_b/mafuyu_7se/wa/4855850.cpp | #include <iostream>
#include <string.h>
#include <stdlib.h>
using namespace std;
int main(void)
{
char s[5];
int a[5];
int min = 255;
int minnum;
int minidx=0;
int sum = 0;
for (int i = 0; i < 5; i++)
{
cin >> a[i];
sprintf(s, "%d", a[i]);
if ((atoi(&s[strlen(s) - 1]) < min) && (a[i] % 10... | ALGO | 0.999652 | 3.504326 |
03ad8917-32e7-4c29-9917-fc2a7839a5be | devu-13here/DP | Assignment5/que3.cpp | #include <iostream>
using namespace std;
struct Node {
int data;
Node* next;
Node(int val) : data(val), next(nullptr) {}
};
void printList(Node* head) {
Node* temp = head;
while (temp != nullptr) {
cout << temp->data << " ";
temp = temp->next;
}
cout << "NULL" << endl;
}
N... | ALGO | 0.999765 | 6.065336 |
cf6f5af9-0f6e-4cde-88a6-b660a7d83818 | seheonnn/Algorithm | Programmers/Backtracking/피로도.cpp | #include <string>
#include <vector>
using namespace std;
int answer = 0;
void backtracking(int k, vector<vector<int>> dungeons, vector<int> visited, int cnt) {
answer = max(answer, cnt);
for (int i = 0; i < dungeons.size(); i++) {
if (k >= dungeons[i][0] && visited[i] == 0) { // 최소 피로도
vi... | ALGO | 0.998644 | 5.014183 |
5d8a7ef6-5e86-4423-abfe-3cd18167f0d2 | Masum-SM/CodeForces | Difficulty-800/144A_Arrival_of_the_General.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int small = arr[0];
int sm_idx = 0;
for (int i = 0; i < n; i++)
{
if (arr[i] <= small)
{
small = arr[i];
... | ALGO | 0.999969 | 3.755663 |
9609063c-66d7-48ab-831e-e870eb9e8316 | peter0512lee/LeetCode | 2730-find-the-longest-semi-repetitive-substring/2730-find-the-longest-semi-repetitive-substring.cpp | class Solution {
public:
int longestSemiRepetitiveSubstring(string s) {
int ans = 1, n = s.length(), left = 0, same = 0;
for (int right = 1; right < n; right++) {
if (s[right] == s[right - 1]) {
same++;
}
if (same > 1) {
left++;
... | ALGO | 0.99999 | 6.119104 |
30471cab-b887-4401-8449-e62532025e25 | sushantkumar143/Competitive-Programming | CodeForces/A_Binary_Search.cpp | #include <bits/stdc++.h>
using namespace std;
bool search(long long target, vector<long long>& arr) {
int left = 0;
int right = arr.size() - 1;
while (left <= right) {
long long mid = (left + right) / 2;
if (arr[mid] == target) {
return true;
}
else if (arr[mid] ... | ALGO | 0.999986 | 4.323938 |
168761cb-6203-4bcf-8315-8df73c691884 | vishal-g17/DSA | C++ DSA/Codeforces/arrayaoloring.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vll vector<long long int>
int main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int arr[n];
for(int ... | ALGO | 0.99934 | 5.116047 |
1761227a-cf46-4665-a1b4-466ff7efbd7c | AniGhodake/ProblemSolving_DSA | uniqueElement.cpp | #include<iostream>
using namespace std;
int main(){
int arr[11] = {1,1,5,5,6,4,6,4,8,8,9};
int size = 11;
int uniqueElement();
} | ALGO | 0.998306 | 4.240165 |
6d71bddc-ec34-4afe-8302-55173508f23a | AJEY1003/DATASCTRUCTURES-PRACTICE- | twopointer.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];
}
int sum;
int target;
cin>>target;
for(int i=0;i<n;i++){
for(int j=i+1;j<n-2;j++){
sum=a[i]+a[j];
if(target==sum){
cout<<a[i]<<","<<a[j];
... | ALGO | 0.999817 | 3.349975 |
5a73cd54-4132-44fa-897b-7a9967aa2fdb | kugelblitz779/graphtheory | relationproblem.cpp | #include<bits/stdc++.h>
#define ll long long
using namespace std;
vector<int> arr[1000001];
int vis[1000001];
int cc[1000001];
int curr;
void dfs(int node){
vis[node] = 1;
cc[node] = curr;
for(int child : arr[node]){
if(!vis[child]){
dfs(child);
}
}
}
int main(){
freopen("input.txt", "r", stdin);
... | ALGO | 0.999928 | 4.151815 |
4d86b9a0-fa0b-464b-b892-da0556293751 | ishandutta2007/codeforces | tabasz/normal/883/H.cpp | #include<bits/stdc++.h>
#define PII pair<int,int>
#define f first
#define s second
#define VI vector<int>
#define LL long long
#define MP make_pair
#define LD long double
#define PB push_back
#define ALL(V) V.begin(),V.end()
#define abs(x) max((x),-(x))
#define PDD pair<LD,LD>
#define VPII vector< PII >
#define siz(V... | ALGO | 0.999998 | 3.203169 |
031f32fa-7848-4037-baa9-5caf9fabe79e | Pooja71/Visual-SLAM-using-Stereo-Camera-for-Autonomous-Vehicles | SLAM/ORB_SLAM2/Thirdparty/g2o/g2o/core/sparse_optimizer.cpp | #include "sparse_optimizer.h"
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <iterator>
#include <cassert>
#include <algorithm>
#include "estimate_propagator.h"
#include "optimization_algorithm.h"
#include "batch_stats.h"
#include "hyper_graph_action.h"
#include "robust_kernel.h"
#include "../st... | ALGO | 0.999694 | 6.976369 |
928069ca-2925-4896-828c-c0dd63bc6615 | aliqasemzadeh/micro | class/function/class1/CPP02/main.cpp | #include <iostream>
// یک عدد از ورودی بگیرید و مشخص کنید زوج است یا فرد
using namespace std;
int main()
{
int x;
cin >> x;
if(x % 2 == 0) {
cout << "It is even.";
} else {
cout << "It is odd";
}
return 0;
}
| ALGO | 0.995365 | 4.063341 |
1f0facb8-a953-4a01-bb54-8266525aec38 | dsuzuki0508/AtCoder | ARC/161/B/main.cpp | #include <bits/stdc++.h>
using namespace std;
unsigned long long f(unsigned long long n){
n = (n&0x5555555555555555) + ((n>>1)&0x5555555555555555);
n= (n&0x3333333333333333) + ((n>>2)&0x3333333333333333);
n= (n&0x0f0f0f0f0f0f0f0f) + ((n>>4)&0x0f0f0f0f0f0f0f0f);
n= (n&0x00ff00ff00ff00ff) + ((n>>8)&0x00ff00ff... | ALGO | 0.999919 | 4.405354 |
eb89378b-a0c0-4ac7-8f93-3dc6986bc10e | RayLyu-Mac/BrainSpectrum | 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 |
ecbc0ab1-e632-415f-b7a5-a9d91b9beb2a | czartur/competitive_programming | x_inf473a/td2/g.cpp | #include <bits/stdc++.h>
using namespace std;
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define cl(x,y) memset(x, y, sizeof(x))
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typede... | ALGO | 0.999616 | 3.690234 |
a3c2bc96-2b87-4bd4-8b10-d22359f4631f | imgaurav02/DSA | sorting/bubble_sort.cpp | #include<bits/stdc++.h>
using namespace std;
void swap(int arr[],int i,int j){
int temp;
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
//bubble sort is not adaptive to we have to make it adaptive by introducing the flag variable
void bubble_sort(int arr[],int n){
int flag;
for(int i=0;i<n... | ALGO | 0.999834 | 4.276785 |
e578b0b0-3ce5-4337-b099-55356eeb4ab7 | ishandutta2007/codeforces | shiomusubi496/normal/1398/A.cpp | #include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int Q;
cin>>Q;
while(Q--){
int N;
cin>>N;
vector<int> A(N);
for(int &i:A)cin>>i;
if(A[0]+A[1]<=A[N-1])cout<<"1 2 "<<N<<endl;
else puts("-1");
}
} | ALGO | 0.999461 | 3.476662 |
702dd900-02db-4a0d-8d8b-8d6119ee102a | archit-dev/CodeChef-Easy | LEPERMUT.cpp | #include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while (t--) {
int n;
cin>>n;
vector <int> v;
for(int i = 0 , x ; i < n ; i++){
cin>>x;
v.push_back(x);
}
int... | ALGO | 0.999955 | 3.950544 |
9338f380-f9aa-488e-a9e3-b1e96d9f0b44 | DeepakChauhan-cloud/Learning-Cpp-Coding-Army | Class Notes Problems/ARRAY/Lec 21 Insertion Sort/01_insertion_sort.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];
}
for(int i=1;i<n;i++){
for(int j=i;j>0;j--){
if(a[j]<a[j-1]){
swap(a[j],a[j-1]);
}
else{
break;
... | ALGO | 0.999978 | 3.89658 |
f1bda59f-680f-4986-97bd-63bcbd6dcc80 | Abhisays27/SDE-Sheet | 1372-longest-zigzag-path-in-a-binary-tree/1372-longest-zigzag-path-in-a-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.999939 | 5.324027 |
34ff4d56-998d-4f3e-be31-c08490a91721 | leiluoo/algorithmAndDataStructureSiminar | Task_Prac2/test3/copy1.cpp | //
// Created by 欧阳磊落 on 2021/6/17.
//
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
//int main()
//{
// set<int> odd;
// vector<int> even;
// even.push_back(0);
// even.push_back(2);
// even.push_back(4);
// even.push_back(6);
// even.push_back(8... | TOOL | 0.996289 | 4.38049 |
f8ff8756-ad10-4080-b66e-8b09eda1c1d3 | Fengdalu/acm-icpc | CF/192/A.cpp | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
char s[100][100];
bool r[100], c[100];
int n, m;
int main()
{
ios::sync_with_stdio(false);
cin >> n >> m;
for(int i = 0; i < n; i++)
cin >> s[i];
memset(r, 0, sizeof r);
memset(c, 0, sizeof c);
for(int i = 0... | ALGO | 0.999743 | 3.196604 |
4d3f24ef-b91c-45a2-b874-a3d683a9d96c | raincross7/code-similarity | codes/train_code/problem016/problem016_329.cpp | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#include<functional>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n)... | ALGO | 0.999989 | 4.060534 |
a363f66f-79d5-43c5-909f-d857c21ca077 | W4samGG7/Clases | 15-05-2024/Ejercicio3TipoAngulo.cpp | #include <iostream>
using namespace std;
int main ()
{
//Declaración de variables
float angulo=0.00;
//Solicitar variables
cout<<"Programa para determinar el tipo de angulo"<<"\n";
cout<<"Porfavor, ingrese el angulo que necesita evaluar: "<<"\n";
cin>>angulo;
//if anidados para angulo
... | ALGO | 0.982302 | 3.446796 |
14118d32-0375-4acb-9b95-644665c927d7 | nvbangg/CodePTIT | Cpp/CPP0621_SAP_XEP_THEO_MA_SINH_VIEN.cpp | #include <bits/stdc++.h>
using namespace std;
class data{
public:
string masv,ten,lop,mail;
friend istream &operator>>(istream &input,data &a){
cin>>a.masv;
cin.ignore();
getline(cin,a.ten);
cin>>a.lop>>a.mail;
return input;
}
friend ostream &operator<<(ostream &output,data &a){
cou... | ALGO | 0.916135 | 3.260327 |
4ac1f17e-5f65-474b-9baf-779102a39c97 | NaveenKumar-n4v/Leetcode | 2-add-two-numbers/2-add-two-numbers.cpp |
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {
// Brute and optimal
// TC O(Max(n2,n2))
// SC O(N)
ListNode* res = new ListNode(0);
int carry =0;
ListNode* dummy = res;
while(l1 || l2 || carry){
in... | ALGO | 0.999914 | 6.618324 |
7d6b3901-865b-40eb-86c3-40a65dcd8487 | d1mmm/cracking_coding_tasks | cracking_codding_tasks/First_chapter/1.9.cpp | /*
* Допустим, что существует метод isSubstring, проверяющий, является ли
одно слово подстрокой другого. Для двух строк s1 и s2 напишите код, который проверяет, получена ли строка s2 циклическим сдвигом s1, используя
только один вызов метода isSubstring (пример: слово waterbottle получено
циклическим сдвигом erbottlewa... | ALGO | 0.998874 | 5.413775 |
5c43cd0e-0cd7-47f0-bdf4-f15f41e638b3 | hedgehog412/BonusWheel | cocos2d/cocos/math/MathUtil.cpp | #include "math/MathUtil.h"
#include "base/ccMacros.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
#include <cpu-features.h>
#endif
//#define USE_NEON32 : neon 32 code will be used
//#define USE_NEON64 : neon 64 code will be used
//#define INCLUDE_NEON32 : neon 32 code included
//#define INCLUDE_N... | TOOL | 0.967885 | 6.360316 |
f6f2f947-a020-4fda-9a40-15c637bc71f6 | KyoMiyah/AtCoder | ABC372/c.cpp | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<n; i++)
int main() {
int n, q;
cin >> n >> q;
string s;
cin >> s;
int cnt = 0;
rep(i,n-2) {
if (s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') cnt++;
}
rep(i,q) {
int x;
cin >> x;
... | ALGO | 0.999793 | 4.04038 |
0f164d3f-f699-4932-ab79-99743aad7539 | ishandutta2007/codeforces | .o/normal/1010/A.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m; cin >> n >> m;
vector<int> a(n), b(n);
for(int i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
vector<int> coef;
coef.push_back(b[0]);
for(int i = 1; i < n; i++) {
coef.push_back(a[i]);
coef.push_back(b[i]);
}
coef.push_ba... | ALGO | 0.999941 | 3.514211 |
6ef7cb80-e81e-403b-8d1b-605a24b4af33 | Jitendra0101/CPP_lab_assignments | reverse.cpp | #include <iostream>
int main()
{
int num, digits,temp,a,count=0,b=0;
std::cout<<"Enter the number\n";
std::cin>>num;
temp=num;
while(num>0)
{
count++;
num=num/10;
}
// std::cout<<count;
for(int i=1;i<=count;i++)
{
a=temp%10;
b=b*10+a;
temp=tem... | ALGO | 0.999491 | 4.696532 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.