text
stringlengths
59
71.4k
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) using namespace std; const long double eps = 1e-7; const int inf = 1000000010; const long long INF = 10000000000010LL; const int mod = 1000000007; const int MAXN = 100010; int n, m, u, v, x, y, t, a, b, ans, node, cnt; bool ok[MAXN]; bool mark[M...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int a, b, n, s; cin >> a >> b >> n >> s; if ((min(s / n, a) * n + b) >= s) { cout << YES << endl; } else { cout << NO << endl; } } 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...
#include <bits/stdc++.h> using namespace std; long long a[1000010]; int main() { int n; scanf( %d , &n); long long sum = 0; for (int i = 1; i <= n; ++i) { scanf( %lld , &a[i]); sum += a[i]; } if (sum <= 1) { printf( -1 n ); return 0; } long long ans = 999999...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2015 by Johan Bjork. interface intf; logic logic_in_intf; modport source(output logic_in_intf); modport sink(input logic_in_intf); endinterface module modify_interface ( ...
/* * 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...
//----------------------------------------------------------------------------- // // (c) Copyright 2009-2010 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property...
module simf_tb; //wires reg clk; reg rst; reg issue_alu_select, exec_rd_scc_value, rfa_queue_entry_serviced; reg [5:0] issue_wfid; reg [11:0] issue_source_reg1, issue_source_reg2, issue_source_reg3, issue_dest_reg1, issue_dest_reg2; reg [15:0] issue_imm_value0; reg [31:0] issue_imm_value1,...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Case Western Reserve University // Engineer: Matt McConnell // // Create Date: 23:43:00 02/04/2017 // Project Name: EECS301 Digital Design // Design Name: Lab #3 Project // Module Name: ...
#include <bits/stdc++.h> using namespace std; int main() { long long int n; string s; cin >> n; cin >> s; map<char, long long int> M; long long int i; for (i = 0; i < n; i++) { M[s[i]]++; } long long int z = n / 3; if (M[ 0 ] < z) { for (i = 0; i < n; i++) { ...
#include <bits/stdc++.h> int aa[100005]; int main(void) { int n; while (~scanf( %d , &n)) { for (int i = 0; i < n; i++) { scanf( %d , &aa[i]); } for (int i = 0; i < n - 1; i++) { printf( %d , aa[i] + aa[i + 1]); } printf( %d n , aa[n - 1]); } }
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: Case Western Reserve University // Engineer: Matt McConnell // // Create Date: 14:48:00 09/10/2017 // Project Name: EECS301 Digital Design // Design Name: Lab #3 Project // Module Name...
#include <bits/stdc++.h> using namespace std; using lint = long long; using pi = pair<lint, lint>; const int MAXN = 100005; int n, m, sum; int cnt[MAXN]; set<int> s[MAXN]; int p[MAXN]; vector<tuple<int, int, int>> dap; void MOVE(int dst, int src, int v) { vector<int> mutation; for (auto &i :...
// -- (c) Copyright 2009 - 2011 Xilinx, Inc. All rights reserved. // -- // -- This file contains confidential and proprietary information // -- of Xilinx, Inc. and is protected under U.S. and // -- international copyright and other intellectual property // -- laws. // -- // -- DISCLAIMER // -- This disclaimer is not a...
// megafunction wizard: %ROM: 1-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: four_new2.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // ==============================...
#include <bits/stdc++.h> using namespace std; int main() { int a, b, t, i; cin >> t; for (i = 0; i < t; i++) { cin >> a >> b; cout << a + b; cout << endl; } 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...
#include <bits/stdc++.h> using namespace std; const pair<int, int> MOD = make_pair(1e9 + 7, 1e9 + 9); const int base = 1e6 + 3; const int N = 1e5 + 100, B = 600; pair<int, int> operator+(pair<int, int> a, pair<int, int> b) { return make_pair((a.first + b.first) % MOD.first, (a.second ...
/* * 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...
// file: testclk_tb.v // // (c) Copyright 2008 - 2011 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a...
/** * 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 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; long long power(long long a, long long b) { if (b == 0) return 1; if (b % 2 == 0) return power(a * a % 1000000007, b / 2); return a * power(a, b - 1) % 1000000007; } long long gcd(long long a, long long b) { if (a == 0) return b; return gcd(b % a...
/* * 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...
// Accellera Standard V2.3 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2008. All rights reserved. `ifdef OVL_ASSERT_ON wire xzcheck_enable; `ifdef OVL_XCHECK_OFF assign xzcheck_enable = 1'b0; `else `ifdef OVL_IMPLICIT_XCHECK_OFF assign xzcheck_enable = 1'b0; `else assign xzcheck...
/** * 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 (c) 1999 Stephen Williams () // // This source code is free software; you can redistribute it // and/or modify it in source code form under the terms of the GNU // General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your option) // ...
`include "defines.v" `include "nodeRouter.v" `timescale 1ns/1ps /* input `control_w port0_ci, input `control_w port1_ci, input `control_w portl0_ci, input `control_w portl1_ci, output portl0_ack, output portl1_ack, input ...
#include <bits/stdc++.h> using namespace std; int n, k, m; int nt, kt, mt; int su[100004]; long long sum = 0; double res; int main() { scanf( %d%d%d , &n, &k, &m); nt = n; kt = k; mt = m; for (int i = 0; i < n; i++) { scanf( %d , su + i); sum += su[i]; } res = 1.0 *...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; vector<vector<int>> a(n, vector<int>(m)), n_s(1001, vector<int>(1001)), n_c(1001, vector<int>(1001)); vector<int> m_s(1001), m_c(1001); for (int i = 0; i < n; ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 20:20:54 03/02/2016 // Design Name: // Module Name: alu // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencie...
/* Copyright 2010 David Fritz, Brian Gordon, Wira Mulia 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. ...
/////////////////////////////////////////////////////////////////////////////// // // Module: sec_monitor.v // Project: ngnp // Description: compares currently executed instruction address to monitoring graph contents // /////////////////////////////////////////////////////////////////////////////// `timescale ...
/* * 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...
#include <bits/stdc++.h> using namespace std; const long long INF = 2e9 + 10, MAX = 2100, MOD = 1e9 + 7, MAXL = 25; void OUT(long double o, int x) { cout << fixed << setprecision(x) << o; return; } long long dp[MAX][MAX], ra[MAX], a[MAX], re[200000], w[MAX]; vector<int> v[MAX]; pair<long long, lon...
// ========== Copyright Header Begin ========================================== // // OpenSPARC T1 Processor File: bw_io_ddr_rptr_vddcom.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 redistribut...
// (C) 1992-2014 Altera Corporation. All rights reserved. // Your use of Altera Corporation's design tools, logic functions and other // software and tools, and its AMPP partner logic functions, and any output // files any of the foregoing (including device programming or simulati...
#include <bits/stdc++.h> using namespace std; struct node { long long x, y; } A[100005]; int pos1[100005], pos2[100005], pos3[100005], pos4[100005]; int cmp1(int a, int b) { return A[a].x < A[b].x; } int cmp2(int a, int b) { return A[a].x > A[b].x; } int cmp3(int a, int b) { return A[a].y < A[b].y; } ...
#include <bits/stdc++.h> using namespace std; const int MAX = 1e6 + 5; long long v[MAX]; long long GCD(long long a, long long b) { if (!b) return a; if (!a) return b; return GCD(b, a % b); } int main() { long long mx = 0; long long n; cin >> n; for (int i = 1; i <= n; i++) { ...
#include <bits/stdc++.h> using namespace std; int n, m, row, column; int a[5005]; int cnt[1005]; int main() { int i, j, k, l; int x, y; int tc, t; int res = 0; scanf( %d , &n); for (i = 1; i <= n; i++) { scanf( %d , &a[i]); cnt[a[i]]++; } j = *(max_element(cnt, cnt ...
#include <bits/stdc++.h> using namespace std; using vi = vector<long long int>; using vvi = vector<vi>; using vb = vector<bool>; using vc = vector<char>; using vs = vector<string>; using vld = vector<long double>; using pii = pair<long long int, long long int>; using psi = pair<string, long long int>;...
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 10; const long long mo = 1e9 + 7; const long long inf = 1e9; const long long Inf = 1e18; long long w[N], a[N]; int x[N], y[N]; int main() { int n, m, k; scanf( %d%d%d , &n, &k, &m); for (int i = (1); i <= (n); ++i) scanf( %lld...
/* * 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...
/** * bsg_id_pool.v * * This module maintains of a pool of IDs, and supports allocation and deallocation of these IDs. * */ `include "bsg_defines.v" module bsg_id_pool #(parameter `BSG_INV_PARAM(els_p) , parameter id_width_lp=`BSG_SAFE_CLOG2(els_p) ) ( input clk_i, input reset_i /...
#include <bits/stdc++.h> using namespace std; using namespace chrono; const long long int MOD = 1000000007; const long long int MAXN = 100005; long long int k, dp[MAXN]; long long int recurse(long long int n) { if (n == 0) return 1; if (dp[n] != -1) return dp[n]; long long int ans = 0; if (n...
/***************************************************************************** * File : processing_system7_bfm_v2_0_5_gen_clock.v * * Date : 2012-11 * * Description : Module that generates FCLK clocks and internal clock for Zynq BFM. * ****************************************************************************...
/* SPDX-License-Identifier: MIT */ /* (c) Copyright 2018 David M. Koltak, all rights reserved. */ /* * rcn transaction asynchronous fifo. * */ module rcn_fifo_async ( input rst_in, input clk_in, input clk_out, input [68:0] rcn_in, input push, output full, output [68:0] rcn_out, in...
#include <iostream> #include <vector> #include <cstring> #include <algorithm> #include <cassert> #include <deque> #include <map> #include <queue> #include <climits> #include <set> #include <stack> #include <cmath> #include <array> #include <unordered_map> #include <unordered_set> using ...
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (i % 2 == 1) { cout << # ; } else { if ((i / 2) % 2 == 0) { if (j == 1) { cout << # ;...
#include <bits/stdc++.h> using namespace std; struct Node { int l, r; pair<int, int> v; int mid() { return (l + r) >> 1; } }; struct HNode { int m, p; long long x, y, r, d; bool operator<(const HNode &cur) const { return d < cur.d; } }; Node tree[4 * 250005]; HNode hook[250005]; ...
#include <bits/stdc++.h> using namespace std; const int N = 1005; int n, m, q, a[N][N], op, x, y, R[N][N], L[N][N], U[N][N], D[N][N]; void update() { if (a[x][y]) { a[x][y] = 0; D[x][y] = U[x][y] = R[x][y] = L[x][y] = 0; for (int i = x - 1; i >= 1 && a[i][y]; --i) D[i][y] = x - i; fo...
/** * 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() { ios::sync_with_stdio(false); int n; cin >> n; set<int> v; int a; for (int i = 0; i < n; ++i) { cin >> a; v.insert(a); } v.erase(0); cout << v.size(); 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...
#include <bits/stdc++.h> using namespace std; long long mod = (long long)1000000007; int M, K; int par[100000 + 5]; vector<int> adj[100000 + 5]; long long dp[100000 + 5][11][3]; struct bin_tree_type { int le; int ri; }; bin_tree_type tree[100000 + 5]; long long exp(long long ret, int pow) { ...
/* == HW1 P11 & P12 == */ /* 11: Develope a small set of test patterns that will (1) test a half-adder * circuit, (2) test a full-adder circuit, (3) exahausively test a 4-bit ripple * carry adder, and (4) test a 16 bit ripple carry adder by verifying that the * conectivity between the 4-bit slices are connected cor...
#include <bits/stdc++.h> using namespace std; map<int, long long> mp; const int maxn = 1e6 + 10; char str[maxn]; int num[30]; int main() { int n; scanf( %d , &n); while (n--) { scanf( %s , str); memset(num, 0, sizeof num); int len = strlen(str); for (int i = 0; i < len; 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...
// This is a 4 to 1 mux that inputs from the 4 cpus and outputs to the monitors // Author: Kekai Hu. Mar 1, 2013 module mux_41( input [1:0] sel, input [3:0] four_bit_hash_0, input new_inst_signal_0, input processor_reset_seq_0, input sp_pkt_done_0, input s...
/* * Milkymist VJ SoC * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq * * 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, version 3 of the License. * * This program is distri...
#include <bits/stdc++.h> using namespace std; using ll = long long int; using ld = long double; using vi = vector<int>; using vll = vector<ll>; using vd = vector<double>; using vvi = vector<vi>; int ctoi(char c) { return c - 0 ; } int slen(string s) { return s.length(); } int vsize(vi a) { return (...
#include <bits/stdc++.h> using namespace std; const int maxn = 510; const int inf = 0x3f3f3f3f; int n; long long d[maxn][maxn]; int w(int i, int j, int k) { return i * j * k; } int main() { int n; scanf( %d , &n); memset(d, 0x3f, sizeof(d)); for (int i = 1; i <= n; i++) { d[i][i + 2]...
#include <bits/stdc++.h> using namespace std; long long int func1(long long int i) { long long int m = i; return i * (i + 1) * (2 * i + 1) / 6 - (m + m + 2) * i * (i + 1) / 2 + (m + m + 1 + m * m) * i; } long long int func2(long long int x, long long int i) { return x * (i + i * i - i * (...
// DESCRIPTION: Verilator: Verilog Test module // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2008 by Wilson Snyder. module t (/*AUTOARG*/ // Inputs clk ); input clk; integer cyc=0; integer v; reg i; /*AUTOWIRE*/ // Beginning of automatic wires (for...
/** * 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 peripheral_ultra(clk , rst , d_in , cs , addr , rd , wr, d_out, trigg, echo ); input clk; input rst; input [15:0]d_in; input cs; input [3:0]addr; // 4 LSB from j1_io_addr input rd; input wr; output reg [15:0]d_out; output trigg; output echo; //------------------------------------ regs a...
#include <bits/stdc++.h> using namespace std; int main() { int m, k, d[2000], s[2000], n = 0, big = 0, ans = 0; cin >> m >> k; for (int i = 0; i < m; i++) cin >> d[i]; for (int i = 0; i < m; i++) cin >> s[i]; for (int i = 0; i < m; i++) { n += s[i]; if (s[i] > big) big = s[i]; ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string a = , b = , s1, s2; cin >> s1 >> s2; if (s1[0] == X ) a += s1[1]; else if (s1[1] == X ) a += s1[0]; else a += s1; if (s2[1] == X ) ...
module tx ( clk, reset_, baud, txdata, tx_enable, tx_ready, tx); input clk; input reset_; input baud; // Baud enable input [7:0] txdata; // Parallel data to transmit input tx_enable; // When asserted, txdata is sampled for transmissi...
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, s; cin >> n >> s; int a[s]; memset(a, 0, sizeof a); for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; a[x - 1] = max(a[x - 1], y); } int t = 0; for (i...
#include <bits/stdc++.h> using namespace std; int n; int b[5000]; int f[5000]; int main() { scanf( %d , &n); for (int i = 0; i < (int)(n); i++) scanf( %d , b + i); for (int i = 0; i < (int)(n); i++) b[i]--; for (int i = 0; i < n; i++) { int c[5000] = {}; pair<int, int> best = mak...
`timescale 1ns/1ps /*************************************************************************** Name: Date: 7/18/2016 Founction: I2C top module Note: ****************************************************************************/ module I2C_MASTER(clk,rst_n,sda,scl,RD_EN,WR_EN,receive_status,tx_start,tx_data,tx_complete,...
#include <bits/stdc++.h> using namespace std; long long t = 1; void solve() { long long n, x, y, cnt = 0, p = 1; cin >> n; vector<long long> arr(n + 1), vis(n + 1, 0); vector<vector<long long> > v(n + 1); for (long long i = 0; i < n - 1; i += 1) { cin >> x >> y; v[x].push_back(y); ...
#include <bits/stdc++.h> const int maxn = 1e5 + 1; int n, m, l = 1; long long a; char s[maxn]; int main() { scanf( %d%d%s , &n, &m, s + 1); for (int i = 1; i <= n; i++) if (s[i] != s[i - 1]) a += n * (m - 1); for (int i = 2; i <= n; i++) if (l == 1 && s[i] != s[i - 1] || l > 1 && s[i] ...
#include <bits/stdc++.h> using namespace std; double DP[2][2510][2510]; double X[2510], Y[2510]; double dis(int a, int b) { return sqrt((X[a] - X[b]) * (X[a] - X[b]) + (Y[a] - Y[b]) * (Y[a] - Y[b])); } int main() { ios::sync_with_stdio(false); memset(DP, 0, sizeof(DP)); int N; cin >> N; ...
#include <bits/stdc++.h> using namespace std; int dir[4][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; int ans[505][505]; int col = 1, n, coz = 0; int main() { std::ios::sync_with_stdio(false); scanf( %d , &n); if (n < 3) { printf( -1 ); return 0; } int now_ = 0, cot = n; int x ...
#include <bits/stdc++.h> using namespace std; const long long mk = 100005; long long n; vector<long long> g[mk]; long long find(long long A) { if (A == 0) return 0; long long tmp = A & 3; long long R = (find(A / 4) << 2); if (tmp == 0) return R; if (tmp == 1) return (R | 2); if (tmp ==...
`timescale 1ns / 1ps //////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:11:12 05/19/2015 // Design Name: top // Module Name: E:/mips_pipeline/code/test_top.v // Project Name: mips_pipeline // Target Device: // Tool versio...
/* * 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...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 05/09/2015 12:10:35 PM // Design Name: // Module Name: BRAM_Matrix // Project Name: // Target Devices: // Tool Versions: // Description: // // Dependencies: // /...
module scaler_relay # ( parameter integer C_DATA_WIDTH = 12, parameter integer C_PASSTHROUGH = 0 ) ( input wire clk, input wire resetn, input wire s_valid, input wire [C_DATA_WIDTH-1:0] s_data , output wire s_ready, output wire m_valid, output wire...
/* * 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...
#include <bits/stdc++.h> using namespace std; string s; int main() { ios_base::sync_with_stdio(0); cin >> s; vector<int> a; vector<int> b; int n = s.size(); for (int i = 0; i < n; i++) { if (s[i] == l ) a.push_back(i + 1); if (s[i] == r ) b.push_back(i + 1); } for (in...
//----------------------------------------------------- // PROYECTO 1 : SD HOST // Archivo : probador.v // Descripcion : generador de estimulos para el bloque de datos // Estudiante : Mario Castresana Avendaño - A41267 //----------------------------------------------------- module probador( //señales para D...
/** * 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 2007 Altera Corporation. All rights reserved. // Altera products are protected under numerous U.S. and foreign patents, // maskwork rights, copyrights and other intellectual property laws. // // This reference design file, and your use thereof, is subject to and governed // by the terms and condi...
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) using namespace std; enum { MOD0 = 1000000000, MOD7 = 1000000007, MOD9 = 1000000009 }; template <typename T> class FenwickTree { vector<T> tree; public: FenwickTree<T>() : tree() {} FenwickTree<T>(vector<T> a) : tree(a.size() + 1, 0) { ...
/////////////////////////////////////////////////////////////////////////////// // Copyright (c) 1995/2014 Xilinx, Inc. // All Right Reserved. /////////////////////////////////////////////////////////////////////////////// // ____ ____ // / /\/ / // /___/ \ / Vendor : Xilinx // \ \ \/ Version : 201...
// file: dcm_tb.v // // (c) Copyright 2008 - 2011 Xilinx, Inc. All rights reserved. // // This file contains confidential and proprietary information // of Xilinx, Inc. and is protected under U.S. and // international copyright and other intellectual property // laws. // // DISCLAIMER // This disclaimer is not a lic...
#include <bits/stdc++.h> using namespace std; set<int> cn[10000]; int nx[10000]; string xm[10000]; int main() { int m; cin >> m; ; map<string, int> mx; int n = 0; for (int i = (0); i < m; i++) { string a, b; cin >> a >> b; if (!mx.count(a)) mx[a] = n, xm[n++] = a; ...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2015.4 // Copyright (C) 2015 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1ns/1ps modul...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 9; bool p[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ; vector<int> k; for (int i = 2; i <= 1e6; i++) { if (p[i]) continue; k.push_back(i); for (int j = i + i; j <= 1...
#include <bits/stdc++.h> #pragma GCC target( avx2 ) #pragma GCC optimization( O3 ) #pragma GCC optimization( unroll-loops ) using namespace std; template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << { << p.first << , << p.second << } ; return os; } co...
#include <bits/stdc++.h> using namespace std; const long long LINF = 0x3f3f3f3f3f3f3f3f; const long long NLINF = 0xf7f7f7f7f7f7f7f7; const int INF = 0x3f3f3f3f, NINF = 0xf7f7f7f7; const int MOD1 = 1e9 + 7, MOD2 = 1e9 + 9; const int N = 1e5 + 10; vector<int> sz; int t, n, lst; int main() { for (sca...
#include <bits/stdc++.h> int n, fa[200005][2], sz[200005][2]; long long ans; int find(int x, int c) { return fa[x][c] == x ? x : (fa[x][c] = find(fa[x][c], c)); } void merge(int x, int y, int c) { x = find(x, c), y = find(y, c); if (x == y) return; fa[y][c] = fa[x][c], sz[x][c] += sz[y][c]; ...
////////////////////////////////////////////////////////////////////// //// //// //// CRC_gen.v //// //// //// //// This file is part of the Ether...
/* * Utility functions for verilog testbenches * * Copyright (C) 2016 Olof Kindgren <> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. *...
#include <bits/stdc++.h> using namespace std; long long ex_gcd(long long a, long long b, long long &x, long long &y) { int d = a; if (b == 0) { x = 1; y = 0; } else { d = ex_gcd(b, a % b, y, x); y -= a / b * x; } return d; } int main() { long long a, b, c; lon...
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define MAX 2000000000 vector<ll> feaseable; void setfun(){ for(ll i = 3; i<MAX; i+=2){ ll sq = i * i; if(sq>MAX){ break; } ll c = (sq + 1)/2; feaseable.push_back(c); ...
`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 16:19:54 04/26/2017 // Design Name: // Module Name: decrypt_dumb // Project Name: // Target Devices: // Tool versions: // Description: // // De...