uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
489e1d49-2e96-404b-9501-9d275737f49e | ishandutta2007/codeforces | gediminas/normal/420/D.cpp | #include <bits/stdc++.h>
using namespace std;
struct node {
int val;
int prior;
node *left = NULL, *right = NULL;
int dyd;
node(int v) {
val = v;
prior = rand();
dyd = 1;
}
void fix() {
dyd = 1;
if (left) {
dyd += left->dyd;
}
if (right) {
dyd += right->dyd;
}
}
int mazl() {
return ... | ALGO | 0.999998 | 3.953978 |
1398ac83-8085-490f-bc23-87d2a499df3b | sspeedy99/APS-2020 | String/Top_K_Frequent_Words.cpp | #include <iostream>
#include <unordered_map>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
int k;
cin >> k;
int n;
cin >> n;
unordered_map<string, int> m;
for (size_t i = 0; i < n; i++)
{
string s;
cin >> s;
m[s]++;
}
vector<pair<string, int... | ALGO | 0.999686 | 4.090267 |
ca8867b5-bb60-4035-93cb-41fc9d0c2177 | PointCloudLibrary/pcl | apps/src/openni_voxel_grid.cpp | #include <pcl/common/time.h>
#include <pcl/console/parse.h>
#include <pcl/filters/voxel_grid.h>
#include <pcl/io/openni_camera/openni_driver.h>
#include <pcl/io/openni_grabber.h>
#include <pcl/visualization/cloud_viewer.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <mutex>
// clang-format off
... | TOOL | 0.898054 | 6.911271 |
273fdd79-bc78-4f0e-b82a-d9d1be223389 | bcip/yandex2014 | round2/problems/cycles-with-common-point/src/bruteforce.cpp | #include <stdlib.h>
//#include "/Users/roman/Dev/SharedCpp/DebugOutput.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cassert>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 30;
const int V = 501;
int n, k, c[N];
vector<int> G[V];
int used[V], dst[V... | ALGO | 0.999348 | 3.748906 |
0f9ea996-0ef3-4db4-aa08-917e0caeeff2 | ishandutta2007/codeforces | rush_d_cat/normal/1178/B.cpp | #include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
typedef long long LL;
const int N = 1000000 + 10;
char s[N];
int n;LL pre[N],suf[N];
int main() {
scanf("%s",s+1); n=strlen(s+1);
for(int i=2;i<=n;i++) {
if(s[i]=='v' && s[i-1]=='v') pre[i]=pre[i-1]+1;
... | ALGO | 0.999612 | 3.867018 |
e5171cda-d82c-4aa5-bafa-c67da7461b5d | vickyguptaa7/CrackYourPlacement | 6Companies30days/Adobe/Count_Nodes_Equal_to_Average_of_Subtree.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.999824 | 6.995138 |
0dfb38e8-8750-4c3e-a885-048c777113a1 | Boudynab/acm | DSU/lang.cpp | #include <bits/stdc++.h>
#define abdo ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const int MAXN=105;
int parent[MAXN];
int sizee[MAXN];
bool flag = false;
vector<int>languagess[MAXN];
void dsu(int u){
parent[u]=u;
sizee[u]=1;
}
int get_leader(int u){
if(u==parent[u]){
... | ALGO | 0.999826 | 3.933084 |
6cec78c6-f7a5-4456-8ea7-f16c6a3f33b0 | hp2oo1/interview-questions | is-power-of-two/solution.cpp | #include <bitset>
#include <iostream>
using namespace std;
bool isPowerOfTwo(int x) {
bool result(false);
bitset<32> b(x);
//cout<<b<<endl;
if(b.count()==1)
result=true;
return result;
}
int main() {
int x;
while(cin>>x) {
//cout<<isPowerOfTwo(x)<<endl;
cout<<... | ALGO | 0.99947 | 4.748623 |
62d8f7d0-f920-46e2-8987-b0a3494a6e70 | heliastorres/Programing-cpp-Ifpr | LISTAS ORLANDO (BeeCrowd)/LISTA 03 - Números Reais/1006 Média 2.cpp | #include <iostream>
#include <iomanip>
using namespace std;
int main() {
double A, B, C, MEDIA;
cin >> A >> B >> C;
MEDIA = ((A*2)+(B*3)+(C*5))/10;
cout << fixed <<setprecision(1) << "MEDIA = " << MEDIA << endl;
return 0;
} | ALGO | 0.99957 | 4.290102 |
40e7f4a1-3745-4bd3-bae7-0ddf48a159a6 | leeuihyun/baekjoon-solve | 6603.cpp | #include<iostream>
#include<algorithm>
#include<cstring>
#include <string>
#include<math.h>
#include<vector>
#include<malloc.h>
#include<deque>
#include<stack>
#include<queue>
#include <sstream>
#include <functional>
#include <map>
#include <list>
#include <cmath>
#define _CRT_SECURE_NO_WARNINGS
#define MAX 1000001
usi... | ALGO | 0.999878 | 4.044658 |
6659c4cd-dcde-4006-b870-9fbbd5754344 | envycointeam/envycoin | src/rpcdump.cpp | #include "base58.h"
#include "rpcserver.h"
#include "init.h"
#include "main.h"
#include "sync.h"
#include "wallet.h"
#include <fstream>
#include <stdint.h>
#include <boost/algorithm/string.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/lexical_cast.hpp>
#include "json/json_spirit_value.h"
... | WEB | 0.938452 | 6.116704 |
6ee7b975-15ab-4646-98c7-5539939b8dad | aryantiwari522/DSA-Contribution | 1786-count-the-number-of-consistent-strings/1786-count-the-number-of-consistent-strings.cpp | class Solution {
public:
int countConsistentStrings(string allowed, vector<string>& words) {
vector<int> idx(26,0);
for(char c: allowed)
{
idx[c-'a']++;
}
int count=0;
bool flag=true;
for(string s: words)
{
for(char c:s)
... | ALGO | 0.999899 | 5.673085 |
40b1af75-2c8d-46e4-b1ca-d2c854cfbf9a | Tomoki-Kikuta/atcoder | atcoder過去問/diverta2-3.cpp | #include<iostream>
#include<algorithm>
#include<vector>
#define MAX 100005
using namespace std;
int main(void){
int n,A[MAX],count,minus=0;
vector<pair<int,int> > combination;
cin >> n;
for(int i=0;i<n;i++){
cin >> A[i];
}
sort(A,A+n);
count = A[n-1];
for(int i=n-2;i>=0;i--){
... | ALGO | 0.999824 | 3.4012 |
c41179e9-dadf-40bd-9e14-36205a51230b | AU-DIS/pyMARIGOLD | marigold/src/kmeans_runner.cpp | #include "interfaces/interface_kmeans.hpp"
#include "dataset.cpp"
#include <string>
#include <memory>
class KmeansRunner {
private:
std::unique_ptr<KmeansStrategy> kmeans_strategy_;
std::unique_ptr<Dataset> data;// = std::make_unique<Dataset>();
int* result_labels;
public:
exp... | ALGO | 0.921296 | 5.328389 |
3633b3dc-1b78-4fca-ab1d-8f1b21bef3f8 | abdullah-2k3/Cplusplus-Programs | Matrix/temp.cpp | //
//#include <iostream>
//#include <vector>
//using namespace std;
//void printMatrixValues(double** arr, int n, int m){
// for (int i = 0; i < n; i++) {
// for (int j = 0; j < m; j++) {
// cout<<arr[i][j]<<"\t";
// }
// cout<<endl;
// }
// return;
//}
//void printInverseMatrix(double** ar... | ALGO | 0.999913 | 3.020877 |
250313cb-d09f-46aa-9587-fc75d15982bc | DIT-ROBOTICS/Eurobot2023_ws | src/lidar_localization/src/area_obstacles_extractor.cpp | /**
*
* @file area_obstacles_extractor.cpp
* @brief
*
* @code{.unparsed}
* _____
* / /::\ ___ ___
* / /:/\:\ / /\ / /\
* / /:/ \:\ / /:/ / /:/
* /__/:/ \__\:| /__/::\ / /:/
* \ \:\ / /:/ \__\/\:\__ / /::\
* \ \:\ /:/ \ \:\/\ /... | TOOL | 0.860436 | 6.150977 |
ef479e75-6e04-49c7-a1d0-41098680cc1c | zhiziqixingdeng/zhizi | cpp文件/石头剪刀布升级版.cpp | #include<iostream>
using namespace std;
int n,n1,n2;
int a[201],b[201];
int cnt1,cnt2,i,j;
int main(){
cin>>n>>n1>>n2;
for(i=1;i<=n1;i++){
cin>>a[i];
}
for(j=1;j<=n2;j++){
cin>>b[j];
}
i=j=cnt1=cnt2=0;
for(int x=1;x<=n;x++){
i++;
j++;
if(i>n1)i=1;
if(j>n2)j=1;
if(a[i]==0&&b[j]==... | ALGO | 0.999701 | 3.302763 |
a9e1c734-caed-4358-bf3c-bc6504ef6af0 | YALOKGARua/leetcode | 2999_powerful_integers.cpp | #include <string>
#include <vector>
#include <algorithm>
using std::string;
using std::vector;
class Solution {
public:
long long numberOfPowerfulInt(long long start, long long finish, int limit, string s) {
long long t = 0;
for (char c : s) t = t * 10 + (c - '0');
int m = (int)s.size();
long long p10 = 1;
... | ALGO | 0.999134 | 5.215621 |
9f6e7776-a389-4271-900c-9820f9bdd82d | alexandraback/datacollection | solutions_2652486_0/C++/Uranium/c.cpp | #include <cstdio>
#include <algorithm>
#define MAXK 7
#define MAXM 5
int R, N, M, K;
void solve() {
int exists[MAXM+1];
int prod;
for(int i = 0; i < R; ++i) {
std::fill(exists, exists + MAXM + 1, 0);
for(int j = 0; j < K; ++j) {
scanf("%d", &prod);
int prev = -1;
while(prev != prod) {
prev = pr... | ALGO | 0.999589 | 3.504431 |
5b3d3a7c-6683-4efc-9465-0eacd3b86ed4 | burrussmp/Senior-Design | Server/DepthGaugeReaderArduino/KickCounter/src/MovingAverage.cpp | #include "MovingAverage.h"
MovingAverage::MovingAverage():
sumElements(0.0),
mean(0.0),
std(0.0),
myQ()
{
}
void MovingAverage::addElement(double element)
{
double oldElement = 0.0;
if (element > 20 || element < -20)
{
return;
}
if (myQ.size() == MovingAverage::MAXSIZEOFQ)
{
//oldElement = myQ.fron... | ALGO | 0.983356 | 4.464746 |
b590b6ab-911f-4701-aea7-e51169882696 | Sandi2156/TLE-Eliminators-Level-2-Problems | 5-number-theory/15_minimum_lcm.cpp | #include <bits/stdc++.h> // This will work only for g++ compiler.
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclu... | ALGO | 0.999857 | 4.025873 |
e3a18f0e-1b7c-4760-9585-42709054bc07 | argon17/CFPractice | Jan2025/2025-01-21/F_Greetings.cpp | #include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#include <algo/debugger.h>
#else
#define debug(...) {};
#endif
// #define int long long
#define endl '\n'
using namespace std;
// Required headers for ordered_set
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// Typedef for the ordered_set
... | ALGO | 0.999823 | 4.638954 |
fa3da7a1-7e81-4079-b5f5-4cb7f55f1c12 | DerekBum/raytracing | hw3/source/figure.cpp | #include "figure.h"
#include <cmath>
Ray::Ray(Point o, Point d): o(o), d(d) {}
Ray Ray::operator+ (const Point &p) const {
return {o + p, d};
}
Ray Ray::operator- (const Point &p) const {
return {o - p, d};
}
Ray Ray::rotate(const Rotation &r) const {
return {r.transform(o), r.transform(d)};
}
std::opt... | ALGO | 0.997663 | 6.102063 |
3c7340ff-9e81-4fa4-be05-79d127d3567b | alexander-katrompas/simple-sorting | main.cpp | /* *************************************************
* Name: Alexander Katrompas
* Assignment: Demonstration Code
* Purpose: A demonstration of searching, sorting.
************************************************* */
#include "main.h"
int main() {
/* **********************************
* This function is t... | ALGO | 0.989114 | 4.830803 |
36754ec8-973e-4c9c-b604-2d876cae189d | 2Noahv/My_Cpp | grammar/wcscmp 구현하기.cpp | #include <stdio.h>
#include <wchar.h>
unsigned int GetLength(const wchar_t *_pStr)
{
// _pStr[1]; : main 함수에서 szName[0]; 을 접근함 const 포인터 때문에 수정 불가능
int i = 0; // 문자 개수 체크 용도
while (true) // 복잡하게 생각하지 말고 true를 넣어서 break로 끊어주자
{
wchar_t c = _pStr[i]; // *(_pStr + i);
if ('\0' == c)
... | ALGO | 0.959088 | 4.098553 |
79cb6337-54ce-49d1-8d38-c87120272d80 | morganjlim/CS31 | Project4/array.cpp | //the purpose of this program is to create a sort of library
//of common things that can be done with arrays
#include <iostream>
#include <string>
#include <cassert>
using namespace std;
//function declarations
bool hasDuplicates(const string array[], int size); //done
int countAllDigits(const string array[], int siz... | ALGO | 0.982412 | 4.64015 |
fa0e80dc-97d9-46f3-a243-32a8b669d18b | Linestro/gem5_Y | src/systemc/tests/systemc/misc/user_guide/chpt4.1/stage1.cpp | /*****************************************************************************
stage1.cpp --
Original Author: Martin Janssen, Synopsys, Inc., 2002-02-15
*****************************************************************************/
/*****************************************************************************... | ALGO | 0.982338 | 5.382321 |
efd908c5-777f-4033-aed6-3975bbeb0613 | ShangqunYu/trajectory_optimization | Humanoid_so3/casadi-linux-matlabR2014a-v3.5.5/include/casadi/core/determinant.cpp | #include "determinant.hpp"
using namespace std;
namespace casadi {
Determinant::Determinant(const MX& x) {
casadi_assert(x.is_square(), "Dimension mismatch. Matrix must be square, "
"but got " + x.dim() + " instead.");
set_dep(x);
set_sparsity(Sparsity::dense(1, 1));
}
std::string Determinan... | TOOL | 0.999864 | 6.505563 |
da784e2f-bab7-4702-8737-9c1b4a0e227f | tafnesj/competitive-programming | Codeforces/Practice/1030A - In Search of an Easy Problem.cpp | #include <bits/stdc++.h>
using namespace std;
int main(){
int n=0, aux=0;
cin >> n;
int str[(n*2)-1];
for(int i=0; i<(n*2)-1; i++){
cin >> str[i];
if(str[i]==1){
aux=1;
break;
}
i++;
}
if(aux){
cout << "HARD";
}else{
cout << "EASY";
}
return 0;
} | ALGO | 0.999751 | 3.470181 |
3ab6d588-6ea3-49d7-8612-3fd7da3a95db | melvinraj12/Kattis-C- | NastyHacks/NastyHacks.cpp | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a;
cin >> a;
int n[a][3];
string c[a];
int flag = 0;
for (int i = 0; i < a; i++)
{
for (int j = 0; j < 3; j++)
{
cin >> n[i][j];
}
flag = n[i][1] - n[i][2] - n[i][0];
... | ALGO | 0.999831 | 3.767623 |
d419babb-dfc8-4bb1-81c1-511010316fa6 | HoraceLuBFA/BFA-DFTT-CPP-Programming-2023 | Homework_05_Class_Basics/05_01.cpp | #include <cmath>
#include <iostream>
const double PI = 3.14159;
class Circle {
private:
double radius;
public:
// 构建函数
Circle(double rad)
: radius(rad)
{
}
// 计算面积的成员函数
double calculateArea()
{
return PI * pow(radius, 2);
}
// 计算周长的成员函数
double calculateCi... | ALGO | 0.987 | 6.300427 |
ea2206fa-bfe0-4636-9c52-a62ed27ccc8a | pophilpo/cpp_yellowbelt | week_1/task_tracker.cpp | #include <algorithm>
#include <map>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
// Выделим в отдельную функцию получение следующего по приоритету типа задачи
// Функция налагает требование на входной параметр: он не должен быть равен DONE
// При этом task_status явно не сравнивается с DO... | ALGO | 0.990788 | 5.745189 |
4c744ad9-20c3-4f34-a916-d0c288d4d58a | sarvex/leetcode-wren | solution/1600-1699/1673.Find the Most Competitive Subsequence/Solution.cpp | class Solution {
public:
vector<int> mostCompetitive(vector<int>& nums, int k) {
vector<int> stk;
int n = nums.size();
for (int i = 0; i < n; ++i) {
while (stk.size() && stk.back() > nums[i] && stk.size() + n - i > k) {
stk.pop_back();
}
if... | ALGO | 1 | 6.186914 |
1f23df50-f0ef-4d45-aecd-2e9ee8f2d245 | rudeUltra/DSA | 1930-unique-length-3-palindromic-subsequences/1930-unique-length-3-palindromic-subsequences.cpp | class Solution {
public:
int countPalindromicSubsequence(string s) {
unordered_set<char> letters;
for (char c : s) {
letters.insert(c);
}
int ans = 0;
for (char letter : letters) {
int i = -1;
int j = 0;
fo... | ALGO | 0.999713 | 6.569305 |
3eb47963-a68a-4c11-85a1-292a38968360 | Arin0110/Leetcode | 0409-longest-palindrome/0409-longest-palindrome.cpp | class Solution {
public:
int longestPalindrome(string s) {
map<char,int>mp;
for(int i=0;i<s.length();i++){
mp[s[i]]++;
}
int ans=0;
bool f=false;
for(auto i:mp){
if(i.second %2==0){
ans+=i.second;
}
else{... | ALGO | 0.999968 | 5.967646 |
5e97d623-c7a0-4bde-920e-7faf4960676b | karunsehwag/leetcode_daily | 1518-water-bottles/1518-water-bottles.cpp | class Solution {
public:
int numWaterBottles(int numBottles, int numExchange) {
int ans=0;
int k=0;
while((numBottles+k)>=numExchange)
{
ans+=numBottles;
int val=(numBottles+k)/numExchange;
k=(numBottles+k)%numExchange;
numBottles=val;
... | ALGO | 0.999904 | 5.047767 |
42c6e03c-d97d-49f6-96f3-c0556d3b920a | eleyf/Oregon_State_University_Classes | CS162 Intro to Computer Science II/lab10eleyf/FibonacciNR.cpp | /**************************************************************************************************
** Program Filename: FibonacciNR.cpp
** Author: Frederick Eley
** Date: 12/4/16
** Description: These are the function definitions of the FibonacciNR
** class.
**
** The methods make use of code from:
** ... | ALGO | 0.998956 | 5.14243 |
174abd9c-6a22-41ff-a5de-2f41f7cbeddb | eyang2020/Competitive-Programming | Advent-of-Code/2016/day06.cpp | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define PI 3.141592653L
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll INF = (ll)1e18;
const int N = 3e5 + 5;
const ll MOD = 1e9+7;
int parent[N];
int gcd(int a, int b) {
if (a == 0)
return b;... | ALGO | 0.999979 | 4.218771 |
83cf3d8b-e573-4302-839e-bb716bfdeccc | ScorchShana/BiologyApplication | GENEAlgorithm.cpp | #include "GENEAlgorihtm.h"
return_type GENEAlgorithm::independent_t_test(const GENEFile& gf1, const GENEFile& gf2, const int& a_level, std::vector<bool> &res,std::vector<double> &t_res)const {
if (gf1.data.size() != gf2.data.size()) return size_error;
res.clear();
bool is_few = false;
bool is_many = false;
#pr... | ALGO | 0.919983 | 4.398253 |
800a7e5a-596b-4a3a-9f63-a3f4c681eb76 | Shweta2024/Daily-DSA-Revision | 0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tagno-companies-found-for-this-problem-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlin... | class Solution {
public:
string largestOddNumber(string num)
{
string ans = "";
int end = -1;
for(int index = num.size()-1; index >= 0; index--)
{
if((num[index]-'0')%2 != 0)
{
end = index;
break;
}... | ALGO | 0.999803 | 6.161654 |
b84519c8-0ceb-4989-9f60-38ff186cdfe2 | Venetian/TwoDKalmanFilter | src/main.cpp | #include <iostream>
#include "TwoDKalmanTempoFilter.h"
int main(int argc, const char * argv[]) {
// insert code here...
std::cout << "SIMPLE EXAMPLE FOR TEMPO AND PHASE PROCESSING WITH KALMAN FILTER!\n";
TwoDKalmanTempoFilter kbf;
kbf.simpleExample();
return 0;
}
| ALGO | 0.885478 | 4.220882 |
016fb9c8-0036-448f-bb32-b7de4c5fd0af | kingarthur11/leetcode | solution/0000-0099/0063.Unique Paths II/Solution.cpp | class Solution {
public:
int uniquePathsWithObstacles(vector<vector<int>>& obstacleGrid) {
int m = obstacleGrid.size(), n = obstacleGrid[0].size();
int f[m][n];
memset(f, -1, sizeof(f));
function<int(int, int)> dfs = [&](int i, int j) {
if (i >= m || j >= n || obstacleGri... | ALGO | 0.999916 | 6.391019 |
3e4c6d0f-97dc-44ac-ab97-7d4f15fb1bbc | theoden42/code-store | codeforces/Educational Codeforces Round 165 (Rated for Div. 2)/C.cpp |
/* author: (g)theoden42 */
#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;
#define all(a) a.begin(), a.end()
#ifdef ON_PC
#include <debug.h>
#else
#define debug(x...)
#endif
template<typename T>
using o... | ALGO | 0.999891 | 4.403654 |
ce564d04-3f07-4075-b538-533830673b12 | vedanty3/dsa-codeground | leetcode-gfg-solutions/leetcode-solutions/spiral_order_matrix.cpp | /// Time complexity T = O(m*n)...
/// Space complexity = S = O(1)...
class Solution
{
public:
vector<int> spiralOrder(vector<vector<int>> &matrix)
{
vector<int> ans;
int m = matrix.size();
if (m == 0)
return ans;
int n = matrix[0].size();
if (n == 0)
... | ALGO | 0.999997 | 6.169831 |
52265aed-42f1-4f33-8875-ebbdcb9a5cd5 | omnibor/llvm-omnibor | llvm-project/clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp | #include "../index/Serialization.h"
#include "../index/dex/Dex.h"
#include "benchmark/benchmark.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Regex.h"
#include <string>
const char *IndexFilename;
const char *RequestsFilename;
namespace clang... | TEST | 0.962408 | 7.310152 |
6ad9ca9d-bb8a-427b-b23a-14e5b2f3b015 | LeMaker/android-actions | android/frameworks/av/media/libstagefright/codecs/amrnb/common/src/round.cpp | /*
Filename: /audio/gsm_amr/c/src/round.c
------------------------------------------------------------------------------
REVISION HISTORY
Description: Created separate file for the round function. Sync'ed up
with the current template and fixed tabs.
Description: Made changes based on review meeting:
... | ALGO | 0.998819 | 7.59631 |
a4013ee8-0089-4d23-a50b-fbb947ddb4d2 | naimulcsx/online-judge-solutions | Codeforces/707A - Brain's Photos.cpp | #include <bits/stdc++.h>
using namespace std;
bool is_colored(char *, int);
int main() {
int row, col;
cin >> row >> col;
char arr[row][col];
for (int i = 0; i < row; i++)
for (int j = 0; j < col; j++)
cin >> arr[i][j];
for (int i = 0; i < row; i++)
if ( is_colored(a... | ALGO | 0.997639 | 4.489384 |
55b4d680-15b6-4acf-9892-fd3201490451 | kartik0920/Revision | Day 16/Lec 61/stackbyq.cpp | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
class Qstack
{
queue<int> q;
public:
bool empty()
{
return q.empty();
}
void push(int x)
{
q.push(x);
}
int peek()
{
if (q.empty())
{
cout << "Empty Stack" << endl;
... | ALGO | 0.999466 | 4.162828 |
3be5b8fa-7f7c-433d-8e5e-ddbe0d0bad7d | Mitesh12ehd/DSA | 1. Basic question/q6_binaryToDecimal.cpp | #include<iostream>
#include<cmath>
using namespace std;
int binaryToDecimal(int num){
int ans = 0;
int i=0;
while(num){
int bit = num % 10;
ans = ans + bit * pow(2,i);
num = num/10;
i++;
}
return ans;
}
int main(){
int num;
cout<<"enter n"<<endl;
cin>>nu... | ALGO | 0.99923 | 4.463524 |
3894dab6-f608-4687-b902-1546026e0cf6 | A-R-M-028/DSA | 2 PATTERNS/invertedFullPyramid.cpp | #include <iostream>
#include<stdio.h>
using namespace std;
int main(){
int n;
cout<<"Put the row number:"<<"\n";
cin>>n;//n=5(by)5;
for (int i=0;i<n;i++){
//first spaces
for (int j=0;j<i;j++){
cout<<" ";
}
for (int j=0;j<n-i;j++){
cout<<"* ";
... | ALGO | 0.99978 | 3.505762 |
a55bc0f8-73e9-4b38-822a-546caf9e9b1c | dash-orlando/mech | software/control/OctoPrint/Printrbot Metal Plus/Marlin/vector_3.cpp | #include "MarlinConfig.h"
#if ABL_PLANAR || (HAS_BED_PROBE && ENABLED(AUTO_BED_LEVELING_UBL))
#include "vector_3.h"
#include "serial.h"
#include <math.h>
vector_3::vector_3() : x(0), y(0), z(0) { }
vector_3::vector_3(float x_, float y_, float z_) : x(x_), y(y_), z(z_) { }
vector_3 vector_3::cross(vector_3 left, ve... | TOOL | 0.865746 | 7.151684 |
0c561c4a-b75d-48a2-817a-4979e94de239 | YouKlike/APCS | C++/b005.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
while (cin >> n) {
int G[n][n] = {0},change_a = 0,change_b = 0,transA = 0,transB = 0;
for (int i = 0;i < n;i++) {
for (int j = 0;j < n;j++) {
cin >> G[i][j];
}
}
for (int i = ... | ALGO | 0.999087 | 3.729398 |
a3218fec-22c3-4f3b-ba3e-cb6c480b4bcd | poonam870/stack | pushAtBottom.cpp | #include <bits/stdc++.h>
void solve(stack<int>& st, int x){
if(st.empty()){
st.push(x);
return;
}
int num=st.top();
st.pop();
solve(st,x);
st.push(num);
}
stack<int> pushAtBottom(stack<int>& st, int x)
{
solve(st,x);
return st;
}
| ALGO | 0.999922 | 4.85181 |
0d0314d2-9508-44b5-abb6-d071f1a71850 | Chalkydoge/misc | atcoder/289F.cpp | #include <bits/stdc++.h>
#define ll long long
using namespace std;
const int inf = 1e9+7;
int t = 1;
void solve() {
int sx, sy, tx, ty;
int a, b, c, d;
cin >> sx >> sy >> tx >> ty;
cin >> a >> b >> c >> d;
// sx, sy 通过一个点 u, v进行镜像翻转
// 翻转点计算 2u - sx, 2u - sy,
// 奇数-奇数, 偶数-偶数 所以如果起点/终点奇偶不匹配 => 直接寄
if... | ALGO | 0.999853 | 3.33743 |
df2a71fd-0821-4845-881c-319ed684ff55 | sebasgomez01/so-uba | prácticas/práctica 1/fork3.cpp | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
int main(int argc, char const *argv[]){
pid_t pid = fork();
//si no hay error, pid vale 0 para el hijo
//y el valor del process id del hijo para el padre
if (pid == -1) exit(EXIT_FAILURE);
//si es -1, hubo un error
else if (... | ALGO | 0.99949 | 3.646039 |
93e3da55-98c7-4b07-b753-29acc0bc7853 | ishandutta2007/codeforces | bluediamond/normal/1732/C1.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#ifdef ONPC
mt19937 rng(228);
#else
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
const int B=30;
signed main() {
#ifndef ONPC
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#endif
int tt;
cin>>tt;
... | ALGO | 0.999894 | 3.669518 |
fe8da7ae-32f0-402f-9c9a-38fc90f30fa8 | AlanBinu007/CodeForces-Solutions | 149A - Business trip.cpp | //4032903 Jul 7, 2013 5:41:16 AM fuwutu 149A - Business trip GNU C++0x Accepted 15 ms 0 KB
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int k, a[12], total(0);
cin >> k;
for (size_t i = 0; i < 12; ++i)
{
cin >> a[i];
total += a[i];
}
if (total... | ALGO | 0.999855 | 3.861992 |
bfcf48cb-5bfb-48be-8c28-27c00f740f96 | PoLin8922/UAV_Final_Project | casadi/casadi/solvers/collocation_meta.cpp | #include "collocation.hpp"
#include <string>
const std::string casadi::Collocation::meta_doc=
"\n"
"Fixed-step implicit Runge-Kutta integrator ODE/DAE integrator based on\n"
"collocation schemes\n"
"\n"
"The method is still under development\n"
"\n"
"\n"
">List of available options\n"
"\n"
"+--------... | TOOL | 0.967897 | 6.445807 |
dd88c69d-6325-4ed9-bcf2-7c93dc167bba | ishandutta2007/codeforces | qiuzx/normal/494/E.cpp | //ANMHLIJKTJIY!
#pragma GCC optimize(2)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
#pragma GCC diagnostic error "-fwhole-program"
#pragma GCC diagnostic error "-fcse-skip-blocks"
#pragma GCC diagnostic error "-funsafe-loop-optimizations"
#include <bits/s... | ALGO | 0.999954 | 4.559059 |
0201250e-ae09-4875-9f10-5d379b498e07 | code-azeemahmad/Programming-Day | PD6/greaternumber.cpp | #include<iostream>
using namespace std;
int func(int number1, int number2);
int main()
{
int num1, num2, call;
cout<<"Enter first number: ";
cin>>num1;
cout<<"Enter second number: ";
cin>>num2;
call=func(num1,num2);
cout<< call;
}
int func(int number1, int number2)
{
if (number1>number2... | ALGO | 0.99958 | 3.98054 |
c535d21e-53e7-408e-a823-923bf8690f8e | mangosArchives/Mangos-Zero-scriptdev0-old | scripts/kalimdor/razorfen_downs/razorfen_downs.cpp | /* ScriptData
SDName: Razorfen_Downs
SD%Complete: 100
SDComment: Support for Henry Stern(2 recipes), Extinguishing the Idol Escort Event
SDCategory: Razorfen Downs
EndScriptData */
/* ContentData
npc_henry_stern
npc_belnistrasz
EndContentData */
#include "precompiled.h"
#include "escort_ai.h"
/*###
# npc_henry_stern... | TOOL | 0.934143 | 6.427176 |
ea929b1e-4017-4843-883e-eceae6f5c1fc | Mukesh20120/180_striver_sde_sheet | Day_1_Array/kadane_algo.cpp | class Solution {
public:
int maxSubArray(vector<int>& nums) {
int sum=0;
int ans=0;
for(int it: nums){
sum+=it;
if(sum<0)
sum=0;
ans=max(sum,ans);
}
return ans;
}
}; | ALGO | 0.999956 | 6.052474 |
9d739ce0-90b8-4c43-bc90-adc333c55346 | sungjoonyoung/Codeforces | CF662-D2/CF662-2.cpp | #include<iostream>
#include<vector>
using namespace std;
int arr[100001];
bool find(void);
int two = 0, four = 0, six = 0, eight=0;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
for (int i = 0; i < N; i++) {
int in;
cin >> in;
arr[in]++;
if (arr[in] == 2)two++;
if (arr[in] == 4)f... | ALGO | 0.999788 | 3.788693 |
b2787152-fd73-4e26-9590-a549802859f2 | AlexTheBest/ACore | src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp | /* ScriptData
SDName: Boss_Majordomo_Executus
SD%Complete: 30
SDComment: Correct spawning and Event NYI
SDCategory: Molten Core
EndScriptData */
#include "ScriptPCH.h"
#define SAY_AGGRO -1409003
#define SAY_SPAWN -1409004
#define SAY_SLAY -1409005
#define SAY_SPECIAL -1409006
#d... | TOOL | 0.898345 | 6.332911 |
911fcfb5-84f0-4e9f-a4e0-c408be76f609 | BrianTestShit/android_system_netd | netutils_wrappers/NetUtilsWrapper-1.0.cpp | #include <regex>
#include <string>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <android-base/strings.h>
#define LOG_TAG "NetUtilsWrapper"
#include <log/log.h>
#include "NetUtilsWrapper.h"
#define SYSTEM_DIRNAME "/system/bin/"
#define OEM_IFACE "[^ ]... | TOOL | 0.881836 | 5.636533 |
1701452c-e52f-43ba-a36f-e978e8470884 | yukimori/misc | math/eigen-eigen-07105f7124f9/doc/snippets/MatrixBase_part.cpp | #ifndef _MSC_VER
#warning deprecated
#endif
/*
Matrix3d m = Matrix3d::Zero();
m.part<Eigen::StrictlyUpperTriangular>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "And let us now compute m*m.adjoint() in a very optimized way" << endl
<< "taking advantage of the symmetry." << endl;
Ma... | ALGO | 0.983423 | 3.205996 |
fc5b6ea7-4ec1-4dd0-8857-a99905fd2b4e | 5-teamplay/5jo | OmokAI02/game.cpp | #include "game.h"
CGAME::CGAME()
{
}
// Ҷ ʿ ʱȭ ϰ,
// ȭ鿡 ǥش.
void CGAME::initGame(int mode)
{
x = y = CENTER;
t1 = t2 = clock();
passTriggerOn = false;
passCount = 0;
stoneState[0] = 0;
stoneState[1] = 0;
drawTime();
if(mode == 2) isComputer = true;
else isComputer = false;
if(mode == 4) curStone = BLACK_... | TOOL | 0.890915 | 4.08338 |
823c4941-1147-4c78-88d3-d8c9de939182 | Anubhav12345678/competitive-programming | CompareVersionNumbers.cpp | //THIS IS IB SOL IF NUMBER FORMAT OF VERSION NUMBERS GOES OU OF BOUNDS
int cmp1(string s1,string s2)
{
while(s1[0]=='0')
{
s1.erase(0,1);
}
while(s2[0]=='0')
{
s2.erase(0,1);
}
if(s1.size()>s2.size())
return 1;
if(s2.size()>s1.size())
return -1;
for(int i=0... | ALGO | 0.99976 | 5.08282 |
299b9eb1-3089-423e-a39d-11c2f843b810 | suciluz/competitive-programming | AnimalFarm/main.cpp | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fin '\n'
int n,m,ver,mst=0;
typedef pair<int,int> pi;
struct E {int u,v,w;}; vector<E> e;
bool cmp(E x, E y) {return x.w < y.w;}
map <pi,E> pen;
int p[101];
int Find (int d) {
if(d!=p[d]) p[d] = Find(p[d]);
return p[d];
}
int main() {
... | ALGO | 0.999737 | 4.035594 |
84ab443e-93c8-4fd4-ac76-9018ad1c7704 | alkaidL/UVaOJ | chapter5/299TrainSwapping.cpp | #include <iostream>
using namespace std;
const int maxn = 60;
int main()
{
int n, numTrains, trains[maxn];
cin >> n;
for(int k = 0; k < n; k++)
{
while(cin >> numTrains)
{
int countSwap = 0;
for(int i = 0; i < numTrains; i++)
{
cin >> ... | ALGO | 0.999651 | 3.874741 |
104da2e8-b4fb-4fa8-8c55-9d06477118f8 | ugne112/GameofLife | Code/3rdParty/Eigen-3.2.2.1/lapack/eigenvalues.cpp | #include "common.h"
#include <Eigen/Eigenvalues>
// computes an LU factorization of a general M-by-N matrix A using partial pivoting with row interchanges
EIGEN_LAPACK_FUNC(syev,(char *jobz, char *uplo, int* n, Scalar* a, int *lda, Scalar* w, Scalar* /*work*/, int* lwork, int *info))
{
// TODO exploit the work buffe... | ALGO | 0.998906 | 4.650104 |
ced4752f-73f7-4907-8647-c19e7557a451 | roshanyadavv/CP | the_porduct_mystery.cpp | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
ll a,b,c=0,n1=0,n2=0;
cin>>a>>b;
n1=a;
n2=b;
while(n1 != n2) {
if(n1 > n2)
n1 -= n2;
else
n2 -= n1;
}
c = b/n1;
cout<<c<<end... | ALGO | 0.999926 | 4.24122 |
5508e08b-78c7-4ad8-9347-1f59b9300818 | leehi0110/Algorithm | BaekjoonAlgorithm/P1_P2000/P1157.cpp | // Baekjoon 1157
// 문제
// 단어 공부
#include <iostream>
#include <vector>
#include <string>
#include <cctype>
using namespace std;
int main()
{
ios_base :: sync_with_stdio(false);
cin.tie(NULL);
string str;
char maxAlph;
int maxNum = 0;
vector <int> alph(26,0);
cin >> str;
for(int i=0;i<str.length(... | ALGO | 0.999961 | 4.150539 |
0ea10fad-8457-49b4-8844-4c03fe29549e | oheong/It-s_eong_time | 15686 치킨 배달/15686 치킨 배달/소스.cpp | #include<stdio.h>
#define SIZE 50
int N, M, H, C, ans = 2123456789;
int map[SIZE][SIZE], visited[13], min[2 * SIZE];
typedef struct { int y; int x; }WHAT;
WHAT house[2 * SIZE], chicken[13];
int abs(int a) {
if (a > 0)return a;
else return -1 * a;
}
void init() {
for (int i = 0; i < H; i++) min[i] = 2123456789;
}
voi... | ALGO | 0.999871 | 3.581083 |
7bd0a7d9-6fc5-424c-bd06-9ded5c76929a | patidartanay/Codeforces | 1300-1399/1476A.cpp | #include"bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef vector<int> vi;
#define pb push_back
#define REP(i,a,b) for (int i = a; i <= b; i++)
#define nl endl
long long solve() {
int n, k;
cin >> n >> k;
if(n==1) return k;
if(n==k) return (ll)1;
if(n<k){
int a = k/n ;
... | ALGO | 0.999787 | 4.119794 |
e99cdbcd-f928-43b0-8036-4eb112f226d0 | phantom1996/CBLPEDEC-19 | lecture 9/array-sum.cpp | // array-sum
#include <iostream>
using namespace std;
int Array_sum(int a[],int n,int i=0){
//base case
if(i==n){
return 0;
}
//recursive case
int sum=a[i]+Array_sum(a,n,i+1);//assumption;
return sum;
}
int Array_sum2(int *a,int n){
//base case
if(n==0){
return 0;
}
//recursive case
int sum=*a+Array_s... | ALGO | 0.999636 | 4.206739 |
2080284a-8128-476b-a675-a2ee3ba05c94 | NephrenCake/Algorithm | AcWing/算法提高课/第五章 数学知识/5.2 约数个数和欧拉函数/198. 反素数.cpp | #include<iostream>
using namespace std;
typedef long long LL;
int n, maxd, number; // nӵԼС
int primes[9] = {2, 3, 5, 7, 11, 13, 17, 19, 23};
void dfs(int idx, int limit, int cur, int sum) {
// idx öٵڼ limit ǰָ cur ǰ sum ǰԼ֮
if (sum > maxd || sum == maxd && cur < number) {
maxd = sum;//ǾҪһ
... | ALGO | 0.999929 | 4.046397 |
ecc8072c-112a-4514-9845-9c0e43f61b27 | phucducnguyen/LNS_Madam | src/mac.cpp |
#include "mac.h"
void mac_array(LNS<B, Q, R, Gamma> array_input_a[N], LNS<B, Q, R, Gamma> array_input_b[N], LNS<B, Q, R, Gamma> &result){
LNS<B, Q, R, Gamma> multiplier_result[N];
multiply_array(array_input_a, array_input_b, multiplier_result);
adder(multiplier_result, result);
}
void mac_nxn_array(LNS<... | ALGO | 0.998862 | 4.479908 |
77b80bbc-9eab-472b-a29a-0556aabcab93 | heavenMOJANG/ICPC | programmes_C_Cpp/Codeforces/CF1867/B.cpp | #pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
constexpr ll inf=0x7fffffff;
ll n;
string s;
void solve(){
cin>>n>>s;
s=" "+s;
ll cnt=0;
for(ll i=1;i<=n/2;++i) cnt+=(s[i]!=s[n-i+1]);
if(n&1) f... | ALGO | 0.99999 | 3.656919 |
4548311e-4bf5-4f18-882f-3af2b08f41fd | atharva1554/Leetcode-question-solution- | Difficulty: Medium/Ways to Reach the n'th Stair/ways-to-reach-the-nth-stair.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
// } Driver Code Ends
class Solution {
public:
int func(int n){
if(n <=2) return n;
int prev2 = 1;
int prev1 = 2;
int curr = 0;
for(int i=3; i<=n; i++)
{
curr = prev1 + prev2;
... | ALGO | 0.99936 | 6.194418 |
9d170e6e-eeee-4d75-9a69-425b88b49933 | HyIsNoob/NMLT_UIT | Source/Bai164/Bai_164.cpp | #include<iostream>
#include<cmath>
using namespace std;
void Nhap(int&);
float Xuly(int);
int main()
{
int n;
Nhap(n);
cout << Xuly(n);
return 0;
}
void Nhap(int& nn)
{
cout << "nhap n ";
cin >> nn;
}
float Xuly(int nn)
{
float s = 1;
int i = 1;
while (i <= nn)
{
s = (float)1/(s+1);
i = i + 1;
}
retur... | ALGO | 0.998781 | 3.35442 |
b2fb2b65-91bb-4615-812c-87389043f417 | Dark-Momo/Cpp | C++_Concurrency/14-1-LiveLock-PhilosopherDinning.cpp | #include <iostream>
#include <string>
#include <mutex>
#include <thread>
#include <chrono>
#include <vector>
const unsigned int numOfPhilosopher = 5;
const unsigned int numOfFork = numOfPhilosopher;
std::mutex ForkMutex[numOfFork];
std::mutex printMutex;
using namespace std::chrono_literals;
// -------------------... | ALGO | 0.988677 | 4.625262 |
1c3dd3a9-ad0a-4204-a8fb-de8e097822cc | AitrichAcademyFlutter/Batch-2.1 | module 7 Packages and Plugins/workshops/workshop2/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.992636 | 6.772262 |
51b468c9-5164-4537-998a-b7d00bc5b834 | Shubhee01/dsa_in_cpp | 0151-reverse-words-in-a-string/0151-reverse-words-in-a-string.cpp | class Solution {
public:
string reverseWords(string s) {
string a="";
int n=s.length();
vector<string> v;
for(int i=0;i<n;i++){
if(s[i]==' ' && !a.empty()){
// cout<<"wow"<<endl;
v.push_back(a);
a="";
continu... | ALGO | 0.999982 | 5.534759 |
0b6e102d-bdb2-4c78-8c2a-c00c96bed006 | ashib11/Sub_Zero_ | H_Mystery_of_Fibonacci.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.999894 | 4.102881 |
47c96c5e-1511-4187-a290-467794aae6c9 | Eaglebrave/the-C-repository | 猴子选大王(约瑟夫问题)(结构体法).cpp | #include <bits/stdc++.h>
using namespace std;
struct monkey{
int num;
int next;};
monkey a[1010];
int main()
{int n,k,count=0,remain,kk,cur,pre;
cin>>n>>k;
for(int i=1;i<n;i++)
{a[i].num=i;
a[i].next=i+1;}
a[n].num=n;
a[n].next=1;
remain=n;
kk=k%remain;
if(kk==0)kk=remain;
cur=1;
pre=n;
while(remain>1)
{count++;
if(co... | ALGO | 0.999994 | 3.088618 |
1cc9e4c9-a358-4dea-9162-66a17679f879 | rin2401/pp-lab | 1/exercise/ex2_pi/pi_omp.cpp | #include "pi.h"
#include <omp.h>
#define SIZE 100l
double *rect, *midPt, *area;
/* TODO */
/* Modify this function to implement a parallel version with openmp */
int compute(long int num_steps){
double pi;
double width = 2. / num_steps;
pi = 0.;
for (int i = 0; i < num_steps; ++i){
rect[i] = (... | ALGO | 0.999958 | 5.42707 |
8469a37d-b06c-49a0-9881-78f4d0bfb258 | hermes926/2019Fall-NTU-Introduction-To-Computer-Programing | 23/main.cpp | #include <stdio.h>
#include "max.h"
int main() {
int n, i;
int array[100];
int *iptr[100];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &(array[(i + 3) % n]));
iptr[i] = &(array[(i + 3) % n]);
}
printf("%d\n", max(iptr, n));
return 0;
}
| ALGO | 0.999282 | 3.465045 |
68aaf23e-7e76-47de-9c22-37499435ec3d | PedroDariva36/Desktop | Contests/mfpf2024/g/a.cpp | #include <algorithm>
#include <bits/stdc++.h>
#include <vector>
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
using namespace std;
ll x;
const ll m = 1e9+7;
ll solve(ll k, int p, vector<ll>&a){... | ALGO | 0.999995 | 4.49791 |
c4d4e466-9ec6-40b8-8134-0483940e937b | s2loves27/algorithm | 10000/15000/15657.cpp | #include <iostream>
using namespace std;
int N,M;
int num[9];
int ch[9];
int pr[9];
void f(int n,int m){
if(m == M){
for(int i = 0 ; i < M ; i++){
printf("%d ",pr[i]);
}
printf("\n");
return;
}
for(int i = n ; i < N ; i++){
pr[m] = num[i];
f(i,m+1);
}
}
void swap(int *a, int *b){
int temp = *a;
*... | ALGO | 0.99999 | 3.557277 |
c7e390a4-2051-4bd7-b1f8-4484d4804613 | ishandutta2007/codeforces | ecnerwala/normal/1245/A.cpp | #include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int T; cin >> T;
while (T--) {
int A, B; cin >> A >> B;
if (__gcd(A,B) != 1) {
cout << "Infinite" << '\n';
} else {
cout << "Finite" << '\n';
}
}
return 0;
} | ALGO | 0.998393 | 5.012133 |
474346ad-2afa-4769-a859-9fa1f3586dd9 | codingksj/Baekjoon-Solution | 백준/01000~01999/01200~01299/01238.cpp | #include<iostream>
#include<sstream>
#include<bitset>
#include<set>
#include<unordered_map>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<tuple>
#include<algorithm>
#include<string>
#include<numeric>
#include<functional>
#include<cmath>
#include<cctype>
#include<cstring>
#inclu... | ALGO | 0.999983 | 4.772501 |
54da565b-1840-4450-bbf2-d76e0da7ffa7 | maharshi6864/college_programs | Sem3/OOPs/cpp_class_assignmnets(80programs)/with_return_no_argument/min_from_3_numbers_using_ternary.cpp | #include <iostream>
using namespace std;
class MinFrom3NumbersUsingTernary
{
public:
int a, b, c;
int minFrom3NumbersUsingTernary()
{
return (a > b) ? ((a > c) ? 1 : 3) : ((b > c) ? 2 : 3);
}
};
int main()
{
MinFrom3NumbersUsingTernary ter;
cout << "enter value of a : ";
cin >> ter.a;
cout << "... | ALGO | 0.999913 | 4.720016 |
020763c5-b7cf-4cec-af90-c40ecae3fb91 | adarshdbg/Competitive-Programming | InterviewPrep/LeetCode/Stacks/Inorder1.cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void inorder(TreeNode* root,vector<int> & v){
if(!root){
return;
... | ALGO | 0.999917 | 6.352786 |
d1d737d1-4d63-4933-8e77-f03503b776a4 | imulan/procon | csacademy/round-41/cinema-seats.cpp | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pa... | ALGO | 0.999925 | 4.266625 |
219e216a-1c7b-452a-b926-4a3fcef9dce8 | MikelBarajas38/Grindset | Leetcode/1496-path-crossing.cpp | class Solution {
public:
bool isPathCrossing(string path) {
pair<int,int> p;
set<pair<int,int>> visited;
visited.insert(p);
for(char &c : path) {
if(c == 'N') {
p.second++;
}else if(c == 'S') {
p.second--;
... | ALGO | 0.999974 | 6.289053 |
be81fda1-bd7a-4e61-ba34-07166a3daecb | r05921034/DSP | hw1/dsp_hw4/test.cpp | #include <stdio.h>
#include <stdlib.h>
#include "hmm.h"
#include <string.h>
int epoch;
typedef struct node{
int num;
double prob;
}node;
int change(char c) // change the observation to int
{
switch(c)
{
case 'A':
return 0;
case '... | ALGO | 0.999139 | 3.796203 |
f8c4106c-0c5b-4d53-883c-367516b33bbd | HPC-AI-Team/lammps-fugaku-threadpool-sc23 | src/MC/fix_bond_swap.cpp | // clang-format off
#include "fix_bond_swap.h"
#include "angle.h"
#include "atom.h"
#include "bond.h"
#include "citeme.h"
#include "comm.h"
#include "compute.h"
#include "domain.h"
#include "error.h"
#include "fix_bond_history.h"
#include "force.h"
#include "memory.h"
#include "modify.h"
#include "neigh_list.h"
#incl... | ALGO | 0.995939 | 6.98062 |
aa17a81d-7570-4421-9d54-cb662f7bcd4e | shivamjha0306/Codes | Hackerrank/zig zag array.cpp | #include <bits/stdc++.h>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
long int n;
cin >> n;
long int a[n];
for(int i=0; i<n; i++ ){
cin>>a[i];
}
sort(a,a+n);
for(int i=0;i<n;i++){
long int temp;
... | ALGO | 0.999982 | 3.812677 |
472aed65-302b-4279-b4fa-0b35241fc0ef | iwanturequity/c- | stack/revstrstack.cpp | #include<iostream>
#include<stack>
using namespace std;
int main(){
stack<char>s;
string str = "rajiv";
for(int i = 0; i< str.length(); i++){
char ch = str[i];
s.push(ch);
}
string ans = " ";
while(!s.empty()){
char ch = s.top();
ans.push_back(ch);
s... | ALGO | 0.999945 | 5.467917 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.