uuid string | repo_name string | relative_path string | content string | category string | algo_rel_score float64 | quality_score float64 |
|---|---|---|---|---|---|---|
0740d174-5de2-4e91-a366-72508f087b22 | fphillips22/C-Code | program2/Submission/splitOneLine.cpp | //
// Created by Fletcher Phillips on 5/5/22.
//
#include <iostream>
#include <utility>
#include <vector>
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <algorithm>
using namespace std;
#include "splitOneLine.h"
vector<string>splitOneLine(const string& line){
vector<string>words;
string t... | TOOL | 0.960558 | 5.145457 |
029e6a3b-57b1-4848-9701-00e7d86c7acc | Irsyan12/AutiVision | windows/runner/utils.cpp | #include "utils.h"
#include <flutter_windows.h>
#include <io.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
void CreateAndAttachConsole() {
if (::AllocConsole()) {
FILE *unused;
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
if (freopen_s(&unuse... | TOOL | 0.998733 | 6.76775 |
2954232f-0c6b-4695-93fa-80aaa8f7fcc8 | selnem/curly-disco | koala/week1/연습문제/1330.cpp | #include<iostream>
using namespace std;
int main(){
int A,B;
cin>>A>>B;
if(A>B){
cout<<">";
}
else if(A<B){
cout<<"<";
}
else{
cout<<"==";
}
return 0;
} | ALGO | 0.99999 | 3.493072 |
e1056aca-a70d-476a-8cb1-77f54fda2820 | BhaveshPatil12/CPP-OOPS | Inheritance52.cpp | #include<iostream>
using namespace std;
class Person
{
int id;
char name[200];
public:
void accept_person_details()
{
cout<<"\n -------------------------------------------------- \n";
cout<<"\n Enter Id : ";
cin>>id;
... | TOOL | 0.850882 | 3.477562 |
19aa6aa6-0d81-4231-88f6-19e63143a302 | prashantgpt91/competitive-programming | practice arranged by sites/CODECHEF/SUBGCD-4874768.cpp | /* try.cpp : Defines the entry point for the console application.
struct event{
int x,y;
};
bool compare1(event i1, event i2)
{ return (i1.y < i2.y)? true: false; }
bool compare2(event i1, event i2)
{ return (i1.x < i2.x)? true: false; }
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
*/
//#include "st... | ALGO | 0.999472 | 3.599303 |
890ad08b-68e5-4cd3-8cf0-960c21d77341 | diyamahendru/Data-Structures-and-Algorithms | Leetcode/347.top-k-frequent-elements.cpp | /*
* @lc app=leetcode id=347 lang=cpp
*
* [347] Top K Frequent Elements
*/
// @lc code=start
using namespace std;
#include <vector>
#include <unordered_map>
#include <queue>
class Solution
{
public:
vector<int> topKFrequent(vector<int> &nums, int k)
{
unordered_map<int, int> mp;
priority_q... | ALGO | 0.999936 | 6.28593 |
80758bf5-ccb3-48fe-b151-e7c458e109ba | kunal-1908/DSA | 2D-ARRAY/WavePrint.cpp | #include<iostream>
#include<vector>
using namespace std;
vector<int> wavePrint(vector<vector<int>> matrix){
int row=matrix.size();
int column=matrix[0].size();
vector<int> temp;
for(int i=0;i<column;i++){
if(i&1){
//bottom to up.
for(int j=row-1;j>=0;j--){
... | ALGO | 0.999588 | 4.426539 |
d4a4a9d6-b9e6-472c-a0d7-ab4c3a2432c1 | blazhkevych/ConsoleApplication1 | ConsoleApplication1.cpp | /*
Всі роботи проводяться з файлом у бінарному режимі.
Використовувати масив не можна.
Написати такі функції:
1. Згенерувати у файл випадкові цілі числа від -100 до 100. Кількість чисел випадкова від 1 – 100.
2. Підрахувати кількість чисел у файлі;
3. Підрахувати суму чисел у файлі;
4. Підрахувати середнє арифметичне ч... | TOOL | 0.959441 | 3.951682 |
394b62b3-5f4c-42da-b6cb-8ec3ac5078e6 | leblance7/CPlusPlus | EvenAndOdds.cpp | #include <iostream>
#include <string>
#include <sstream>
using namespace std;
void odd(int x);
void even(int x);
int main() {
// cout << "The mera mera no mi, devil fruit." << endl;
int i;
do {
cout << "Please, enter number (0 to exit): ";
cin >> i;
odd(i);
} while( i != 0);
... | ALGO | 0.990921 | 3.959044 |
8af60833-e83d-4b30-8891-ca2c8b01632a | alexandraback/datacollection | solutions_5688567749672960_0/C++/ZZY/test.cpp | #include<iostream>
#include<cstdio>
#include<vector>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#define oo 1000000
#define MAXN 1000005
using namespace std;
int dis[MAXN];
queue<int> Q;
bool inQ[MAXN];
int rev(int x)
{
int s[8];
int n=0,i,t,ans... | ALGO | 0.999535 | 4.009894 |
cedb9c06-4abf-4207-8bd5-34734f5f3e87 | raincross7/code-similarity | codes/train_code/problem454/problem454_144.cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
int64_t H, W, A, B;
cin >> H >> W >> A >> B;
for (int h = 0; h < H; h++)
{
for (int w = 0; w < W; w++)
{
if (h < B)
cout << ((w < A) ? 0 : 1);
else
cout << ((w < A) ? 1 : 0);
}
cout << endl;
}
} | ALGO | 0.995098 | 3.008184 |
26ecbca7-dcd9-4267-b163-f75d5d8f8e69 | Lydxn/Competitive-Programming | DMOJ/totaldestruction.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
int v[1000000], diff[1000000];
int main() {
cin.sync_with_stdio(0);
cin.tie(0);
int N, M, Q, ans = 0;
cin >> N >> M >> Q;
for (int i = 0; i < Q; i++) cin >> v[i];
sort(v, v + Q);
for (int i = 0; i < Q - 1; i++) ... | ALGO | 0.99966 | 3.390009 |
8ef49a76-6995-4106-81ab-b3d7cf1aefe2 | Saber7X/DaiMaDaQuan | 2.cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n;
long long int res;
scanf("%lld",&n);
vector<int> num;
while(n--)
{
char a;
long long int b;
scanf("%c %lld",&a,&b);
if(a=='R')
{
num.push_back(b);
}
else if(a=='L')
{
num.insert(num.begin()+0,b);
}
else if(a=='?'... | ALGO | 0.999936 | 3.584847 |
214aa91f-b29f-4d92-af2d-4af69a89b89f | Ayush1thakur/VS_Code-notes | c++/String_04.cpp | #include <iostream>
#include <string>
using namespace std;
void s_seq(string str) {
// Base
if (str.empty()) {
return;
}
cout << str[0] << endl;
s_seq(str.substr(1));
}
int main() {
string str = "abc";
cout << endl;
s_seq(str);
return 0;
}
| ALGO | 0.999759 | 4.448085 |
4e1e084d-e656-44e8-b713-ef7487c0d4f8 | 2019331043-Zakaria/Codes | CB/wewe.cpp | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int t;
cin>>t;
for(int i=1;i<=t;i++)
{
ll n,j,ans;
double temp;
cin>>n;
for( j=1;j<=35;j++)
{
temp=pow(n,1.0/j);
if(floor(temp)==ceil(temp))
{
... | ALGO | 0.999923 | 3.598879 |
e2272b29-14cd-4415-a08b-d70901df5faa | yoon2000/Algorithm | algorithm/midterm/computingPowers.cpp | #include <iostream>
using namespace std;
double p(double x, int n){
if(n == 0) return 1;
else{
return x * p(x, n-1);
}
}
int main(){
cout << p(2.0, 3) << endl;
} | ALGO | 0.999982 | 4.102909 |
c6298253-74db-459f-ae9c-3828c8ad2c8e | GuillerLT/programming-problems | solutions/leetcode/add-to-array-form-of-integer.cpp | /* Problem add-to-array-form-of-integer
* https://www.leetcode.com/problems/add-to-array-form-of-integer
*/
#include <algorithm>
#include <vector>
class Solution {
public:
std::vector<int> addToArrayForm(std::vector<int>& num, int k) {
std::for_each(std::rbegin(num), std::rend(num),
[&k](in... | ALGO | 0.999283 | 7.057384 |
9b76d01b-4454-455f-96b0-e66d0aada87f | YaneZhekov/Cpp_Basics_11-12_Nested_Loops | 06 Cinema Tickets.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
string Movie, type;
getline(cin >> ws, Movie);
cout.setf(ios::fixed);
cout.precision(2);
int kidCount = 0, studentCount = 0, standardCount = 0;
int allPeople = 0, current = 0;
int roomSize, peoplePerRoom;
while ... | ALGO | 0.959526 | 4.283573 |
aa619ec9-b089-472f-81bd-30164c393cfc | Tanmay0808/CPP-Programs | Practice Questions/recursion/luckyNumber.cpp | #include<iostream>
using namespace std;
bool isLucky(int n, int counter=2)
{
if (n%counter == 0) return false;
if (counter > n) return true;
return isLucky(n - n/counter, counter+1);
}
int main(int argc, char const *argv[])
{
int n;
cin>>n;
if (isLucky(n))
{
cout<<"Number is lucky"... | ALGO | 0.999832 | 3.705889 |
0840b3a0-851f-40a8-ab55-d9a48acd4f01 | ishandutta2007/codeforces | pikel_rik/normal/1108/B.cpp | #include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
vi divisors(int m) {
vi ans;
for (int i = 1; i <= m; i++) {
if ... | ALGO | 0.999958 | 4.321392 |
2ff34479-f56b-4954-baaa-4d1e9ffa7d66 | ishandutta2007/codeforces | timmyfeng/normal/1063/D.cpp | #include <bits/stdc++.h>
using namespace std;
const int O = 2e4;
long long floor_div(long long a, long long b) {
return a / b - ((a ^ b) < 0 && a % b != 0);
}
tuple<long long, long long, long long> gcd(long long a, long long b) {
if (b == 0)
return {a, 1, 0};
auto [g, x, y] = gcd(b, a % b);
return {g, y,... | ALGO | 0.999892 | 3.339683 |
d87ee3df-4709-4191-a265-c9dba0f144da | Mohsin-Creater/Programming-Fundamentals-Cpp | Array 1.cpp | #include <iostream>
using namespace std;
int main() {
int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
int sum = 0;
for (int i = 0; i < 10; i++) {
sum += arr[i];
}
cout << "The sum of all numbers in the array is: " << sum << endl;
return 0;
}
| ALGO | 0.991315 | 4.270557 |
9381fe30-bb7f-484a-80de-4e2dbf8c4f5d | Kernel360/KDEV4-GROUPSTUDY-8 | hanbin/14888.cpp | #include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cmath>
using namespace std;
int n;
int arr[200];
int oper[4];
int max_value = INT_MIN;
int min_value = INT_MAX;
void recur(int num, int depth) {
if (depth == n) {
max_value = max(max_value, num);
min_value = min(min_value, ... | ALGO | 0.999977 | 4.052545 |
4ea05139-3e3e-4cf1-a30c-5e156ff0b4a5 | wcysai/Hakujitsu | The 2021 ICPC Asia Shenyang Regional Contest/M.cpp | #include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 233;
int s[maxn], sa[maxn], t[maxn], t2[maxn], c[maxn], n, r[maxn], h[maxn];
char str[maxn];
void build_sa(int n, int m) {
int i, *x = t, *y = t2;
for (int i = 0; i < m; i += 1) c[i] = 0;
for (int i = 0; i < n; i += 1) c[x[i] = s[i]] += ... | ALGO | 0.999967 | 3.61419 |
bd4a018f-1afc-4fc5-98f4-50d46e858d22 | egg-west/stratega_test | src/stratega/src/Agent/Heuristic/BasicTBSHeuristic.cpp | #include <Stratega/Agent/Heuristic/BasicTBSHeuristic.h>
namespace SGA {
BasicTBSHeuristic::BasicTBSHeuristic(int playerID, GameState initialState) {
//std::cout<< "Initialize BasicTBSHeuristic" << std::endl;
initialized = true;
for(const auto& entity : initialState.getEntities()) {
bool foundEnemyCity = fa... | ALGO | 0.991223 | 5.018994 |
bd9bd369-fade-4b38-9919-0873cb04cdc6 | Manan007224/street-coding | Leetcode/eventually_safe_states.cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<int> eventualSafeNodes(vector<vector<int>>& graph) {
g = graph;
v = vector<int>(graph.size(), -1);
vector<int> res;
for(int i=0; i<graph.size(); i++) {
if(!is_cycle(i)) res.push_back(i);
}
return res;
}
bool is_c... | ALGO | 0.99997 | 5.545235 |
ccafb1c4-879a-41b9-84f2-5c200deada84 | gokulcodes/competitive_programming_collections | ds/tree.cpp | #include <bits/stdc++.h>
using namespace std;
#define print(data) cout << data << endl;
class Node{
public:
int data;
Node *left, *right;
Node(int key){
data = key;
left = nullptr, right = nullptr;
}
};
int treeHeight(Node* root){
if(root == nullptr) return 0;
return max(treeHeight(root->left), treeHeigh... | ALGO | 0.99982 | 5.198515 |
77e5cd8f-78c3-4895-ab6c-df15e2c72130 | ngthvan1612/Codeforces | 274a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
typedef long long ll;
const int oo = 1e9 + 7;
const int modulo = 1e9 + 7;
template<typename T>
inline T sum(const T& a, const T& b) { return T((a % modulo + b % modulo) % modulo); }
template<typename T>
inline T mul(const T& a, const T& b) { ret... | ALGO | 0.999966 | 3.636123 |
5eca85f6-5d34-4547-ad49-f30dc0a82483 | bashu22tiwari/BashuTiwari-CP | Geeks For Geeks/palindrome.cpp | #include <bits/stdc++.h>
using namespace std;
bool isPalindrome(string s, int start , int end){
if(start>=end){
return true;
}
if(s[start]!=s[end]){
return false;
}
return isPalindrome(s,start+1,end-1);
}
int main(){
string s = "geeksaeeg";
int end = s.size();
e... | ALGO | 0.99958 | 4.100892 |
d4a8eeb8-85d7-4d6e-9c18-94a8f13b57ba | christiealappatt/TrilRACE | packages/rol/example/PDE-OPT/thermal-fluids/example_04.cpp | /*! \file example_01.cpp
\brief Shows how to solve the Navier-Stokes control problem.
*/
#include "Teuchos_Comm.hpp"
#include "ROL_Stream.hpp"
#include "Teuchos_GlobalMPISession.hpp"
#include "Teuchos_XMLParameterListHelpers.hpp"
#include "Tpetra_Core.hpp"
#include "Tpetra_Version.hpp"
#include <iostream>
#incl... | ALGO | 0.998506 | 5.084439 |
f2b93bbe-0b3d-4e3e-84af-12ce714e93b2 | Yunus-5874/veriyapilari1odev | G211210044_2/G211210044/src/Kromozom.cpp | /**
* @file kromozom.cpp
* @course 2.Ogretim B grubu
* @assignment 1.Odev
* @date 20.11.2024
* @author Yunus Emre Ylmaz <EMAIL>
*/
#include "Kromozom.hpp"
Kromozom::Kromozom()
{
ilk = son = 0;
onceki=sonraki=0;
uzunluk=0;
}
Kromozom::~Kromozom()
{
Gen *gezici = ilk;
while (gezici != 0)
{
... | ALGO | 0.954937 | 3.747159 |
0487b5a2-b28b-4a34-8c3d-ce9d4867c895 | luna4tech/MiniGames | simple C++/tictactoe.cpp | #include <iostream>
#include <vector>
#include <algorithm>
const char EMPTY = ' ';
const char X = 'X';
const char O = 'O';
const char TIE = 'T';
const char NO_ONE = 'N';
using namespace std;
void instructions();
char humanPiece();
char opponentPiece(char piece);
char askYesOrNo(string question);
int askNumber(string... | ALGO | 0.998575 | 5.679032 |
9ad631e5-80a2-40af-b9bb-78063122ca96 | Kirthik13/Leetcode-and-GFG-submissions | 0705-design-hashset/0705-design-hashset.cpp | class MyHashSet {
public:
vector<list<int>>v;
MyHashSet() {
v.resize(1500);
}
int gethashidx(int key)
{
return key%1500;
}
void add(int key) {
int hashidx=gethashidx(key);
v[hashidx].push_back(key);
}
void remove(int key) {
int hashi... | ALGO | 0.998499 | 5.569465 |
62c297f5-1445-4037-a3e5-e5791c8bfc1b | divyam8/bugfreecodes | interview-questions/trees/maxnonrecur.cpp | /* C++ program to print level order traversal using STL */
#include <iostream>
#include <queue>
#include <climits>
using namespace std;
// A Binary Tree Node
struct Node
{
int data;
struct Node *left, *right;
};
// Iterative method to find height of Bianry Tree
int printLevelOrder(Node *root)
{
// Base ... | ALGO | 0.999974 | 6.281152 |
4acf34c2-a024-4378-83dc-d7b8ec9d2f60 | AbhishekHacks/DSA-Solutions | String/LeetCode_71.cpp | /*You are given an absolute path for a Unix-style file system, which always begins with a slash '/'. Your task is to transform this absolute path into its simplified canonical path.
The rules of a Unix-style file system are as follows:
A single period '.' represents the current directory.
A double period '..' represe... | ALGO | 0.999925 | 6.446494 |
2125ffeb-958f-458f-8705-b585c2cf77c0 | ishandutta2007/codeforces | ashishgup/normal/443/A.cpp | #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(i=s;i<e;i++)
#define rf(i,s,e) for(i=s-1;i>=e;i--)
#define pb push_back
#define eb emblace_back
#defi... | ALGO | 0.998547 | 3.595606 |
696be6ca-9174-4c88-a1ff-290d39079fec | anthony-chaudhary/self-driving-car-nanodegree-nd013 | p10-model-predictive-control/quizes/CarND-MPC-Quizzes-master/global_kinematic_model/src/Eigen-3.3/doc/examples/Tutorial_BlockOperations_vector.cpp | #include <Eigen/Dense>
#include <iostream>
using namespace std;
int main()
{
Eigen::ArrayXf v(6);
v << 1, 2, 3, 4, 5, 6;
cout << "v.head(3) =" << endl << v.head(3) << endl << endl;
cout << "v.tail<3>() = " << endl << v.tail<3>() << endl << endl;
v.segment(1,4) *= 2;
cout << "after 'v.segment(1,4) *= 2', v... | ALGO | 0.984378 | 3.093805 |
448ce38f-a146-4014-85c5-5fd8c947ae89 | benmarder/CourseBid | CourseBid/CourseBid/BinatyMult.cpp |
#include "BinatyMult.h"
double BinaryMult::evaluate(int i) {
return left->evaluate(i) * right->evaluate(i);
}
| ALGO | 0.997377 | 4.394799 |
910e271d-ef24-407b-bfb0-22b56ab242e2 | face4/yukicoder | Level1_5/0499.cpp | #include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
string res = "";
while(n >= 7){
res.insert(0, to_string(n%7));
n /= 7;
}
res.insert(0, to_string(n));
cout << res << endl;
return 0;
} | ALGO | 0.999787 | 4.173452 |
26807e2f-af0d-48b2-9a88-dd653252b28b | Arunkumaryad/GFG-CODE | Medium/Prime Pair with Target Sum/prime-pair-with-target-sum.cpp | //{ Driver Code Starts
#include <bits/stdc++.h>
using namespace std;
class Array {
public:
template <class T>
static void input(vector<T> &A, int n) {
for (int i = 0; i < n; i++) {
scanf("%d ", &A[i]);
}
}
template <class T>
static void print(vector<T> &A) {
f... | ALGO | 0.996179 | 5.948641 |
eb28b656-fc68-4761-b811-f8898f17418d | Self0606/hello | codes/cpp/chapter_stack_and_queue/linkedlist_deque.cpp | /**
* File: linkedlist_deque.cpp
* Created Time: 2023-03-02
* Author: krahets (<EMAIL>)
*/
#include "../utils/common.hpp"
/* 双向链表节点 */
struct DoublyListNode {
int val; // 节点值
DoublyListNode *next; // 后继节点指针
DoublyListNode *prev; // 前驱节点指针
DoublyListNode(int val) : val(val), prev(nullp... | ALGO | 0.999111 | 6.074214 |
3b0c26d9-6f6c-4867-830c-2060a9dee9b9 | snandasena/cpp-advanced-topics | pointers/function_pointers.cpp | #include <bits/stdc++.h>
using namespace std;
#define endl '\n';
int Add(int a, int b)
{
return a + b;
}
int (*Func)(int, int);
int main()
{
// Function Pointers in C/C++
int c;
int (*p)(int, int);
p = &Add;
c = (*p)(2, 10);
printf("%d\n", c);
Func = Add;
c = Func(10, 3);
... | ALGO | 0.99635 | 4.846974 |
9b5de120-efa9-4ea8-be7c-a6490f1862fc | bryantbyr/LeetCode-solutions | 203. Remove Linked List Elements.cpp | //203. Remove Linked List Elements.cpp
#include <iostream>
using namespace std;
struct ListNode
{
int val;
ListNode *next;
ListNode(int x): val(x), next(NULL) {}
};
//Creatde by bryantbyr on 20170821
//Time:O(n)
//Space:O(1)
//Linked List (remove)
class Solution {
public:
ListNode* removeElements(List... | ALGO | 0.999954 | 5.28263 |
a5193894-01f5-4ff0-b287-43ba8ecd1992 | hoanglong2534/DSA-CodePTIT | tap_Con_bang_Nhau.cpp | #include<bits/stdc++.h>
using namespace std;
int n, a[101], ok = 0;
int sum = 0;
void ql(int i, int s){
if(s == sum/2){
ok = 1;
return;
}
if(ok == 1) return;
for(int j = i; j <= n ; j++){
if(s + a[j] <= sum/2){
ql(i + 1, s + a[j]);
}
}
}
int main(){
int t;
cin >> t;
while(t--){
cin >> n;
for(... | ALGO | 0.99974 | 4.560132 |
4bb2bb09-6708-492d-a870-f751a3c28d6c | BhishamGahlaut805/C_CPP_DSA_Algorithms | Graph_Cpp/BFS.cpp | #include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <set>
using namespace std;
void BFS(vector<vector<int>> &graph, int st)
{
int n = graph.size();
vector<bool> visited(n, false);
queue<int> q;
visited[st] = true;
q.push(st);
while (!q.empty())
{
... | ALGO | 0.999974 | 6.232201 |
b3150ff7-78c8-4421-80c0-2d702b6a5e79 | workalex1/FlatlandRT | third_party/Catch2/src/catch2/internal/catch_textflow.cpp | #include <algorithm>
#include <cstring>
#include <ostream>
namespace {
bool isWhitespace( char c ) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r';
}
bool isBreakableBefore( char c ) {
static const char chars[] = "[({<|";
return std::memchr( chars, c, sizeof( chars ) - 1 )... | TOOL | 0.867844 | 7.09556 |
de0c90e6-e5bd-4d65-8030-17a819a340a5 | abhi293/6th-semester | practice_only/cpp_practice/bracket_pair_check.cpp | #include<iostream>
#include<stack>
#include<string>
#include<map>
#include<unordered_map>
using namespace std;
unordered_map<char,int> symbols = {{'[',-1},{'{',-2},{'(',-3},{']',1},{'}',2},{')',3}}; //concept : if the bracket is opening bracket then it will have negative value and if it is closing bracket then it wil... | ALGO | 0.999959 | 6.087046 |
82d9beb6-6f66-4536-be73-062728a2cd5a | Megalilde/Delivery-Driver | Library/PackageCache/com.unity.ide.visualstudio@2.0.14/Editor/COMIntegration/COMIntegration~/COMIntegration.cpp | #include <iostream>
#include <sstream>
#include <string>
#include <filesystem>
#include <windows.h>
#include <shlwapi.h>
#include "BStrHolder.h"
#include "ComPtr.h"
#include "dte80a.tlh"
constexpr int RETRY_INTERVAL_MS = 150;
constexpr int TIMEOUT_MS = 10000;
// Often a DTE call made to Visual Studio can fail after ... | TOOL | 0.949674 | 6.969462 |
127064d3-dd77-41da-974e-0cfbbbc92160 | basavarajakj/CPP-DSA-learning | 01-basics/04_02-Patterns/Pattern-12.cpp | #include <iostream>
using namespace std;
int main()
{
int n, row = 1;
cin >> n;
while (row <= n)
{
int col = 1;
while (col <= n)
{
char ch = 'A' + row - 1;
cout << ch << " ";
col++;
}
cout << endl;
row++;
}
}
/*
A A A
B B B
C C C
*/ | ALGO | 0.999797 | 3.904664 |
bcabab5a-3867-4d35-8a25-e08485d5e364 | Robin329/CPlusPlusThings | practical_exercises/primer_cpp_5/ch12/exercise12_6.cpp | #include <iostream>
#include <vector>
using std::vector;
vector<int>* alloc_vector() {
return new vector<int>();
}
void assign_vector(vector<int>* p) {
int i;
while (std::cin >> i) {
p->push_back(i);
}
}
void print_vector(vector<int>* p) {
for (auto i : *p) {
std::cout << i << st... | ALGO | 0.974209 | 4.792968 |
f4b2c0f9-9fa7-4fc8-a225-86852cc5bcf5 | sheraz-n/DSASource | StackAI.cpp | #include <iostream>
#define MAX_SIZE 10
using namespace std;
class StackAI {
int A[MAX_SIZE];
int top;
public:
StackAI();
bool isEmpty ();
bool isFull ();
bool push (int key);
int pop ();
int getSize ();
// int top ();
void printStack();
};
StackAI:: StackAI () { top = -1;}
bool... | ALGO | 0.990017 | 4.387126 |
ef3ef7ec-b043-474b-8a0c-4490ae6030ad | ehnryx/acm | bad_code_from_long_ago/brasil2013/a.cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b, c;
cin >> a >> b >> c;
if ((a^b) == 0 && (b^c) == 0) cout << "*" << endl;
else if ((a^b) == 0) cout << "C" << endl;
else if ((b^c) == 0) cout << "A" << endl;
else cout << "B... | ALGO | 0.999983 | 4.753685 |
4743a1e3-54e7-46dd-a2e0-6a323be43bc8 | ishandutta2007/codeforces | avinashkartik/normal/817/E.cpp | #include<bits/stdc++.h>
using namespace std;
#define GODSPEED ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define f first
#define s second
#define newl cout<<"\n";
#define pb push_back
#define mset(a,x) memset(a,x... | ALGO | 0.999745 | 4.371078 |
648f9c2e-3d6e-4535-b6d5-0989637df637 | feilongjiang/CppPrimer | Ch 14/14.34.cpp | /* 定义一个函数对象类,令其执行if-then-else的操作*/
#include<iostream>
struct PrintMax
{
int operator()(bool check, int val1, int val2) const {
return check ? val1 : val2;
}
};
int main()
{
PrintMax pm;
bool b = true;
bool b1 = false;
int v1 = 1, v2 = -1;
// condition: true
auto ans = pm(b, v1, v2);
std::cout << ans << s... | ALGO | 0.989213 | 4.857746 |
c7367382-585c-4c6e-bfe0-4e8f00b41044 | ishandutta2007/codeforces | hollwoq_pelw/normal/1637/G.cpp | /*
// is short or still long ???
hollwo_pelw's template(short)
// Note : -Dhollwo_pelw_local
*/
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/trie_policy.hpp>
// #include <ext/rope>
using namespace std;
// using namespace __gnu_pbds;
// using namespace __gnu_cxx;
void FA... | ALGO | 0.999564 | 3.829155 |
026f5e8b-ab73-434d-8266-6f289c04f496 | Emmanuel-SR/utp-prog-juegos-cpp | Semana 1_3-1/07.cpp | /*
x^2 + 2x + 1 discriminante = 0, 2 soluciones
x^2 - 2x - 1 discriminante = 8, existen dos races y son simples.
x^2 + x + 1 discriminante = -3, no tiene soluciones reales
*/
#include <iostream>
#include <math.h>
using namespace std;
int main() {
double a, b, c, discriminante, x1 ,x2;
... | ALGO | 0.991988 | 3.628727 |
22fd32e7-9df4-4c88-b77f-6a05d324e327 | Re-bro/Algorithm-PS | BOJ/Graph/Shortest Path/[BOJ 3075] Astromeeting.cpp | #include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define sz(x) (int)x.size()
#define ini(x, y) memset(x, y, sizeof(x));
#define pb push_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = (int)1e9 + 7;
const in... | ALGO | 0.999973 | 3.832613 |
c6f8099b-7612-4b79-9971-6f7624ea90f0 | zebahmamooonn/hw5 | wordle.cpp | #ifndef RECCHECK
// For debugging
#include <iostream>
// For std::remove
//#include <algorithm>
#include <map>
#include <set>
#endif
#include "wordle.h"
#include "dict-eng.h"
using namespace std;
size_t countDashes(const std::string& s){
int count = 0;
for(char c : s){
if(c == '-') count ++;
}
return co... | ALGO | 0.966948 | 5.740992 |
7fca46bd-8817-4101-b05a-b6b6433183c8 | GabrielBejar/CCOMP2-2-2023-1-UCSP | semana_7/InvIterPtr.cpp | #include <iostream>
using namespace std;
void swaparr2(int* a, int* b){
int temp = *a;
*a = *b;
*b = temp;
}
void swaparr(int &pri, int &fin){
int temp = pri;
pri = fin;
fin = temp;
}
void invertirArr(int* arr, int tam) {
int* fin = arr + tam - 1;
while(arr < fin){
... | ALGO | 0.999928 | 4.847471 |
1adff0fe-ff07-4e56-9609-cc33c3f5bb61 | zxysnow/codeforces | codeforces#5/5C.cpp | #include <set>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <limits.h>
#include <string.h>
#include <string>
#include <algorithm>
#define MID(x,y) ( ( x + y ) >> 1 )
#define L(x) ( x << 1 )
#define R(x) ( x << 1... | ALGO | 0.999253 | 4.157478 |
a7de9d37-35c9-4da6-90fc-bb8d261d2ec2 | IvanIvanovv2002/Java-And-C-exercises | homework - 1/Task2.cpp | #include <iostream>
#include <cmath>
int main() {
double weight, height, classicBMI, oxfordBMI;
std::cin >> weight >> height;
if (std::cin.good() || height <= 0 || weight <= 0) {
classicBMI = weight / (pow(height, 2));
oxfordBMI = (1.3 * weight) / pow(height, 2.5);
}
else {
... | ALGO | 0.981181 | 4.16573 |
4a56c1e4-ecd9-4b12-9be2-57ff2650a063 | Josue-Chango/Repositorio | Semanas/Semana2/recursividad_directa.cpp | #include <iostream>
using namespace std;
int factorial(int n) {
// Caso base: factorial de 0 es 1
if (n == 0) {
return 1;
} else {
// Llamada recursiva para calcular el factorial
return n * factorial(n - 1);
}
}
| ALGO | 0.999722 | 5.919056 |
20d3ac20-02b2-4f93-8043-8a8a7feb6dff | ayushsharman/DSA-Practice | pair_sum.cpp | #include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
pair<int, int> findPair1(int arr[], int size, int targetSum)
{
unordered_map<int, int> numToIndex;
for (int i = 0; i < size; i++)
{
int complement = targetSum - arr[i];
if (numToIndex.find(complement) != numToIndex.end... | ALGO | 0.999872 | 6.086589 |
e118b313-c15d-4f02-b65d-47ef8f9d7347 | BioDepot/GDC_Genomic_Workflows | workflows/GDC_mRNA_multi_dr32_fpkm/widgets/GDC_mRNA_multi_dr32_fpkm/starAlign/Dockerfiles/STAR-2.6.0c/source/BAMbinSortByCoordinate.cpp | #include "BAMbinSortByCoordinate.h"
#include "ErrorWarning.h"
#include "serviceFuns.cpp"
#include "BAMfunctions.h"
void BAMbinSortByCoordinate(uint32 iBin, uint binN, uint binS, uint nThreads, string dirBAMsort, Parameters &P, Genome &mapGen) {
if (binS==0) return; //nothing to do for empty bins
//allocate ar... | DATA | 0.952948 | 4.895716 |
c2a617c6-6d31-4e03-8682-b121f8021a7a | namhn89/algorithm | spoj/VOJ_crawler/namnguyen123/MPRIME1[18029970][RESULT_AC][TIME_0.01][MEM_120768][2016-10-26_16-02-59].cpp | using namespace std;
#include<bits/stdc++.h>
#define st first
#define nd second
#define FOR(i,a,b) for(int i=(a),b_=(b);i<b_;++i)
#define FORD(i,a,b) for(int i=(a),b_=(b);i>=b_;--i)
#define FORE(i,a,b) for(int i=(a),b_=(b);i<=b_;++i)
#define TR(c, it) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); it++)
#defi... | ALGO | 0.999555 | 4.104567 |
f95226c4-d586-42de-82d4-df93b30d957a | sarvex/leetcode-q-sharp | lcp/LCP 18. 早餐组合/Solution.cpp | class Solution {
public:
int breakfastNumber(vector<int>& staple, vector<int>& drinks, int x) {
int res = 0, n = drinks.size();
sort(drinks.begin(), drinks.end());
for (int s : staple) {
int remain = x - s;
if (remain >= drinks[0]) {
int left = 0, righ... | ALGO | 0.999923 | 5.365626 |
74ac4a1d-351d-4323-a667-5df2de22b5fc | XintongEmilyWang/Algorithms | StockSeqParallel/StudentSolution.cpp | // -*- C++ -*-
/*
* StudentSolution.cpp
*
* HW 01, cilk version from the original stocks.sml at CMU
*
* THIS is the only file we will look at when we grade your homework.
* All other changes you made to any other files will be discarded.
*/
#include <cstdlib>
#include <cilk/cilk.h>
#include <iostream>
#include... | ALGO | 0.999873 | 5.66487 |
8903818b-5f76-46ed-a5c6-663efe96f394 | 130-SanaAsif/DSA-Practice | Searching and Sorting/insertion_sort.cpp | #include <iostream>
using namespace std;
void PrintArray(int A[], int n)
{
for (int i = 0; i < n; i++)
{
cout << A[i] << " ";
}
cout << endl;
}
void InsertionSort(int A[], int n)
{
int key, j;
for (int i = 1; i <= n - 1; i++)
{
key = A[i];
j = i - 1;
while (j ... | ALGO | 0.999974 | 4.449632 |
f21f804e-a00f-471b-9329-064023586381 | lechenyu/Arbalest-Vec | llvm/utils/TableGen/CTagsEmitter.cpp | #include "llvm/Support/SourceMgr.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <algorithm>
#include <string>
#include <vector>
using namespace llvm;
#define DEBUG_TYPE "ctags-emitter"
namespace {
class Tag {
private:
StringRef Id;
StringRef ... | TOOL | 0.896267 | 7.561523 |
6eaa76f2-b0f0-41b1-b2e0-9d6715b69f62 | mcknight99/CPSC2120 | Assignments/Word Ladder/personalWordLadder.cpp | #include <iostream>
#include <fstream>
#include <vector>
#include <unordered_map>
#include <queue>
#include <algorithm> //reverse()
using namespace std;
vector<string> V; // words from wordlist05.txt
unordered_map<string, vector<string>> adj; // Adjacency list for the graph
// Global variable... | ALGO | 0.999944 | 4.833734 |
b9c39294-27df-42b9-9751-bede50f15341 | kmjp/procon | leetcode/101-150/139/1072.cpp | typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) me... | ALGO | 0.999969 | 5.668031 |
6c89e853-6c4c-4d28-b933-94c16cf184bc | deepakasu67/leetcode | Old Leetcode/20. Valid Parentheses.cpp | #include<iostream>
#include<stack>
#include<string>
using namespace std;
class Solution {
public:
bool isValid(string s) {
stack<char> st;
for (int i = 0; i < s.length(); i++)
{
if (s[i] == ')' || s[i] == '}' || s[i] == ']')
{
if (st.empty())
... | ALGO | 0.997903 | 5.748146 |
59b5ff73-d65e-48d1-b336-f8c4d21adcb7 | tiger0132/code-backup | Codeforces/1000~1999/1248/D1.cpp | #include <algorithm>
#include <cstdio>
#include <cstring>
const int N = 5e2 + 25;
int n, x = 1, y = 1, ans;
char s[N];
int main() {
scanf("%d%s", &n, s + 1);
for (int i = 1; i < n; i++) {
for (int j = i; j <= n; j++) {
std::swap(s[i], s[j]);
int st = 0, c = 0, mn = 0;
for (int k = 1; k <= n; k++) {
s... | ALGO | 0.991602 | 3.923075 |
79447077-3ec9-4d3f-96aa-7ebb61a6cc36 | Nakib-Arman/CSE318---ArtificialIntelligence | 4.DecisionTree/.history/decision_tree_20250710033043.cpp | #include<bits/stdc++.h>
using namespace std;
class Node {
int column_num;
string label;
unordered_map<string,Node*> children;
Node* parent;
float threshold;
public:
Node(int column_num){
this->column_num = column_num;
this->parent = NULL;
this->label = "";
t... | ALGO | 0.99827 | 4.835662 |
a40853ce-8b46-401a-90c8-96dcbde58e0d | Muhaiminul-official/Pattern-Printing-Problems | ReRightHaPy.cpp | #include <iostream>
#include <string>
using namespace std;
int main()
{
int n = 5;
for (int i = n; i>0; i--)
{
for (int j = 1; j <= i; j++)
{
cout << "* ";
}
cout << endl;
}
return 0;
} | ALGO | 0.999558 | 3.873244 |
8fcef020-9d52-4f66-9e28-7f28433f9256 | cllrdr/repo | c++/sem1/lab03_v7/example.cpp | #include <iostream>
#include <string.h>
// Найдите сумму натуральных чисел, которые делятся на 5 и не делятся на m (m<n).
// Количество натуральных чисел n и значение m введите с клавиатуры.
int main() {
int start=0;
int stop=5;
while (start > stop) {
std::cout << start << std::endl;
}
... | ALGO | 0.998737 | 3.058186 |
cedb71ab-393c-4847-9d38-8c73e77ca52e | SakshamTapadia/LeetCode | 3396-valid-word/3396-valid-word.cpp | class Solution {
public:
bool isValid(string s) {
int n = s.length();
if (n < 3) return false;
int vowels = 0, consonants = 0;
string vowelList = "aeiouAEIOU";
for (char c : s) {
if (isalpha(c)) {
if (vowelList.find(c) != string::npos) {
... | ALGO | 0.998967 | 6.313227 |
fe5f5d95-5bcf-4207-bf18-0282f78cafc0 | evovch/Useful | VisuEngine/Test4/brep/cls_b_spline.cpp | #include "cls_b_spline.h"
// STD
#include <ctime>
// Project
#include "base/cls_logger.h"
#include "graphics/cls_model.h"
#include "brep/cls_cartesian_point.h"
#include "brep/cls_direction.h"
cls_b_spline::cls_b_spline() :
mOrder(0),
mNcontrolPoints(0),
mControlPoints(nullptr),
mWeights(nullptr),
mKnots(nullptr... | ALGO | 0.98937 | 5.257772 |
1bc372fd-16ea-49ef-bf6c-b6e6132709b0 | ElielLucas/Programming_Marathon | Grafos/1195.cpp | #include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
class node
{
public:
node();
int D;
node* left;
node* right;
node(int d);
static node* montaNode(int D);
};
node::node(int d)
{
D=d;
left=0;
right=0;
}
node* node::montaNode(int D)
{
node * saida = new... | ALGO | 0.999953 | 4.433075 |
4e09b175-83e5-442b-a2b5-e5fa34cbde5b | YubiYubi719/NYCU-Physical-Design-Automation | Lab3_Euler-Path-in-Standard-Cell/src/mos.cpp | #include "mos.h"
void Schematic::build(string filename){
ifstream input(filename);
string curLine;
while(getline(input,curLine)){
stringstream ss(curLine);
string s;
ss >> s;
if(s == ".ENDS") break;
if(s == ".SUBCKT") continue;
string name, drain, gate, sourc... | ALGO | 0.940285 | 3.473057 |
9bf7b5b0-e111-4759-8c34-3de137783650 | irosales36/Compiler-Language-Converter | Program4/testSemantics.cpp | /*
Ivan Rosales
CPSC 323
Program 3 Main
Visual Studio 2015 Community
Created 10-28-17
Edited 12-2-17
This is the main program for the semantics2 and optimzer header files. It takes in a file name
as a command line arguement and the calls the semantics2 header file to check the source code.
It then calls the optimizer ... | TOOL | 0.890042 | 4.396298 |
0e62b72a-f44c-43a8-a44c-0760d0083590 | ishandutta2007/codeforces | anton_lunyov/normal/67/D.cpp | #include <stdio.h>
#include <time.h>
#include <assert.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
typedef __int64 LL;
typedef unsign... | ALGO | 0.999411 | 3.387483 |
38fedf09-743c-4dde-8897-58939cd1e0e2 | TreeHacks-2025/Project-Neo | frontend/neo_flutter/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.997947 | 6.76775 |
e5e11eb5-7d32-44b2-a2bb-d38b58dcd924 | Project-Flexo/frameworks_av | media/libeffects/lvm/lib/Common/src/LVM_GetOmega.cpp | #include "LVM_Types.h"
#include "Filter.h"
#include "LVM_Macros.h"
/************************************************************************************/
/* */
/* Defines and Tables for 2*Pi/Fs ... | ALGO | 0.989586 | 4.967428 |
6d55798a-42e8-4721-bde1-f6f6c7042ad3 | Dener-Garcia/marlin-anet-a8Plus | buildroot/share/PlatformIO/variants/MARLIN_F103Rx/variant.cpp | #include "pins_arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
const PinName digitalPin[] = {
PA_0,
PA_1,
PA_2,
PA_3,
PA_4,
PA_5,
PA_6,
PA_7,
PA_8,
PA_9, // RXD
PA_10, // TXD
PA_11, // USB D-
PA_12, // USB D+
PA_13, // JTDI
PA_14, // JTCK
PA_15,
PB_0,
PB_1,
PB_2,
PB_3, // J... | CONFIG | 0.868652 | 3.818233 |
eb67e606-09af-4073-bd5c-9ca32734e059 | leonardoAnjos16/Competitive-Programming | UVa/best_coalitions.cpp | #include <bits/stdc++.h>
using namespace std;
const int MAX_N = 105;
const int MAX_P = 1e4 + 5;
const double INF = 1e9;
int n, x, P[MAX_N];
double memo[MAX_P][MAX_N];
int to_int(string input) {
string num = "";
for (int i = 0; i < (int) input.size(); i++)
if (input[i] != '.') num += input[i];
r... | ALGO | 0.993173 | 4.010908 |
c6919d49-4f87-4b44-b842-dfece2f18e6b | yaochong-cc/LeetCode- | 826安排工作已达到最大收益.cpp | ////
//// Created by Lenovo on 2024/5/17.
////
//#include <iostream>
//#include <vector>
//#include <algorithm>
//using namespace std;
//
//class Solution {
//public:
// int maxProfitAssignment(vector<int>& difficulty, vector<int>& profit, vector<int>& worker) {
// int n = difficulty.size();
// vector<... | ALGO | 0.999878 | 5.685985 |
8cffcf18-51fb-4796-b883-d849bb52c417 | 565353780/structured-3d | structured_td/Lib/PyMesh/third_party/cgal/AABB_tree/examples/AABB_tree/AABB_polyhedron_facet_distance_example.cpp |
// Author(s) : Pierre Alliez
#include <iostream>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/AABB_tree.h>
#include <CGAL/AABB_traits.h>
#include <CGAL/Polyhedron_3.h>
#include <CGAL/AABB_face_graph_triangle_primitive.h>
typedef CGAL::Simple_cartesian<double> K;
typedef K::FT FT;
typedef K::Point_3 Point;
type... | ALGO | 0.998878 | 6.812163 |
ee09d02c-9523-41d8-a6bc-cfb0d7c2eb3f | kjky12/AlgorithmStudy | AlgorithmStudy/1.Basic_100/Problem035.cpp | #include <stdio.h>
int main()
{
int n;
scanf("%x", &n); //ҹڷ 16 Է
printf("%o", n);
return 0;
}
| ALGO | 0.900965 | 4.054173 |
b6b21182-b82a-47a1-82dc-9a32f9f0e4f3 | tiehuis/euler | c/src/070.cpp | #include <algorithm>
#include <iostream>
#include <string>
#include <libnt/nt/ntf.hpp>
int main(void)
{
const int bound = 10000000;
std::vector<uint64_t> ts = nt::ntf::totient_sieve(bound);
float mv = 100;
int mi = 0;
for (int i = 2; i < bound; ++i) {
std::string s1 = std::to_string(i),
... | ALGO | 0.999739 | 5.595138 |
aba72f44-f564-42ee-9f6f-7936c1a7b6c6 | sarvex/leetcode-v | solution/1900-1999/1970.Last Day Where You Can Still Cross/Solution.cpp | class Solution {
public:
vector<int> p;
int dirs[4][2] = {{0, -1}, {0, 1}, {1, 0}, {-1, 0}};
int row, col;
int latestDayToCross(int row, int col, vector<vector<int>>& cells) {
int n = row * col;
this->row = row;
this->col = col;
p.resize(n + 2);
for (int i = 0; i... | ALGO | 0.999935 | 6.028176 |
2865540c-81f7-4ebd-a7f7-6f8ea1ecb263 | lucamaestrini/DMTWcode | DMTWpackage/src/StreamlinedMfvbLmmThreeLevelGaussPrior.cpp | #include <RcppArmadillo.h>
#include "SolveThreeLevelSparseMatrix.h"
using namespace Rcpp;
using namespace arma;
// Enable C++11 via this plugin (Rcpp 0.10.3 or later)
// [[Rcpp::plugins(cpp11)]]
// [[Rcpp::export]]
Rcpp::List StreamlinedMfvbLmmThreeLevelGaussPrior(const arma::field<arma::vec> yvecField,
... | ALGO | 0.999853 | 5.31239 |
c09345ee-dcdf-40dd-8d96-c3a7d69a78c5 | therightnee/Udacity-Self-Driving-Car-Nanodegree | Term2/T2P3_KidnappedVehicle/src/particle_filter.cpp | /*
* particle_filter.cpp
*
* Created on: Dec 12, 2016
* Author: Tiffany Huang
*/
#include <random>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include "particle_filter.h"
using namespace std;
// declare a random... | ALGO | 0.994707 | 5.142292 |
0da1cb34-d27c-4cbd-a37c-af16201dfa9a | naim1405/CSE-1200 | 13A_Way_Too_Long_Words.cpp | // https://codeforces.com/problemset/problem/71/A
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string s;
cin >> s;
int len = s.size();
if( len > 10){
cout << s[0] << len - 2 << s[len-1] << "\n";
}
else{
... | ALGO | 0.999772 | 4.57886 |
07dc6ea4-5dfe-4fdc-96ee-0139f1129a38 | Kennyarlexy/Competitive-Programming | CONTEST/CODEFORCES/Round_962/A.cpp | #include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int T; cin >> T;
for (int t = 1; t <= T; t++) {
int n; cin >> n;
int ans = n / 4 + (n % 4 != 0);
cout << ans << "\n";
... | ALGO | 0.999599 | 4.36069 |
6a6fd05c-5b9e-448a-94ab-cffb3191861f | TAMU-Robomasters/cv_main | repos/open_cv/3rdparty/openexr/Imath/ImathRandom.cpp | //-----------------------------------------------------------------------------
//
// Routines that generate pseudo-random numbers compatible
// with the standard erand48(), nrand48(), etc. functions.
//
//-----------------------------------------------------------------------------
#include "ImathRandom.h"
#include "... | ALGO | 0.995955 | 5.474166 |
00ff70f0-e49e-4c55-b420-9dd7be1e8af1 | Tima-a/CppGraphicsEngine | 3D Graphics C++/rendering.cpp | typedef unsigned int uint32;
static float render_scale = 0.001f;
static float gravity = -9.81f;
static float Gravitational_constant = 0.000000000016f;
float pi = 3.14f;
float d_pi = 6.28f;
const int MAX_STORAGE_SIZE = 5000;
//Pixel size presets
const float SUB_PIXEL_SIZE = 0.1f; // 1 coordinate unit equals one ten pixe... | TOOL | 0.970526 | 4.360682 |
c7f2f284-8e3c-42d2-b194-c853aaeae709 | Arun7389/life | 3372-longest-strictly-increasing-or-strictly-decreasing-subarray/3372-longest-strictly-increasing-or-strictly-decreasing-subarray.cpp | class Solution {
public:
int longestMonotonicSubarray(vector<int>& nums) {
if(nums.size()==1)
return 1;
int m1=1,m2=1,m=INT_MIN;
for(int i=0;i<nums.size()-1;i++)
{
if(nums[i]>nums[i+1])
{m1++;
m2=1;
m=max(m,m1);}
else if(nums[i]<nums[i+1])
{
m2++;
m1=1... | ALGO | 0.999838 | 5.910283 |
70f2de5d-9cd0-4442-af86-e075cea6ad77 | abubakaristiak/Contest | Codeforces/Round 995 (Div. 3)/A_Preparing_for_the_Olympiad.cpp | /*
* Bismillahir Rahmanir Raheem
*
* * * * Coder : abubakaristiak
* * * * Created : 2024-12-22 || 21:23:09
* * * * File : demo.cpp
*/
// https://codeforces.com/contest/2051/problem/A
#include<bits/stdc++.h>
#define ll long long
#define pi pair<ll, ll>
#define asort(v) sort(v.begin(), v.end())
#define rsort... | ALGO | 0.999855 | 5.006001 |
856547e8-70f6-4666-8a7a-80f5935ad152 | hoangkiet1906/C-- | Nhiphan.cpp | #include<stdio.h>
#include<conio.h>
main()
{
int a[10],n,i;
scanf("%d",&n);
for(i=0;n>0;i++)
{
a[i]=n%2;
n=n/2;
}
for(i=i-1;i>=0;i--)
{
printf("%d ",a[i]);
}
getch();
}
| ALGO | 0.999899 | 3.471116 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.