uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
5fe3755d-ac2d-4dc7-9cf2-9f2df0168595 | ishandutta2007/codeforces | maksymoboznyi/normal/890/A.cpp | #include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ull unsigned long long
using namespace std;
const int N = 1e6+10;
int a[10];
signed main()
{
ios_base::sync_with_stdio();
cin.tie(0);
cout.tie(0);
int sum = 0;
for (int i = 1; i <= 6; i++)
{
cin >> a[i];
... | ALGO | 0.999933 | 3.844758 |
95754a92-53ce-4cf5-87a7-7668b00ab693 | koba-e964/contest | codeforces/261-2/b.cpp | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
using namespace std;
typedef long long int ll;
const double EPS=1e-9;
const int N=2... | ALGO | 0.999099 | 3.540466 |
4a8593dd-2ad4-4e48-8f25-f348da48e7c4 | zzwblog/AlgorithmCode | 剑指offer/61平衡二叉树.cpp | //#include "head.h"
//
//struct TreeNode {
// int val;
// struct TreeNode *left;
// struct TreeNode *right;
// TreeNode(int x) :
// val(x), left(NULL), right(NULL) {
// }
//};
////һʹȱ,жÿڵDzƽִµķᵼµײĽڵظж϶
//class Solution01 {
//public:
// bool IsBalanced_Solution(TreeNode* pRoot) {
// if (pRoot == nullptr)return true;
... | ALGO | 0.999893 | 4.947742 |
1f6ba6bf-fd2d-4726-9bf3-9755ad0a3f95 | omar-s-ta/solved-problems | UVA/competitive_programming/chapter_3/Iterative (The More Challenging Ones)/11205 - The broken pedometer.cpp | #include <cstdio>
#include <string.h>
using namespace std;
int count_bit(int n) {
return n == 0 ? 0 : count_bit(n & (n - 1)) + 1;
}
void get_min(int& a, int b) {
if (a > b) a = b;
}
int main() {
int code[105];
bool vis[1 << 15];
int TC; scanf("%d", &TC);
for (int i, j, m; TC--;) {
int P; scanf("%d", &P);
i... | ALGO | 0.999281 | 4.505083 |
4c6a95b8-e80c-47c7-90ff-5c529b7c580e | sarvex/leetcode-elixir | solution/1300-1399/1306.Jump Game III/Solution.cpp | class Solution {
public:
bool canReach(vector<int>& arr, int start) {
queue<int> q{{start}};
while (!q.empty()) {
int i = q.front();
q.pop();
if (arr[i] == 0) {
return true;
}
int x = arr[i];
arr[i] = -1;
... | ALGO | 0.999991 | 5.688122 |
588690b9-06c3-4d8f-8960-d32f9cfc9540 | Vijay6923/All_platform_question | codeforces/900/make_AP.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int t;
cin>>t;
while(t--){
ll a,b,c;
cin>>a>>b>>c;
if((2 * b > c && ((2 * b - c)) % a == 0) || (a + c) % (2 * b) == 0 || (((2 * b - a) > 0) && (2 * b - a) % c == 0)){
cout << "YES" << endl;
... | ALGO | 0.999541 | 4.347606 |
d8d6194d-ce60-497b-9ad8-a89a0f1cc9de | YYYEJI/DS | kgtogram.cpp | // object 개념 이해 문제
#include <iostream>
using namespace std;
class Weight{
int kg; // 킬로그램
int gram; // 그램
public:
void set_weight(int n1, int n2); // 초기세팅
int get_weight(); // Kgram -> gram
};
// Weight set_weight(int n1, int n2); // 초기세팅
// ... | TOOL | 0.931372 | 4.078881 |
9df02e7a-3c68-4b6a-88e9-ddcde98416f6 | ojusvini/DAA-Codes | misc/lab2/old/QUICKANDBUBBLE.cpp | #include <stdio.h>
#include <math.h>
int a[10000];
void quick(int a[], int low, int up);
int partition(int a[], int low, int up);
void bubblesort(int a[],int n)
{
int i,j,excg,t;
for (i = 0; i < n; i++) {
excg = 0;
for (j = 0; j < n - 1; j++) {
if (a[j] > a[j + 1]) {
t = a[j];
a[j] = a[j + 1];
... | ALGO | 0.999779 | 3.226171 |
f46524af-cc4b-4488-a4b3-71b24ee54c77 | LifWirser/VSE_Test | engine/objconv/trisort.cpp | #include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <math.h>
#include "trisort.h"
#ifdef __APPLE__
#define sqrtf sqrt
#endif
bool nearzero(double fb) {
const float eps = .0001;
return fabs(fb) < eps || fb == 0;
}
POLYGON_RELATION Plane::... | ALGO | 0.997733 | 4.664599 |
84b6b5a1-4596-4a93-8ad3-c7481c1f4da5 | plenilune3/problem_solving_cpp | beakjoon/BaaaaaaaarkingDog/DFS/3709_레이저빔은 어디로.cpp | #include <iostream>
using namespace std;
const int MAX = 52;
const int dx[] = { -1, 0, 1, 0 };
const int dy[] = { 0, 1, 0, -1 };
int N, R, lx, ly;
bool board[MAX][MAX];
pair<int, int> dp[MAX][MAX][4];
void get_laser(int &x, int &y, int &d);
pair<int, int> dfs(int x, int y, int d);
int main(int argc, char const *ar... | ALGO | 0.999763 | 3.517402 |
651d462e-6189-4e0c-9752-6745a047b874 | JLUVicent/leetcode_solution | 0495.提莫攻击/0495-提莫攻击.cpp | class Solution {
public:
int findPoisonedDuration(vector<int>& timeSeries, int duration) {
int ans=0;
int expired=0;
int n=timeSeries.size();
for (int i=0;i<n;i++){
if(timeSeries[i]>=expired){
ans+=duration;
}
else{
... | ALGO | 0.999315 | 6.319635 |
a070b3a4-4c53-41e6-9592-ef8d7fdbdbc4 | ishandutta2007/codeforces | couplefire/normal/750/E.cpp | #include <bits/stdc++.h>
using namespace std;
const int G[5] = {2, 0, 1, 7, 69};
const int B[5] = {69, 69, 69, 6, 6};
const int INF = 0x3f3f3f3f;
const int N = 1<<18;
struct Mat{
int a[5][5];
Mat(int n = 420){
memset(a, INF, sizeof a);
for(int i = 0; i<5; ++i)
a[i][i] = (n==G[i] ||... | ALGO | 0.999923 | 4.147342 |
a002b376-60d6-4fe5-a756-a71ab70b11d8 | IsaacHana/algorithmForCPP | 0x08 스택 심화/9012.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int T;
cin >> T;
while (T--) {
stack<char> S;
string PS;
cin >> PS;
bool isValid = true;
for (auto c : PS) {
if (c == '(') {
S.push(c... | ALGO | 0.99983 | 5.329014 |
38607128-11da-4ab3-ac9c-5f6141cd8a28 | parkchanghyup/algorithm | C++/동전 1.cpp | #include<iostream>
#include<algorithm>
using namespace std;
int coin[101];
int dp[10001];
int main() {
cin.tie(NULL);
ios::sync_with_stdio(false);
int n, k;
cin >> n >> k;
// Է
for (int i = 0; i < n; i++) {
cin >> coin[i];
}
//
sort(coin, coin + n);
//dp ʱȭ
dp[0] = 1;
for (int i = 1; i <= k; i++) {... | ALGO | 0.999924 | 3.585526 |
b64bfad7-aedf-4c2f-b5e7-b3c2e8276484 | puba5/Algorithm_Study | sungunjo/Old/5373.cpp | #include <iostream>
#include <cstring>
using namespace std;
int T;
int n;
char ans[100][3][3];
void rot_right(char cube[][3]) {
char temp[3][3];
temp[0][0] = cube[0][0]; temp[0][1] = cube[0][1]; temp[0][2] = cube[0][2];
cube[0][2] = cube[0][0]; cube[0][1] = cube[1][0]; cube[0][0] = cube[2][0];
cube[0][0] = cube[2... | ALGO | 0.999701 | 4.327225 |
9ec3ca84-3878-4d73-a257-475cb8b122fd | LightBitDev/LightBit | src/chainparams.cpp | #include <chainparams.h>
#include <consensus/merkle.h>
#include <tinyformat.h>
#include <util.h>
#include <utilstrencodings.h>
#include <assert.h>
#include <memory>
#include <chainparamsseeds.h>
static CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t n... | CONFIG | 0.895018 | 6.820792 |
4397718a-e067-4480-ad86-055eb5bc3192 | ECS201A-WQ24/assignment4 | workloads/matmul/mm.cpp | #include <chrono>
#include <iostream>
#include <random>
#ifdef IJK
#include "ijk_multiply.h"
#endif
#ifdef IKJ
#include "ikj_multiply.h"
#endif
#ifdef IJ
#include "block_ij_multiply.h"
#endif
#ifdef IK
#include "block_ik_multiply.h"
#endif
#ifdef KJ
#include "block_kj_multiply.h"
#endif
#ifdef GEM5
#include "gem5... | ALGO | 0.988122 | 4.512988 |
49155614-37e9-4fc6-8f0a-ed495955b1c1 | langou/tblas | src/dgbmv.cpp | #include "blas.h"
#include "gbmv.h"
#include <cctype>
using std::toupper;
using tblas::gbmv;
void dgbmv_(const char &Trans, const int &m, const int &n, const int &kl, const int &ku, const double &alpha, double *A, const int &ldA, double *x, const int &incx, const double &beta, double *y, const int &incy)
{
int in... | ALGO | 0.985484 | 5.699548 |
f423530b-234f-4b60-9ed8-ba2be821eab3 | rathoresrikant/interviewbit | Linked Lists/palindrome_list.cpp | /*
Palindrome List
Problem Description
Given a singly linked list A, determine if its a palindrome. Return 1 or 0 denoting if its a palindrome or not, respectively.
Problem Constraints
1 <= |A| <= 105
Input Format
The first and the only argument of input contains a pointer to the head of the given linked list.
Outpu... | ALGO | 0.999914 | 4.982926 |
dc720ec8-8b3d-4e43-96c1-86671823b077 | Pabfigueira/Maratona | URI/1226.cpp | #include <bits/stdc++.h>
using namespace std;
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define scs(a) scanf("%s", a)
#define pri(x) printf("%d\n", x)
#define prie(x) printf("%d ", x)
#define mp make_pair
#define pb push_back
#define BUFF io... | ALGO | 0.998439 | 4.128298 |
67cc60af-7370-4b12-a68f-949796ab39e9 | AlexandriaChemistry/ACT | src/gromacs/tables/splineutil.cpp | /*! \internal \file
* \brief
* Implements internal utility functions for spline tables
*
* \author Erik Lindahl <<EMAIL>>
* \ingroup module_tables
*/
#include "actpre.h"
#include "splineutil.h"
#include <cmath>
#include <algorithm>
#include <functional>
#include <utility>
#include <vector>
#include "gromacs/u... | ALGO | 0.999081 | 7.867421 |
3667efc5-2d13-4188-9b8f-88e56b9e6146 | radepejanvic/my-number-parallel | SV10_Rade_Pejanovic/Computer.cpp | #include "Computer.h"
Computer::Computer(): numbers(0), solution(0), result(0), difference(0) {
}
Computer::Computer(const std::vector<float>& nums, float res): numbers(nums), solution(0), result(res), difference(result) {
std::sort(numbers.begin(), numbers.end());
}
Computer::~Computer()
{
}
void Computer::combin... | ALGO | 0.999976 | 4.081343 |
50c85d47-0a3f-4421-9f3e-e064af5127db | s9v/toypuct | Timus/1126.cpp | # include <iostream>
# include <fstream>
# include <sstream>
# include <algorithm>
# include <functional> // greater<int>()
# include <vector>
# include <string>
# include <queue>
# include <stack>
# include <list>
# include <map>
# include <set>
# include <cstdio>
# include <cstdlib>
# include <cmath>
# include <ctime... | ALGO | 0.999667 | 3.152283 |
50287e8d-94b6-4561-a1dd-d690bd96619a | yashpatel137/Interview_Prep | Stacks&Queues/Sum_of_minimmum_and_maximum_of_elements_in_a_subarray_of_size_k.cpp | long long sumOfMaxAndMin(vector<int> &nums, int n, int k)
{
long long sum=0;
int i=0;
deque<int> mn,mx;
for(i=0;i<k;i++)
{
while(!mn.empty() && nums[mn.back()]>=nums[i])
{
mn.pop_back();
}
while(!mx.empty() && nums[mx.back()]<=nums[i])
{
mx.pop_back();
}
mn.push_back(i);
mx.push_back(i);
}
... | ALGO | 0.999969 | 4.605534 |
f9afbf89-aeb9-482d-a480-b8b46b84c0b3 | safwanjmuhammed/Main | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998859 | 6.785645 |
2a34a0e2-c82b-4426-9b3b-040f3a1f922f | tyz7000/C-languge | C语言程序/第一个出现一次的字符.cpp | #include <stdio.h>
int main()
{
char s[40] = {0};
int map[27] = {0};
int i;
gets(s);
for (i=0; s[i]!=0; i++)
{
map[s[i]-'a']++;
}
for (i=0; s[i]!=0; i++)
{
if (map[s[i]-'a'] == 1)
{
printf("\n%c\n",s[i]);
break;
}
}
return 0;
} | ALGO | 0.999844 | 3.096715 |
f24ff567-16a5-4667-be40-12b7e7beefe8 | GuacheSuede/MSSubmission1234567890 | submission/sma/boost_1_69_0/libs/graph/example/edge-connectivity.cpp | namespace boost
{
template < typename Graph >
std::pair < typename graph_traits < Graph >::vertex_descriptor,
typename graph_traits < Graph >::degree_size_type >
min_degree_vertex(Graph & g)
{
typename graph_traits < Graph >::vertex_descriptor p;
typedef typename graph_traits < Graph >::degree_s... | ALGO | 0.99883 | 7.146661 |
691e7c96-478e-4f97-85b1-26251e6b9261 | noko206/AtCoder | abc/201-250/234/e.cpp | #include <bits/stdc++.h>
using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REPI,_REP,)(__VA_ARGS__)
#define ALL(a) (a).begin(),(a).end()
#define ALLR(a) (a).rbegin(),(a).rend()
typedef... | ALGO | 0.99956 | 4.042956 |
c7f853a1-803d-4613-9d92-5653a215cdee | Nehagarg816/DSA-practice | Codeforces/Contest 939 div2/NeneGame.cpp | #include <bits/stdc++.h>
using namespace std;
void count(int k, int q)
{
vector<int> arr(k);
for (int i = 0; i < k; i++)
cin >> arr[i];
int x = arr[0];
for (int i = 0; i < q; i++)
{
int n;
cin >> n;
if (n >= x)
cout << x - 1 << " ";
else
... | ALGO | 0.999758 | 3.004325 |
25e0baf9-8b58-49e8-b9e7-c7bf364158d0 | Introwitt/DS-AND-ALGORITHMS | bubbleSort.cpp | #include<iostream>
#include<bits/stdc++.h>
#include<chrono>
using namespace std;
using namespace std:: chrono;
void swap(int *a, int *b){
int temp = *a;
*a = *b;
*b = temp;
}
void bubble_sort(int arr[],int n){
for(int i=0; i < n-1; i++){
for(int j=0; j< n-i-1; j++){
if(arr[j] > arr... | ALGO | 0.997219 | 5.18505 |
371728e1-a8c0-4aa3-9617-9ae9542460c7 | codingoer/openjdk11-source-code | hotspot/os/posix/os_posix.cpp | #include "jvm.h"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.hpp"
#include "services/memTracker.hpp"
#include "utilities/align.hpp"
#include "utilitie... | TOOL | 0.923271 | 6.555483 |
1c63f5a4-2b83-4fb7-b4b6-4b82e12b4d8b | 113bommy/deepmind_codecontests_refine | cpp_gold_filter_file/cpp_train_3794_3.cpp | #include <bits/stdc++.h>
using namespace std;
const int N = 66;
long long n, m, dp[N][N];
int d, bit[N], vis[N][N];
long long dfs(int len, int j, int lim) {
if (len == -1) return j == d - 1;
if (!lim && vis[len][j]) return dp[len][j];
int up = lim ? bit[len] : 1;
long long tmp = 0;
for (int i = 0; i <= up; ++... | ALGO | 0.999915 | 4.768602 |
41310a98-be95-4ea5-83db-a221c276d2fe | domirom604/ALL-PROJECTS | Horner/Horner/Źródło.cpp | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
double tab[5] = {0.456,0.2,1.1,3.06345,-1.123};
double x = 0.5;
double tabwynik[5];
double dod[5];
tabwynik[0] = tab[0];
for (int i = 1; i < 5; i++)
{
dod[1] = x;
tabwynik[i] = dod[i] + tab[i];
dod[i+1] = tabwynik[i] * x;
}
for (in... | ALGO | 0.999928 | 3.232146 |
c4dfb89e-0e43-49b0-9241-134556072e90 | rmagon/cprog | Linked List/38-a-Union and Intersection of two Linked Lists Sorted.cpp | #include <iostream>
using namespace std;
struct node
{
int a;
struct node* next;
};
void insert(struct node** head,int data)
{
struct node* looper = *head;
struct node* temp = (struct node*)malloc(sizeof(struct node));
temp->a = data;
temp->next = NULL;
if((*head) == NULL)
{
(*head) = temp;
return;
}
el... | ALGO | 0.999907 | 4.495086 |
3839bc98-89cb-4dee-b575-e6e7a60b4ccd | yunyu-Mr/myLeetcode | cpp/longest_consecutive_squence.cpp | #include <iostream>
#include <unordered_set>
#include <vector>
using namespace std;
/*
* Longest Consecutive Squence (C++11)
* Complexity: O(N)
*
* Complexity of unordered_set::erase :
* Linear in the number of elements removed ( O(1) if erased by a key)
*/
class Solution {
public:
int longestConsecutive(vecto... | ALGO | 0.999639 | 5.32737 |
551b09b1-7cc0-4977-b4db-d8c26cee8fc3 | AndroiableDroid/caf_frameworks_av | media/libstagefright/codecs/amrwb/src/interpolate_isp.cpp | /*
------------------------------------------------------------------------------
Filename: interpolate_isp.cpp
Date: 05/08/2004
------------------------------------------------------------------------------
REVISION HISTORY
Description:
---------------------------------------------------------------------... | ALGO | 0.999576 | 5.004285 |
0008d544-7fdb-4319-a8ce-b957075f1df6 | YASMIN-SEKH/problem-solving | max-min/max-min.cpp | //Program to find maximum, minimum among two numbers.
#include <iostream>
using namespace std;
int main(){
cout<<"enter two numbers\n";
int n1,n2;
cout<<"enter first number: ";
cin>>n1;
cout<<"enter second number: ";
cin>>n2;
int max = n1>n2?n1:n2;
cout<<"maximum number is : "<<max;
... | ALGO | 0.999355 | 4.160563 |
c7a27ceb-f84b-4a28-9f06-53eb074ede20 | Zeta611/baekjoon-solutions | 1786-찾기.cpp | #include <algorithm>
#include <cstring>
#include <iostream>
#include <iterator>
constexpr int STR_LEN{1'000'001};
char pattern[STR_LEN];
char text[STR_LEN];
int pi[STR_LEN];
std::vector<int> match()
{
const int len_pattern{static_cast<int>(strlen(pattern))};
const int len_text{static_cast<int>(strlen(text))};... | ALGO | 0.999741 | 5.449757 |
c249d1d8-5282-4a99-bb31-85a7b0d052d5 | UlsanBigDev/BOJ | 개편전/08_기본수학2/01_소수찾기/ptk.cpp | #include <iostream>
#include <cmath>
bool isSosu(int n)
{
int count = 0;
for (int i = 1; i < n; i++) {
if (n % i == 0) count++;
}
if (count == 1) return true;
return false;
}
int main()
{
int count, value = 0;
std::cin >> count;
for (int i=0; i<count; i++)
{
int n;
std::cin >> n;
if (isSosu(n)) valu... | ALGO | 0.999865 | 4.669032 |
17a76423-23b7-4451-9d9a-ddc13f8b2f18 | gauravk268/Competitive_Coding | CodeChef/Long-Challenge_Jul2020/Chefina_and_Swaps.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
const int MOD = 1e9 + 7;
const int SIZE_INT = 16;
void solve()
{
int n;
cin >> n;
vector<ll> a, b, values;
ll temp, cost = 0;
cin >> temp;
a.push_back(temp);
values.push_back(temp);
for (int i = 0... | ALGO | 0.999886 | 3.962019 |
f9e7f332-a296-416a-b17e-60cfe5ec9440 | ishandutta2007/codeforces | roundgod/normal/1468/G.cpp | #include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
const int maxn=1e6+20;
int n;
struct point{
ll x,y;
point operator-(const point &u){
return (point){x-u.x,y-u.y};
}
}a[maxn],o,r,p;
db H;
struct line{
point a,b;
};
ll mult(point a,point b){
return a.x*b.y-... | ALGO | 0.999945 | 3.610677 |
23336f0a-3219-4929-b237-1c21f0f18f69 | krishnakant2004/DSA | dsa/code/assignment_recurssion12.cpp/stair_case.cpp | #include<bits/stdc++.h>
using namespace std;
int stair_case(int n){
if(n<=0){
return 0;
}
else if(n==1){
return 1;
}else if(n==2){
return 2;
}
return stair_case(n-1)+stair_case(n-2)+stair_case(n-3);
}
int main(){
int n;cin>>n;
cout<<stair_case(n);
return 0;
} | ALGO | 0.99998 | 4.070048 |
f6f5a7d6-420b-4c66-b2bd-acc542fcb52c | Talibb555/codeforces | B_color_the_Fence.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int v;
cin>>v;
int a[9];
int mn=INT_MAX;
int ind=-1;
vector<pair<int,int>> vec;
for (int i = 0; i < 9; i++)
{
cin>>a[i];
// if(a[i]<=v && a[i]<=mn){
// mn=a[i];
// ind=i+1;
// }
... | ALGO | 0.999987 | 3.035487 |
fd158e4f-3269-4f93-a407-b78a5f88d5d1 | himanshu-rawat/Cplusplus | LeetCode/kthLargest.cpp | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int findKthLargestVector(vector<int> vec, int k)
{
sort(vec.begin(), vec.end(), greater<int>());
return vec[k - 1];
}
int main()
{
vector<int> v;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
int num;
... | ALGO | 0.99998 | 4.268825 |
8b173e2d-c34b-4aaf-879d-b506ed87845d | Kaushal14200/COA--Practicals | Bitwise operator.cpp | #include <iostream>
using namespace std;
int main() {
int x , y;
cin>>x,y;
cout<<"BITWISE AND" << (x&y) << endl;
cout<<"BITWISE OR" << (x|y) <<endl;
cout<<"BITWIESE XOR" <<(x^y) <<endl;
cout<<"BITWISE NOT" <<(x~y) <<endl;
cout<<endl;
cout<<"BITWISE leftshift ->x"<<(x<<2)<<endl;
co... | ALGO | 0.981058 | 3.712586 |
634fcf57-5f9d-4180-b29a-1d3fa64e84ae | vijayraikar1999/Coding-Ninjas-Data-Structures-and-Algorithms-Course-Completion | 01_Linked_List/10_palindrome_linked_list_solution.cpp | #include<string>
#include <cstddef>
class Node{
public:
int data;
Node *next;
Node() {
this->data = 0;
next = NULL;
}
Node(int data) {
this->data = data;
this->next = NULL;
}
Node(int data, Node* next) {
... | ALGO | 0.999575 | 5.031076 |
3c929786-7f74-4671-906e-26c6294d5104 | adarshraj93/Self-Driving-Car-Engineer | P7-Path-Planning-Project/src/Eigen-3.3/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_broadcast_simple.cpp | #include <iostream>
#include <Eigen/Dense>
using namespace std;
int main()
{
Eigen::MatrixXf mat(2,4);
Eigen::VectorXf v(2);
mat << 1, 2, 6, 9,
3, 1, 7, 2;
v << 0,
1;
//add v to each column of m
mat.colwise() += v;
std::cout << "Broadcasting result: " << std::endl;... | ALGO | 0.996678 | 4.136906 |
3ff54df5-47e4-4aa4-b001-af0c4775be28 | raghavsheoran/Playground | d_function.cpp | #include <iostream>
#include <cmath>
using namespace std;
const int MOD = 1e9 + 7;
long long digitSum(long long n) {
long long sum = 0;
while (n > 0) {
sum += n % 10;
n /= 10;
}
return sum;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int t;
cin >> t;
... | ALGO | 0.999657 | 5.02554 |
2fde6f58-505c-4b3b-a9ab-b23e0fd8df33 | my-carla/llvm-carla | projects/libcxx/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_urng.pass.cpp | // <algorithm>
// template<class RandomAccessIterator, class UniformRandomNumberGenerator>
// void shuffle(RandomAccessIterator first, RandomAccessIterator last,
// UniformRandomNumberGenerator& g);
#include <algorithm>
#include <random>
#include <cassert>
#include "test_macros.h"
int main()
{
... | TEST | 0.953796 | 6.701221 |
086ac8b6-ed23-47e2-a366-d20a208a19c7 | Vilberto02/Ejercicios-Logica_Programacion | Soluciones/C++/Sumatoria_Raices_Parametros_Referencia.cpp | /*
&nombre: extrae la direccion de memoria de la variable nombre.
int media = 4;
int *puntero: Permite almacenar la dirección de memoria de una variable de tipo entero.
puntero = &media : contiene la direccion de memoria de la variable memoria.
*puntero = 6 : Accede al contenido de la dirección de memoria de la variab... | ALGO | 0.996808 | 3.017171 |
5e8e60cb-4ea8-4dff-993e-807e641c230c | ishandutta2007/codeforces | enem/normal/1367/E.cpp | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M1 1000000007
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--... | ALGO | 0.999975 | 4.319069 |
3cbb055a-4d92-4aed-96c4-0ba22629034b | lovelybigduck/note | 代码练习/数据结构/C++code/BFS之迷宫最短步数.cpp | #include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
const int maxn=100;
struct node{
int x,y;
int step;//stepΪ㵽λõٲ
}S,T,Node;//ṹ
int n,m;//У
char maze[maxn][maxn];//Թ
bool inq[maxn][maxn];//¼λãx,y)ǷѾ
int X[4]={0,0,1,-1};
int Y[4]={1,-1,0,0};
//λ(x,y)ǷЧ
bool test(int x,int y... | ALGO | 0.99986 | 4.010302 |
204609e4-be9f-4345-aba5-328d0668010d | AlveyCoin/Alvey-Core | src/cpp-ethereum/libdevcrypto/CryptoPP.cpp | #include <libdevcore/Guards.h> // <boost/thread> conflicts with <thread>
#include "CryptoPP.h"
#include <cryptopp/eccrypto.h>
#include <cryptopp/osrng.h>
#include <cryptopp/oids.h>
#include <libdevcore/Assertions.h>
#include <libdevcore/SHA3.h>
#ifndef ALV_BUILD
static_assert(CRYPTOPP_VERSION == 820, "Wrong Crypto++ ... | TOOL | 0.95829 | 7.544416 |
8736f85c-b294-49ff-9e9a-5b83c4c820fe | linux4life798/llvm-project-ci-test | libcxx/test/std/algorithms/alg.modifying.operations/alg.transform/ranges.transform.unary.pass.cpp | // UNSUPPORTED: c++03, c++11, c++14, c++17
// <algorithm>
// template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
// copy_constructible F, class Proj = identity>
// requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>>
// constexpr ranges::unary_transform_result<I, O... | TEST | 0.945226 | 7.750922 |
f8d28e09-8798-49fb-8880-8d396767f05d | andy2git/coding | lintcode/cpp/Lowest_Common_Ancestor.cpp | /**
* Solution: find the first element which has non empty left and right returned
* - top->down: search the element, and return the node has A or B
* - bottom->up: based on the searched result to return the FIRST node with non-empty left or right return
*
* 5 <- A
* \
* 6 <- B
* if A or B are t... | ALGO | 0.999994 | 6.304347 |
e1075eb7-fd46-4f35-815b-ab3477a25a84 | bruteforceboy/Advent-Of-Code-2020 | Day08/HandheldHalting.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
freopen("HandHeldHaltingIn.txt", "r", stdin);
string s;
vector<pair<string, pair<char, int>>> commands;
while (cin >> s) {
char op;
cin >> op;
int n;
cin >> n;
commands.emplace_back(s, ma... | ALGO | 0.999865 | 4.714225 |
2104952c-7dd3-451f-a535-ead5395b58f0 | ShahzainAhmed/GetX_Routes | 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 |
5c04a854-722d-4b8d-a751-a55678a5bab1 | TonyTangYu/llvm-project | libcxx/test/std/algorithms/alg.nonmodifying/alg.is_permutation/is_permutation_pred.pass.cpp | // <algorithm>
// template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate>
// constexpr bool // constexpr after C++17
// is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
// ForwardIterator2 first2, BinaryPredicate pred);
#include <algorithm>
#include <funct... | TEST | 0.977684 | 7.428549 |
8d6d147e-ee1d-415b-a9a5-64a4f98b1437 | bumzy/PAT | PAT_Advanced_Level_Practise/A1001.cpp | #include <cstdio>
using namespace std;
int main() {
int a, b;
scanf("%d%d", &a, &b);
int c = a + b;
if (c < 0) {
printf("-");
c = 0 - c;
}
if (c >= 1000000) {
printf("%d,%03d,%03d\n", c / 1000000, (c % 1000000) / 1000, c % 1000);
} else if (c >= 1000) {
print... | ALGO | 0.999741 | 3.67966 |
473d9c17-03b8-418d-8aeb-5f1155c46fea | WgHost-git/Task-solution_in_Cpp | Task-solution_9/Task1.cpp | /*
Разработайте программу «Библиотека». Создайте структуру «Книга» (название, автор,
издательство, жанр). Создайте массив из 10 книг. Реализуйте для него следующие возможности:
- Редактировать книгу
- Печать всех книг
- Поиск книг по автору
- Поиск книги по названию
- Сортировка массив... | TOOL | 0.998807 | 4.869528 |
cf88b5b9-fef5-449f-a39a-62057953c892 | Shivam0001/Competitive-Programming | Test/substr.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
char a[1000000];
cin>>a;
int len=strlen(a);
int i=0,j=0;
for(i=0;i<len;i++)
{
for(j=i;j<len;j++)
{
for(int k=i;k<=j;k++)
{
cout<<a[k];
}
cout<<endl;
}
}
}
| ALGO | 0.999895 | 3.121386 |
6f9ccac3-dbe9-4c83-905a-43dcf240cc62 | duchenlong/boost-search-engine | boost/install/boost_1_53_0/libs/graph/example/edge_iterator_constructor.cpp | /*
Sample data (edge_iterator_constructor.dat):
5
10
0 1
1 2
1 3
2 4
3 4
1 0
2 1
3 1
4 2
4 3
Sample output:
0 --> 1
1 --> 2 3 0
2 --> 4 1
3 --> 4 1
4 --> 2 3
*/
#include <boost/config.hpp>
#include <utility>
#include <iostream>
#include <fstream>
#include <iterator>
#inc... | ALGO | 0.998676 | 5.416752 |
97387c37-4eee-41cf-8aa2-b96e2dfab5d5 | utsxvrai/CrackYourPlacement | Day 03/GenerateParanthesis.cpp | class Solution {
public:
void fun(int n , vector<string> &ans , string &temp , int i, int j){
if(i == n && j == n){
ans.push_back(temp);
return;
}
if(i < n){
temp.push_back('(');
fun(n,ans,temp,i+1,j);
temp.pop_back();
}
... | ALGO | 0.999953 | 6.28066 |
f89a8a47-be45-4334-b120-d46f2e9c8c4a | ishandutta2007/codeforces | fsouza/normal/458/B.cpp | #include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <vector>
using namespace s... | ALGO | 0.99999 | 3.476903 |
9d04bb74-1e57-45bc-863d-bd6c0101aa1d | jovi-j/projetos-UFRN | LP1-2021.2-Lista2/super_bingo/src/main.cpp |
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include "Cartela.hpp"
#include "Jogador.hpp"
using namespace std;
/*
TODO: implementar o main
*/
int main(){
/** TODO: ler a seed do jogo e configurar usando o método estátio da classe Cartela*/
/** TODO: criar cartelas e adicio... | TOOL | 0.897834 | 4.311964 |
ada6990a-67c9-400e-847e-c841856359f1 | Santosh-Pathak/Code_Forces | goodBye24/tenderCarpenter.cpp | #include<bits/stdc++.h>
using namespace std;
// Function to determine if there are at least two ways to partition the array
bool canPartition(const vector<int>& a, int n) {
// Check for at least two partitions
for (int i = 1; i < n; ++i) {
if(2*min(a[i],a[i-1]) > max(a[i],a[i-1])) return true;
}
... | ALGO | 0.999868 | 6.296477 |
18540057-647d-47d4-9ffd-5e9211c44a4a | subhm2004/Leetcode_Solutions | 445-add-two-numbers-ii/add-two-numbers-ii.cpp | class Solution {
public:
// Reverse a linked list
ListNode* reverse(ListNode* head) {
ListNode* prev = nullptr;
while (head) {
ListNode* next = head->next;
head->next = prev;
prev = head;
head = next;
}
return prev;
}
ListN... | ALGO | 0.999926 | 7.081175 |
41932c7f-c072-4369-bb96-67d73411a408 | ArfiH/CP | SadSplits2.cpp | // Author : Arfi
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define nl "\n"
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
ty... | ALGO | 0.999918 | 4.340481 |
b7facb7a-22e4-4138-81f8-d50961bad5e9 | wuuuuji/learn_cpp | pintia/PAT (Basic Level)/1002.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string n;
cin >> n;
register int i=0,sum=0,size=n.size();
string res[10] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
for (; i < size; ++i) {
sum+=n[i]-'0';
}
string num = to_string(sum);
for... | ALGO | 0.999777 | 3.871572 |
18cee4c9-b084-4a83-b57b-0b8a1568c6fc | KanchanBora/Strivers-SDE-sheet | Day 27. Trie/Implement Trie.cpp | /*
Your Trie object will be instantiated and called as such:
Trie* obj = new Trie();
obj->insert(word);
bool check2 = obj->search(word);
bool check3 = obj->startsWith(prefix);
*/
struct Node{
Node* links[26];
bool ending = false;
bool containsKey(char ch){
return (links[ch - '... | ALGO | 0.999749 | 6.071686 |
6f56bb6e-4d6d-4395-811d-987ca97ec680 | ishandutta2007/codeforces | abitstochastic/normal/1753/B.cpp | #include<bits/stdc++.h>
using namespace std;
int pot[500003] , N , X;
int main(){
ios::sync_with_stdio(0); cin >> N >> X;
for(int i = 1 ; i <= N ; ++i){int t; cin >> t; ++pot[t];}
for(int i = 1 ; i < X ; ++i){pot[i + 1] += pot[i] / (i + 1); if(pot[i] % (i + 1) != 0){cout << "No"; return 0;}}
cout << "Yes\n"; retu... | ALGO | 0.999987 | 3.678835 |
8f9024dc-8492-48be-87be-b7ac3e22186b | HJWAJ/acm_codes | CF/20120623/B.cpp | #include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<vector>
using namespace std;
struct circle
{
int x,y,r;
}c[4];
bool intersect(circle c1,circle c2)
{
int d,d1,d2;
... | ALGO | 0.999729 | 3.168864 |
d6b253a8-db66-4dae-98f1-c44854aa19ec | ishandutta2007/codeforces | burnoutag7/normal/1216/E2.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll qpow(ll a,ll n){
ll res=1;
while(n){
if(n&1)res=res*a;
a=a*a;
n>>=1;
}
return res;
}
ll tot(ll len){
return qpow(10,len)-qpow(10,len-1);
}
int getdig(ll k){//kth digit of 1234567891011...
ll len=1;
... | ALGO | 0.99985 | 4.436472 |
b5cb1471-6c0d-43d8-8f72-ccd678728d61 | sanchi191/Plagiarism | plag-project/plagproject/media1/emma/71_mZvdlvt.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <limits>
using namespace std;
# define INF std::numeric_limits<int>::max()
class contestant{
public:
int index;//0 redundant to N(inclusive)
int rank1;//1 - N
int rank2;//1 - N
int rank;
contestant(){};
contestant(int a, int b, int c):index(a... | ALGO | 0.99996 | 3.961253 |
b6a45c46-cd1d-4c1f-81ed-c0864a2d2b2a | KirtiSharma16/DAA2022_KirtiSharma2017336 | Week 8/KruskalAlgo.cpp | #include<bits/stdc++.h>
using namespace std;
bool cmp(vector<int> &a,vector<int> &b)
{
return a[2]<b[2];
}
int findParent(vector<int> &parent,int node)
{
if(parent[node]==node)
return node;
return parent[node]=findParent(parent,parent[node]);
}
void unionSet(int u,int v,vector<int> &parent,vector<in... | ALGO | 0.999989 | 4.066339 |
a1826d5b-d775-4942-b5f3-dbbed2ce1eb7 | JeromeTH/CSES | Playlist.cpp | #include <iostream>
#include <cstring>
#include <algorithm>
typedef long long ll;
using namespace std;
const int size = 1e9 + 1;
ll n, s[200001], t[200001];
int exist[200001];
int main()
{
scanf("%lld", &n);
for (int i = 0; i < n; i++){
scanf("%lld", &s[i]);
t[i] = s[i];
}
sort(t, t + n)... | ALGO | 0.999978 | 3.682382 |
d7f5efc5-3006-4a1d-b2f2-1ba7d2f392c0 | cat2998/jungle_algorithm | 5_algorithm/1303.cpp | #include <iostream>
using namespace std;
int n, m;
char map[101][101];
int cnt[101][101] = {0};
int dfs(int x, int y) {
int num = 1;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
for (int i = 0; i < 4; i++) {
int drx = dx[i] + x;
int dry = dy[i] + y;
if (0 <= drx && dr... | ALGO | 0.999883 | 4.087943 |
348341c0-c248-474c-b3bb-2fa8d34a0035 | TechAoba/OJ-code | 洛谷/P1582 倒水.cpp | #include<iostream>
#define LL long long
#define lowbit(i) (-i&i)
using namespace std;
inline LL count(int num) { //õ1ĸ
LL i=1, cnt=0;
while(i<=num) {
if(num&i) cnt++;
i<<=1;
}
return cnt;
}
int main()
{
LL N, K, ans=0;
cin>>N>>K;
if(N<=K) {
cout<<K-N<<endl;
return 0;
}
while(count(N)>K) {
ans+=lo... | ALGO | 0.999856 | 3.750698 |
2fd5f7a7-a525-4151-9ecc-03ca1b29eccf | Shantnu12345/AutomatedHighwayDriving | src/Eigen-3.3/bench/sparse_transpose.cpp |
//g++ -O3 -g0 -DNDEBUG sparse_transpose.cpp -I.. -I/home/gael/Coding/LinearAlgebra/mtl4/ -DDENSITY=0.005 -DSIZE=10000 && ./a.out
// -DNOGMM -DNOMTL
// -DCSPARSE -I /home/gael/Coding/LinearAlgebra/CSparse/Include/ /home/gael/Coding/LinearAlgebra/CSparse/Lib/libcsparse.a
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef... | ALGO | 0.983351 | 5.142622 |
38d4dd57-b104-47bf-bbb5-cb4dff89e9fb | Injarapugc/cpcodes | C_Balanced_Team.cpp | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define fo(i, n) for (int i = 0; i < int(n); i++)
#define fi(i,n,x) for (int i = x; i < int(n); i++)
#define mod 1000000007
#define ss(a) sort(a.begin(),a.end())
/*
"Belove... | ALGO | 0.99989 | 3.591949 |
f5855dc9-3327-4ed8-aaf2-7c2185153c42 | cssaivishnu/Algozenith-AZ-201 | m1 w4 - Acquiring Gears for Future/Two Pointers/3 sum.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define lli long long
void solve()
{
lli n, target, i, j, k;
cin>>n>>target;
lli a[n];
for(i=0; i<n; i++){
cin>>a[i];
}
sort(a,a+n);
lli ans=0;
for(j=0; j<n; j++){
i = 0;
k = n-1;
while(i<j ... | ALGO | 0.999957 | 5.383729 |
8c34faf4-e88a-4abf-bed3-2a192163af2b | dshnightmare/LeetCodeC | src/ConstructBinaryTreePAIT.cpp | #include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};
class Solution{
TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder){
return help(postorder, 0, postorder.size() - 1, inorder, 0, inorder... | ALGO | 0.999838 | 5.864018 |
b5183e01-3319-4225-b512-987ff1529938 | H-Shen/MyCodeCollection | Leetcode/2656/2656.cpp | class Solution {
public:
int maximizeSum(vector<int>& nums, int k) {
int s = 0;
int maxVal = *max_element(nums.begin(),nums.end());
while (k--) {
s += maxVal;
++maxVal;
}
return s;
}
};
| ALGO | 0.999942 | 5.577565 |
62cdbadf-74c6-406d-b862-4a0a0316cd3e | Carottin/LOG635_lab3 | src/main.cpp | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include "main.h"
#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
using namespace std;
double** matrice_data;
char** title_data;
int n_k;
int nb_lignes;
int nb_critere;
int main(int argc, char* argv[])
{
int nb_li... | ALGO | 0.992238 | 3.568332 |
d87f3a2b-063e-4fdb-84ba-eaac4707c750 | mhBahrami/MPC | src/Eigen-3.3/bench/sparse_randomsetter.cpp |
#define NOGMM
#define NOMTL
#include <map>
#include <ext/hash_map>
#include <google/dense_hash_map>
#include <google/sparse_hash_map>
#ifndef SIZE
#define SIZE 10000
#endif
#ifndef DENSITY
#define DENSITY 0.01
#endif
#ifndef REPEAT
#define REPEAT 1
#endif
#include "BenchSparseUtil.h"
#ifndef MINDENSITY
#define M... | TOOL | 0.864243 | 4.487392 |
6b3e37d8-e770-4c5d-b65d-d96111ebc913 | hunter-619/Striver-SDE-Sheet-Challenge-2023 | Day 7 - Linked List and Array/41.cpp | /*
41. Consecutive Ones
Time Complexity : O(N)
Space Complexity : O(1)
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int curr = 0, ans = 0;
for(int i = 0; i < nums.size(); i++) {
nums[i] ? curr++ : curr = 0;
ans = max(curr, ans);
}
... | ALGO | 0.999741 | 6.031683 |
f69d6e96-69b8-41cc-ad2d-99c0361d7ab6 | greensci/greensoupmod-src | sp/src/mathlib/randsse.cpp | #include <math.h>
#include <float.h> // Needed for FLT_EPSILON
#include "basetypes.h"
#include <memory.h>
#include "tier0/dbg.h"
#include "mathlib/mathlib.h"
#include "mathlib/vector.h"
#include "mathlib/ssemath.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
// see knuth vo... | TOOL | 0.966089 | 5.928762 |
45611719-6c34-4af8-91cc-dc052430f4b7 | Flanture/QUEST-QUasi-clique-Enhanced-Structure-aware-Transformation-for-Low-overlap-Point-Cloud-Registration | quasi-clique/src/FastQC.cpp | #include<iostream>
#include<vector>
#include<set>
#include<time.h>
#include<math.h>
#include "../include/RandList.h"
#include <igraph/igraph.h>
#include "../include/FastQC.h"
#include "../include/global_counter.h"
#include <string>
#include <unordered_map>
using std::cout;
using std::vector;
using std::set;
using std:... | ALGO | 0.997799 | 3.240074 |
ba764cf3-6132-4a72-93a6-bc9b95ce7f60 | GJT-npu/cpp-learning | test_7/7_1.cpp | #include<iostream>
using namespace std;
void n_chars(char c, int n);
int main(void)
{
int times;
char ch;
cout << "Enter a character: ";
cin >> ch;
while(ch != 'q')
{
cout << "Enter an integer: ";
cin >> times;
n_chars(ch, times);
cout << endl;
cout << "... | TOOL | 0.856664 | 3.166363 |
6201e222-8c6a-4359-b6ff-284c96643d09 | pakuland3/CP | contests/Codeforces/CF 986/C.cpp | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
ios_base::sync_with_stdio(false); cin.tie(NULL);
int t;
cin >> t;
while(t--){
int n,m;
ll v;
cin >> n >> m >> v;
vector<ll> a(n),sum(n+1,0);
for(int i=0;i<n;i++){
cin >> a... | ALGO | 0.999981 | 4.405665 |
ecf52889-d1e9-4ad4-abb9-cf92e8fc74c4 | baoxuezhao/solution_set | leetcode/Anagrams.cpp | class Solution {
public:
vector<string> anagrams(vector<string> &strs) {
unordered_map<string, vector<string> > map;
for(auto str: strs)
{
string str1 = str;
sort(str1.begin(), str1.end());
map[str1].push_back(str);
}
vect... | ALGO | 0.999977 | 6.127412 |
0d2894ef-26e5-4013-a2b3-a567e7086fa4 | kobor1/harwest | codeforces/520/B.cpp | //Krzysztof Boryczka
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
#define FOR(i, b, e) for(int i=b; i<=e; i++)
#define FORD(i, b, e) for(... | ALGO | 0.999971 | 3.61445 |
d0ef54b8-26b6-42b3-bad3-9c4609b0c7a9 | mhwen/competitive-programming | USACO/2006_Open/gold_the_milk_queue.cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <functional>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <random>
#include <chrono>
using namespace std;
typedef long long ll;
#define sz(x) (int)(x).size()
#define al... | ALGO | 0.999963 | 4.643771 |
ba114df4-0bdb-4f03-b948-a2811e6b74b8 | kaniz-codes/codeforces-contests-solve | problemset-2-solves/03_implementation/a_hulk.cpp | #include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i=1; i<=n; ++i)
{
if (i%2 == 1)
cout << "I hate";
else
cout << "I love";
if (i<n)
cout << " that ";
else
cout << " it";
}
return 0... | ALGO | 0.999862 | 3.587076 |
33c5aa39-4148-4299-a4c3-f15c8a72aba1 | destamutiara/jobsheet7 | 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 |
419b5960-ea5d-4cfc-9b29-f3978dec664f | everson121/everson121.github.io | 1º Ano/Informatica Basica/AV2 .cpp | #include <iostream>
#include <conio.h>
using namespace std;
bool digito(char carac)
{
return (carac >= '0' && carac <= '9');
}
bool letra(char carac)
{
return ((carac >= 'A' && carac <= 'Z') || (carac >= 'a' && carac <= 'z'));
}
bool digitoPar (char carac)
{
return (carac == '0' || carac == '2' || carac ... | TOOL | 0.971396 | 4.050851 |
01d5e5c5-30ac-465a-b15e-4c0ef68769b6 | fr3ak2402/GalaxySlicer | src/libigl/igl/copyleft/cgal/delaunay_triangulation.cpp | #include "delaunay_triangulation.h"
#include "../../delaunay_triangulation.h"
#include "orient2D.h"
#include "incircle.h"
template<
typename DerivedV,
typename DerivedF>
IGL_INLINE void igl::copyleft::cgal::delaunay_triangulation(
const Eigen::PlainObjectBase<DerivedV>& V,
Eigen::PlainObjectBase<DerivedF>&... | ALGO | 0.99399 | 6.483095 |
5260a320-c568-4629-acab-726927804fa1 | sxweetlollipop2912/MaCode | .LHP/.Lop11/.HSG/.T.Hung/Week 5/NVDKhoa/1240.cpp | #include <iostream>
#include <cstdio>
using namespace std;
const int N = 12, M = 1 << 12, inf = 300;
int n, ln[M], prob[M], ans, a[3][N], f[M][3];
int main()
{
freopen("1240.inp","r",stdin);
freopen("1240.out","w",stdout);
n = 12;
for(int i=0; i<n; ++i) ln[1<<i] = i;
for(int k=1; k<(1<<n); ++k) f... | ALGO | 0.999006 | 3.591089 |
064c80e9-170e-4fef-88d4-4f4b8eb5d957 | RoshanKalek7/Data-Structures | program143(addition).cpp | #include<iostream>
using namespace std;
class ArrayX
{
private:
int *Arr;
int iSize;
public:
ArrayX(int iValue) // Parametrised constructor
{
this->iSize = iValue;
Arr = new int[iSize]; // Allocate the Resource
}
~Arra... | TOOL | 0.911812 | 4.149972 |
118d7dac-4aae-45b2-b507-8b6b3c6f43ad | tforawi/maze-gen | maze.cpp | #include <SFML/Graphics.hpp>
#include <iostream>
#include <ctime>
#include <cmath>
#include <vector>
#include <cstdlib>
enum mvmnt {
GRID,
GENERATE,
CALCULATE,
VISITING,
VISITED
};
int WIDTH = 600;
int HEIGHT = 600;
int row = 60;
int col = 60;
int state = GRID;
bool generated = false;
bool vis... | ALGO | 0.998132 | 5.095696 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.