text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; const long long maxn = 100005; long long n, x[maxn], y[maxn]; bool flag; inline long long nxt(long long id) { return (id + 1) % n; } inline bool check(long long i, long long j) { return (x[i] + x[j] == x[nxt(i)] + x[nxt(j)]) && (y[i] + y[j] == y[n... |
#include <bits/stdc++.h> using namespace std; const int N = 1000 * 100 + 10; int n, d[N], par[N]; pair<int, int> tr[N * 4]; pair<long long, int> a[N], b[N]; void add(int val, int p, int b = 0, int e = n, int ind = 1) { tr[ind] = max(tr[ind], make_pair(val, p)); if (b + 1 == e) return; int mid = ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Mon Jan 23 19:11:23 MST 2017
// Date : Thu Oct 26 22:46:24 2017
// Host : Juice-Laptop running 64-bit major release ... |
module adv7513_reconfig (
input clock,
input [7:0] data_in,
input [7:0] clock_config_data,
input [1:0] colorspace_in,
output ADV7513Config adv7513Config,
output [7:0] clock_data_out,
output [1:0] colorspace_out,
output adv7513_reconf
);
`include "../config/adv_config.v"
reg [7:... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
`include "ctldefine.v"
`include "aluop_def.v"
`include "cmpop_def.v"
`include "muldivop_def.v"
`timescale 1ns/1ns
module ctl_id(input [31:0] instr,
output [1:0] NPCOp,
output [1:0] ExtOp,
output [2:0] CMPOp,
output CMPSrc,
output JType,
... |
#include <bits/stdc++.h> int cc[3000]; int good(int i) { return !(cc[i] == 0 && cc[i + 1] == 0 && cc[i + 2] == 1 && cc[i + 3] == 1) && !(cc[i] == 0 && cc[i + 1] == 1 && cc[i + 2] == 0 && cc[i + 3] == 1) && !(cc[i] == 1 && cc[i + 1] == 1 && cc[i + 2] == 1 && cc[i + 3] == 0) && !(... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> inline void chkmax(T& x, U y) { if (x < y) x = y; } template <typename T, typename U> inline void chkmin(T& x, U y) { if (y < x) x = y; } const int MAXN = 110000; int n, m, N; int xn; int ans[MAXN], c[MAXN], a[... |
///////////////////////////////////////////////////////////////////////////////
//mac_queue.v
// Derived from NetFPGA Project.
///////////////////////////////////////////////////////////////////////////////
module eth_queue
#(
parameter DATA_WIDTH = 64,
parameter CTRL_WIDTH=DATA_WIDTH/8,
parameter ENABLE_HEAD... |
module copro (
// GOP signals
input fastclk,
output reg [8:2] tp,
output reg [6:1] test,
// input [2:1] sw, // unused, commented out to avoid warnings
output fcs,
// Tube signals (use 16 out of 22 DIL pins)
input h_phi2, // 1,2,12,21,23 are global clocks
... |
#include <bits/stdc++.h> using namespace std; int a[10]; int main() { ios_base::sync_with_stdio(0); int n; cin >> n; string b; cin >> b; for (int i = 0; i < n; i++) { a[b[i] - 0 ] = 1; } bool flag = (((a[1] || a[2] || a[3]) && (a[0])) || ((a[1] || a[2] || a[... |
#include <bits/stdc++.h> int main() { int n, i, sum = 0; char str[51]; scanf( %s , &str); n = strlen(str); for (i = 0; i < n; i = i + 1) { if (str[i] == a ) { sum++; } } if (sum > n / 2) { printf( %d n , n); } else { printf( %d n , 2 * sum - 1); } ... |
#include <bits/stdc++.h> using namespace std; const int www = 9; const int Size = 10000; char buffer[Size]; int dr[] = {-1, 0, 1, 0}; int dc[] = {0, 1, 0, -1}; const int inf = 0x0fffffff; const int size = 52; long long dp[size][10]; int ar[size]; struct Point { int x, y, z; Point(int x = 0... |
//----------------------------------------------------------------------------
// TFT INTERFACE - Sub Level Module
//-----------------------------------------------------------------------------
//
// XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
// SOLELY FOR USE IN DEVELOPING PROGRAMS AND... |
// place this file in testBench folder
`timescale 1ns/100ps
`define DEBUG 1
`include "../define.v"
`include "../regfile.v"
`include "../pipeline_CPU.v"
`include "../hilo_reg.v"
`include "../BranchControl.v"
`include "../HazardControl.v"
`include "../ForwardControl.v"
`include "../IF.v"
`include "../IF_ID.v"
`include ".... |
// Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2017.3 (win64) Build Wed Oct 4 19:58:22 MDT 2017
// Date : Fri Nov 17 14:53:08 2017
// Host : egk-pc running 64-bit major release (build... |
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int T, n, a[N]; map<int, int> mp; int main() { cin >> T; while (T--) { double sum = 0; mp.clear(); cin >> n; for (int i = 0; i < n; ++i) { cin >> a[i]; sum += a[i]; } double mean =... |
//instruction memory block
module memory(input [31:0] A,output reg [31:0] RD);
reg [31:0]mem[0:31];
integer i;
initial begin
for(i=0;i<31;i=i+1)
mem[i]={32{1'b0}};
$readmemh("inst.txt",mem);
end
always@(A) begin
RD = mem[A[31:2]];
end
endmodule
/*
module rominfr (clk, en, addr, data);
inp... |
// -*- verilog -*-
//
// USRP - Universal Software Radio Peripheral
//
// Copyright (C) 2003 Matt Ettus
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k; char c; unsigned int mask; int u; vector<unsigned int> ip; set<unsigned int> net; cin >> n >> k; scanf( %c , &c); unsigned int x, x1; for (int i = 0; i < n; i++) { c = 0; x = 0; x1 = 0; ... |
module TOP(CLK, RSTN, UP_ENABLE, UP_ENABLE2, CLEAR);
input CLK,RSTN,UP_ENABLE,UP_ENABLE2,CLEAR;
reg [2:0] up_cnt;
wire is_cnt_four = up_cnt == 4;
always @(posedge CLK or negedge RSTN) begin
if(!RSTN) begin
up_cnt <= 0;
end else if(up_cnt >= 3'd5) begin
up_cnt <= 0;
end else if(CLEAR) b... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { string st; cin >> st; for (int i = 0; i < st.size(); i++) { if (st[i] == 0 || st[i] == 8 ) { cout << YES n ; cout << st[i] << endl; return 0; } for (int j = i + 1; j < st.size(); j++) { int n... |
// =======================================================================
// Filename: alu_test.v
// Created by: Tareque Ahmad
// Date: April 11, 2015
//
// Description: Test module for simple_alu dut
// =======================================================================
`timescale ... |
// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2015.3
// Copyright (C) 2015 Xilinx Inc. All rights reserved.
//
// ==============================================================
`timescale 1 ns / 1 ps
mod... |
#include <bits/stdc++.h> using namespace std; template <typename T> void display(T a[], int size) { for (int i = 0; i < size; i++) { cout << a[i] << ; } cout << endl; } void display(vector<pair<int, int> > a) { for (int i = 0; i < a.size(); i++) { cout << ( << a[i].first << ,... |
//date:2016/3/13
//engineer:ZhaiShaoMin
//module name:pipeline registers between ex and mem
module core_ex_mem(//input
clk,
rst,
branch,
mem_read,
mem_write,
ll_mem,
... |
#include <bits/stdc++.h> using namespace std; const int N = 100005 * 2; struct SegmentTree { int l, r; int sum, lmx, rmn, ansl, ansr, ans, Ans; } t[N << 2]; int s[N]; char ss[N]; void merge(int p) { t[p].sum = t[p * 2].sum + t[p * 2 + 1].sum; t[p].lmx = max(t[p * 2].lmx, t[p * 2].sum + t[p... |
#include <bits/stdc++.h> using namespace std; const int MOD = 998244353; int add(int x, int y) { x += y; while (x >= MOD) x -= MOD; while (x < 0) x += MOD; return x; } int mul(int x, int y) { return (x * 1ll * y) % MOD; } int power(int n, int m, int p) { int res = 1; while (m > 0) { ... |
#include <bits/stdc++.h> using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long t; cin >> t; while (t--) { long long n, k; cin >> n >> k; string s; cin >> s; bool ans = true; for (long long i = 0; i... |
#include <bits/stdc++.h> using namespace std; int dx[4] = {0, 0, 1, -1}; int dy[4] = {-1, 1, 0, 0}; int lredge[600][599]; //n, m-1 int tdedge[599][600]; //n-1, m int n, m, k; int distance(int i1, int j1, int i2, int j2){ //next cell is above if(i1 > i2){ return tdedge[i2][j1]; } /... |
#include <bits/stdc++.h> using namespace std; const int N = 200200; struct BIT { int a[N]; void add(int x, int v = 1) { for (; x < N; x += x & -x) { a[x] += v; } } int kth(int k) { int x = 0; for (int i = 18; i >= 0; i--) { if (x + (1 << i) < N) { ... |
#include <bits/stdc++.h> using namespace std; const int N = 100010; const int MX = 123456; const int mod = (int)1e9 + 7; const int base = 1023456789; const unsigned long long BS1 = 10000019ULL; const int INF = (1 << 29); template <class T> inline void fastScan(T &x) { register char c = getchar(); ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 10001; long long a[MAXN]; int f[MAXN]; long long c[MAXN], b[MAXN]; int n; int main() { cin >> n; for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < n; ++i) { long long X = a[i], cnt = 0; while (!(X & 1)) { ... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (n > 6 + 10 + 14) { if (n - (6 + 10 + 14) != 6 && n - (6 + 10 + 14) != 10 && n - (6 + 10 + 14) != 14) { cout << YES << endl; cout << 6... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: stb_ovfl_mon.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it and/... |
`timescale 1ps / 1ps
module XADC_REG_test (
);
reg DCLK = 1'b0;
reg RESET;
wire [3:0] VAUXP;
wire [3:0] VAUXN; // Auxiliary analog channel inputs
wire VP;
wire VN; // Dedicated and Hardwired Analog Input Pair
wire [15:0] MEASURED_TEMP;
wire [15:0] MEASURED_VCCINT;
wire [15:0] MEASURED_VCCAUX;
wire [15:0] ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int nextInt() { int x; scanf( %d , &x); return x; } const int MAX_N = 1e5 + 100; int arr[MAX_N]; int main() { int n = nextInt(); for (int i = 0; i < n; ++i) arr[i] = nextInt(); sort(arr, arr + n); for (int i = 1; i < n; ++i) { i... |
#include <bits/stdc++.h> using namespace std; int n, m, sx, sy, dx, dy; string s[1022]; bool vis[1002][1002][5][5]; bool f(int i, int j, int dir, int steps) { if (i < 0 || j < 0 || i == n || j == m || steps > 2 || s[i][j] == * || (dir != -1 && vis[i][j][dir][steps])) return false; if (... |
#include <bits/stdc++.h> int value(const std::vector<int>& xs, int base, int i) { return (xs[(base + i) % xs.size()] + 10 - xs[base]) % 10; } bool lt(const std::vector<int>& xs, int a, int b) { int N = xs.size(); for (int i = 0; i < N; ++i) { int va = value(xs, a, i), vb = value(xs, b, i); ... |
#include <bits/stdc++.h> using namespace std; long long INF = (1e15); int a[110]; int main() { int n, x, y; scanf( %d%d%d , &n, &x, &y); for (int i = 1; i <= n; i++) scanf( %d , &a[i]); if (x > y) { printf( %d n , n); } else { int ans = 0; for (int i = 1; i <= n; i++) { ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//////////////////////////////////////////////////////////////////////////////////
// CRC_parallel_m_lfs_XOR.v for Cosmos OpenSSD
// Copyright (c) 2015 Hanyang University ENC Lab.
// Contributed by Jinwoo Jeong <>
// Ilyong Jung <>
// Yong Ho Song <>
//
// This file is part of Cosmos OpenS... |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf( %d , &n); vector<long long> a(n); for (long long &i : a) cin >> i; cout << *max_element(a.begin(), a.end()) << endl; return 0; } |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
// Also check that SystemC is ordering properly
// verilator lint_on IMPERFECTSCH
module t (/*AUTOARG*/
// Outputs
o1, o8, o16, o32, o64, o65, o128, o513... |
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: sparc_ifu_imd.v
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it and... |
#include <bits/stdc++.h> using namespace std; int main() { int n, i; cin >> n; int a[n + 1]; a[0] = 0; for (i = 1; i <= n; i++) { cin >> a[i]; } if (n == 2) { cout << NO ; return 0; } for (i = 1; i <= n; i++) { int x; x = a[i]; x = a[x]; ... |
#include <bits/stdc++.h> using namespace std; int n, t; int ult, casas; string s; int solve(int k) { int u = -1; int acc = k; for (int i = 0; i < n; i++) if (s[i] == S ) { acc++; if (acc >= casas) { u = i; break; } } if (u == -1) return ... |
#include <bits/stdc++.h> using namespace std; long long t, n, a[205], b, c[205]; int main() { std::ios_base::sync_with_stdio(false); cin.tie(0); string s; cin >> t; while (t--) { cin >> n >> b; for (int i = 0; i < n; i++) { cin >> a[i]; c[a[i]] = 1; } fo... |
#include <bits/stdc++.h> using namespace std; int main() { int n, k = 0; cin >> n; int a[n]; for (int i = 0; i < n; i++) cin >> a[i]; int count = 0; for (int i = 0; i < n; i++) { if (a[i] == 1) { count++; } } cout << count << endl; for (int i = 1; i < n; i++) ... |
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; const int MAX = 103; long long dp[MAX][MAX][MAX]; long long tmp[MAX][MAX]; long long ncr[MAX][MAX]; long long res[MAX]; int sub[MAX]; vector<int> adj[MAX]; int modulo(int a, int b, int c) { long long res = 1; for (int i =... |
#include <bits/stdc++.h> using namespace std; vector<pair<long long, long long> > v; bool cmp(pair<long long, long long> a, pair<long long, long long> b) { if (a.first == b.first) a.second < b.second; return a.first > b.first; } int main() { long long t, n, arr[200005], brr[200005], i; cin >> ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// This file has been automatically generated by goFB and should not be edited by hand
// Compiler written by Hammond Pearce and available at github.com/kiwih/goFB
// Verilog support is EXPERIMENTAL ONLY
// This file represents the Composite Function Block for InjectorController
module FB_InjectorController
(
inp... |
#include <bits/stdc++.h> using namespace std; long long dp[200005][2]; long long a[200005], b[200005]; void solve() { long long n, c; cin >> n >> c; for (int i = 0; i < n - 1; i++) cin >> a[i]; ; for (int i = 0; i < n - 1; i++) cin >> b[i]; ; dp[1][1] = c; for (int i = 2; i < n +... |
#include <bits/stdc++.h> char s[2000005]; int sign[2000005], o[2000005], n, m, L; int main() { scanf( %s , s), n = strlen(s), m = 0; for (int i = 0; i < n; i++) { int x = s[n - 1 - i] - 48; if (x) { if (m == 1) o[L++] = i - 1; m += m < 2; } else if (m == 1) sign[L... |
#include <bits/stdc++.h> using namespace std; int query(int a, int b) { cout << ? << a << << b << endl; fflush(stdout); int tmp; cin >> tmp; return tmp; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int flag = query(0, 0); int a = ... |
#include <bits/stdc++.h> using namespace std; long long a[101]; long long vis[101]; long long judge(vector<long long> A) { if (A.empty()) return 0; for (long long i = 0; i < A.size(); i++) { if (A[i] != i) return i; } return A.size(); } signed main() { long long t; cin >> t; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
//Template Made By: Ojassvi Kumar #include<bits/stdc++.h> using namespace std; #define ios ios_base::sync_with_stdio(false);cin.tie(NULL); #define ll long long int #define fo(i,a,b) for(long long int i=a; i<b; i++) #define endl n #define max3(a,b,c) max(max((a),(b)),(c)) #define max4(a,b,c,d) max... |
#include <bits/stdc++.h> using namespace std; const int maxn = 100005; struct node { int id, next; node() {} node(int a, int b) { id = a; next = b; } }; struct Brige { int x, y; } brige[maxn]; vector<int> v[maxn], g[maxn]; vector<node> q[maxn]; int dfn[maxn], low[maxn];... |
#include <bits/stdc++.h> using namespace std; int main() { string str1, str2; cin >> str1 >> str2; int siz = str1.size(); siz--; while (siz > -1) { if (str1[siz] == z ) { str1[siz] = a ; siz--; } else { str1[siz]++; break; } } if (siz =... |
#include <bits/stdc++.h> using namespace std; const int INF = (int)1e8; const int N = 500; int n; int ans; int a[N]; set<int> p; int m; int b[N][2]; struct Edge { int to, cap, flow; Edge() : to(), cap(), flow() {} Edge(int _to, int _cap) : to(_to), cap(_cap), flow(0) {} }; int sz; ... |
/*
*
* Copyright (c) 2013
*
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the ... |
#include <bits/stdc++.h> using namespace std; int main() { std::ios::sync_with_stdio(false); int T; cin >> T; while (T--) { long long int n; string second; cin >> n; cin >> second; vector<char> v, v1; int first = 0; int f1 = 0; int f2 = 0; for (i... |
#include <bits/stdc++.h> using namespace std; template <class T> inline T sqr(T x) { return x * x; } const double EPS = 1e-6; const int INF = 0x3fffffff; const long long LINF = INF * 1ll * INF; const double PI = acos(-1.0); using namespace std; bool vis[205][205]; int main(void) { int a, b... |
/****************************************************************************
Register File
- Has two read ports (a and b) and one write port (c)
- sel chooses the register to be read/written
****************************************************************************/
module reg_file_spree(clk,r... |
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; while (t--) { long long n; cin >> n; long long sum = 0; long long x = 0; while (n--) { long long s; cin >> s; sum += s; x ^= s; } cout << 2 << n ;... |
#include <bits/stdc++.h> using namespace std; long long int pwr(long long int base, long long int p, long long int mod) { long long int ans = 1; while (p) { if (p & 1) ans = (ans * base) % mod; base = (base * base) % mod; p /= 2; } return ans; } long long int gcd(long long int ... |
#include <bits/stdc++.h> using namespace std; string s[] = { ABSINTH , BEER , BRANDY , CHAMPAGNE , GIN , RUM , SAKE , TEQUILA , VODKA , WHISKEY , WINE }; int main() { int n; scanf( %d , &n); string ss; int sol = 0; for (int i = 0; i < n; i++) { cin >> s... |
/* python3 ../../CompetitionHelpers/run_codeforces.py --problem A --test 0 g++ -ggdb -fsanitize=address -std=c++17 A.cpp && ./a.out <<< 1 4 0 3 5 6 */ #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i < (b); i++) #define trav(a, x) for (auto& a : x) #define... |
#include <bits/stdc++.h> char s1[100100], s2[100100], s3[100100]; bool dist[100100]; int pos[100100]; int main() { int n, t, i; int num = 0, po = 0; memset(dist, false, sizeof(dist)); scanf( %d%d , &n, &t); scanf( %s%s , s1, s2); for (i = 0; i < n; i++) s3[i] = 1 ; for (i = 0; i < n... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1e6 + 3; const int INF = 1e9; const int MOD = 1e9 + 7; int main() { long long n; long long ans = 1; cin >> n; long long p = 2; while (n > 1 && p * p <= n) { if (n % p) p++; else { n /= p; if ... |
/* ********************************************************************************************* */
/* * SHA-256 Manager * */
/* * Authors: * */
/* * André Bannw... |
//
// Copyright (c) 2014 Colin Rothwell
// Copyright (c) 2014 A. Theodore Markettos
// All rights reserved.
//
// This software was developed by SRI International and the University of
// Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
// ("CTSRD"), as part of the DARPA CRASH research programme... |
#include <bits/stdc++.h> using namespace std; int main() { string x; int i; cin >> x; for (i = 0; x[i]; i++) { if (i == 0 && x[i] == 57) x[i] = x[i]; else if (x[i] >= 53) x[i] = (57 - x[i]) + 48; cout << x[i]; } return 0; } |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
module radio_bridge
(
converter_clock_in,
converter_clock_out,
radio_DAC_I,
radio_DAC_Q,
radio_ADC_I,
radio_ADC_Q,
user_DAC_I,
user_DAC_Q,
user_ADC_I,
user_ADC_Q,
user_RF_gain,
user_BB_gain,
radio_RF_gain,
radio_BB_gain,
controller_spi_clk,
controller_spi_data,
controller_radio_cs,
controll... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
/*
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2013 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk
);
input clk;
integer cyc=0;
reg [63:0] crc;
reg [63:0] sum;
// Take CRC data and apply to test... |
/*******************************************************************************
* This file is owned and controlled by Xilinx and must be used solely *
* for design, simulation, implementation and creation of design files *
* limited to Xilinx devices or technologies. Use with non-Xilinx ... |
#include <bits/stdc++.h> using namespace std; int main() { vector<string> v; for (int i = 0; i < 3; i++) { string s; cin >> s; v.push_back(s); } vector<string> so; vector<string> po; vector<string> mo; for (int i = 0; i < v.size(); i++) { if (v[i][1] == s ) ... |
(* abc9_box, lib_whitebox *)
module \$__ICE40_CARRY_WRAPPER (
(* abc9_carry *)
output CO,
output O,
input A, B,
(* abc9_carry *)
input CI,
input I0, I3
);
parameter LUT = 0;
parameter I3_IS_CI = 0;
wire I3_OR_CI = I3_IS_CI ? CI : I3;
SB_CARRY carry (
.I0(A),
.I1(B),
.CI(CI),
.CO(CO)
);
SB_LUT4 #(
... |
`timescale 1ns / 1ps
/*
-- Module Name: West First Minimal
-- Description: Algoritmo parcialmente adaptativo para el calculo de
de ruta en NoCs con topologia Mesh.
El algoritmo esta basado en el "Turn Model". Se puede
encontrar mas informacion en:
The turn model for adaptive routing
Christop... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 02:39:57 10/12/2010
// Design Name:
// Module Name: trigger_divider
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies... |
#include <bits/stdc++.h> using namespace std; const int N = 1001; int i, j, n, ans; int a[N], f[N][300], d[20], sum[N][10]; void init() { d[1] = 1; for (i = 2; i <= 9; i++) d[i] = d[i - 1] * 2; scanf( %d , &n); for (i = 1; i <= n; i++) scanf( %d , &a[i]); for (i = 1; i <= n; i++) { f... |
#include <bits/stdc++.h> using namespace std; template <class T> inline void read(T &x) { x = 0; char c = getchar(); bool f = 0; for (; !isdigit(c); c = getchar()) f ^= c == - ; for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48); x = f ? -x : x; } int n, x, len, res,... |
#include <bits/stdc++.h> using namespace std; const long long INF = 1e9 + 7; const int N = 2e5 + 10; int a[N]; int main() { string str; string s; while (cin >> s) str += s; for (auto& c : str) { if (c == < ) c = ; if (c == > ) c = ; } vector<string> vs; vector<i... |
#include <bits/stdc++.h> using namespace std; int n, m, q, ans, top[200005 << 1]; int find(int u) { if (top[u] == u) return u; return top[u] = find(top[u]); } inline void work() { scanf( %d %d %d , &n, &m, &q); for (int i = 1; i <= n + m; i++) top[i] = i; for (int i = 1, u, v; i <= q; i++)... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; void debugv(std::vector<long long> v); void printv(std::vector<long long> v); void inputv(std::vector<long long> &v); void solve() { long long n; cin >> n; string s; cin >> s; unordered_map<string, long long> mp; for (long long i = 0; i < n... |
/*-- ILSH --*/ #include bits/stdc++.h using namespace std; typedef long long ll; typedef double ld; #define pb push_back #define pop pop_back #define mp make_pair #define vii vector < ll > #define dt cout<< HERE n ; #define pii pair < ll , ll > #define vpi vector < pii > #define fi first #... |
#include <bits/stdc++.h> using namespace std; vector<int> a; vector<vector<int>> graph; vector<vector<int>> residual; set<int> primes; map<pair<int, int>, int> factors; void sieve(int SQRTN) { vector<int> isPrime(SQRTN, 1); for (int i = 2; i < SQRTN; i++) { if (!isPrime[i]) continue; p... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: California State University San Bernardino
// Engineer: Bogdan Kravtsov
//
// Create Date: 13:58:06 10/03/2016
// Module Name: I_FETCH_tb
// Project Name: MIPS
// Description: Testing MIPS F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.