text stringlengths 59 71.4k |
|---|
/*
* 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... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; long long dp[500005] = {0}; dp[3] = 8; long long fac = 2; for (long long i = 5; i <= 500000; i += 2) { dp[i] = dp[i - 2] + fac * (i + i + i - 2 + i - 2);... |
#include <bits/stdc++.h> using namespace std; double EPS = 1e-9; int INF = 1000000000; long long INFF = 8000000000000000000LL; double PI = acos(-1); int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1}; int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1}; inline string IntToString(int a) { char x[100]; sprintf(x, %... |
// Copyright 1986-2016 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2016.4 (win64) Build Wed Dec 14 22:35:39 MST 2016
// Date : Sun Apr 09 07:04:01 2017
// Host : GILAMONSTER running 64-bit major release (... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 17:33:15 11/16/2015
// Design Name:
// Module Name: ControlUnit
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
/... |
// Copyright 2012 Sriram Radhakrishnan, Varun Sampath, Shilpa Sarode
//
// This file is part of PVS.
//
// PVS 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 ... |
#include <bits/stdc++.h> using namespace std; inline long long mod(long long n, long long m) { long long ret = n % m; if (ret < 0) ret += m; return ret; } long long gcd(long long a, long long b) { return (b == 0LL ? a : gcd(b, a % b)); } long long exp(long long a, long long b, long long m) {... |
#include <bits/stdc++.h> using namespace std; int main() { long long T, x, y, k; cin >> T; while (T--) { cin >> x >> y >> k; long long minSt = (y * k) + k - 1; long long st = 1; long long count = minSt / (x - 1); if (minSt % (x - 1) != 0) { cout << count + k + 1 << ... |
// (C) 2001-2016 Intel Corporation. All rights reserved.
// Your use of Intel 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 simulation
// files), and any associated docum... |
/*
* 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; map<long long, long long> zipx; long long unzipx[2000]; long long inf = 1LL << 50; long long compressx(vector<long long>& x) { sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end()); for (long long i = 0; i < x.size(); i++) { zipx... |
#include <bits/stdc++.h> using namespace std; const int block_size = 320; const long long mod = 1e9 + 7; const long long inf = 1e9 + 7; const long double eps = 1e-9; const double PI = atan(1) * 4; template <typename T> inline int sign(const T &a) { if (a < 0) return -1; if (a > 0) return 1; ... |
#include <bits/stdc++.h> using namespace std; long long i, j, k, l, r, m, s, t, n, a[11236], b[123456], z, c[168456], zam[17456], za[1234]; bool p[40000000]; long long xx, yy, x, y; int main() { cin >> n >> k; if (n == 2) { if (k == 1) cout << 01 ; else cout << -1; ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1005; char mp[MAXN][MAXN]; int ansmp[MAXN][MAXN]; int dire[4][2] = {0, -1, 0, 1, -1, 0, 1, 0}; int n, m; void fillansmap(int x0, int y0, int x1, int y1) { bool colorflag[5]; int dx = (x1 - x0 > 0); int dy = (y1 - y0 > 0); int d... |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf( %d n , &n); set<int> in, x; long totalCost(0), cost(0); while (n--) { int a, b, c; scanf( %d %d %d n , &a, &b, &c); totalCost += c; if (in.count(a) || x.count(b)) { cost += c; x.inser... |
#include <bits/stdc++.h> using namespace std; const int N = 2e6 + 7; int A[N], B[N], n, ans, pos[N], s1[N], s2[N], cnt; int main() { cin >> n; for (int i = 1; i <= n; ++i) cin >> A[i], pos[A[i]] = i; for (int i = 1; i <= n; ++i) cin >> B[i], A[pos[B[i]]] = i; for (int i = 1; i <= n; ++i) pos[A[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; long long A[1 << 20]; long long B[1 << 20]; long long getIP() { int a[4]; scanf( %d.%d.%d.%d , &a[0], &a[1], &a[2], &a[3]); int i; long long res = 0; for (i = (0); i < (4); ++i) res = (res << 8) | a[i]; return res; } void printIP(long lon... |
#include <bits/stdc++.h> int Fa[200010]; std::vector<int> v[200010]; int Find(int x) { return Fa[x] == x ? x : Fa[x] = Find(Fa[x]); } bool vis[200010]; inline void merge(int a, int b) { int f1 = Find(a), f2 = Find(b); if (f1 != f2) { Fa[f1] = f2; } } int main() { int n, m, q; sca... |
// ============================================================================
// Copyright (c) 2010
// ============================================================================
//
// Permission:
//
//
//
// Disclaimer:
//
// This VHDL/Verilog or C/C++ source code is intended as a design reference
... |
/*
* 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; int main() { double a, b, h; cin >> a >> b; h = (b * b - a * a) / (2 * a); h = h + (1 / 1000000); cout << fixed << setprecision(13) << h << endl; } |
#include <bits/stdc++.h> using namespace std; int mark[200002]; vector<int> pos[11]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int i, l, t, j, cnt, mx, last; bool flag; string s; cin >> t; while (t--) { cin >> l >> s; for (i = 0; i ... |
#include <bits/stdc++.h> using namespace std; long long fastpower(long a, long b, long long n = 1000000007) { long res = 1; while (b > 0) { if ((b & 1) != 0) { res = (res % n * a % n) % n; } a = (a % n * a % n) % n; b = b >> 1; } return res; } bool isPrime(long lo... |
#include <bits/stdc++.h> using namespace std; int power(long long x, unsigned int y, int p) { long long res = 1; x = x % p; if (x == 0) return 0; while (y > 0) { if (y & 1) res = (res * x) % p; y = y >> 1; x = (x * x) % p; } return res; } int main() { long long n, p... |
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 1995/2017 Xilinx, Inc.
//
// 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
//
/... |
/*
* 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 la... |
#include <bits/stdc++.h> using namespace std; int main() { long long a, b; cin >> a >> b; int count = 0; for (int i = 0; (1LL << i) / 2 <= b; i++) { for (int j = 0; j < i - 1; j++) { long long n = (1LL << i) - 1 - (1LL << j); if (a <= n && n <= b) count++; } } cou... |
//////////////////////////////////////////////////////////////////////
//// ////
//// eth_rxstatem.v ////
//// ////
//// This file is part of the Ether... |
module Timer(clk_i,rst_i,addr_bi,data_bi,data_bo,en_i,we_bi,tval_o);
input clk_i;
input rst_i;
input [12:0] addr_bi;
input [31:0] data_bi;
output [31:0] data_bo;
input en_i;
input [3:0] we_bi;
output [31:0] tval_o;
reg [31:0] data_bo;
reg [31:0] tval_o;
reg [31:0] next_data_bo_reg;
reg [31:0] next_tconf_reg;
reg [31:... |
#include <bits/stdc++.h> using namespace std; void solve() { long long int x, y; cin >> x >> y; if (x == 1) { if (y <= 1) { cout << yes << endl; return; } else { cout << no << endl; return; } } else if (x == 2 || x == 3) { if (y <= 3) { ... |
#include <bits/stdc++.h> using namespace std; int n; int a[200005]; long long oddpref[200005]; long long evenpref[200005]; long long evensuff[200005]; long long oddsuff[200005]; int main() { cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } for (int i = 1; i <= n; i++) { ... |
#include <bits/stdc++.h> using namespace std; struct Maxflow { static const int oo = 100000005; static const int maxn = 5555 * 2; static const int maxm = 5555 * 4; int T, S; struct node { int to, nxt, cap; } ed[maxm * 2]; int head[maxn], cur[maxn], cnt, ans, ndnum; int h[maxn];... |
#include <bits/stdc++.h> using namespace std; int main() { int n, a, mn, mx, ans = 0; cin >> n >> a; mn = mx = a; for (int i = 1; i < n; i++) { cin >> a; if (a < mn) { mn = a; ans++; } if (a > mx) { mx = a; ans++; } } cout << ans;... |
#include <bits/stdc++.h> using namespace std; long long int pi[1000], ai[1000]; long long int bsearch(long long int arr[], long long int x, long long int n) { long long int a = 0; long long int k; long long int b = n - 1; while (a <= b) { k = (a + b) / 2; if (arr[k] == x) { } ... |
#include <bits/stdc++.h> int main() { int n, q; std::cin >> n >> q; std::vector<std::pair<int, int>> a(q); std::vector<int> cnt(n), k1(q), pr(n, -1); std::vector<std::vector<int>> k2(q, std::vector<int>(q)); for (auto &i : a) { std::cin >> i.first >> i.second; --i.first; --i.... |
#include <bits/stdc++.h> using namespace std; const int MXN = 100100; const int QQ = 500; const int INF = (int)1e9; const long long LINF = (long long)1e18; const int mod = 1000000007; set<pair<int, int> > eds; int x[MXN]; int main() { int n, m; scanf( %d%d , &n, &m); int a, b; for (int... |
#include <bits/stdc++.h> using namespace std; const int nmax = 5e5 + 42; int n, m; struct edges { int u, v, w; int id_original; }; edges inp[nmax], all[nmax]; bool cmp(edges a, edges b) { return a.w < b.w; } int parent[nmax]; int root(int node) { if (parent[node] == node) return node; ... |
/**
* 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 int N = 1e5 + 10; char s[N]; int main() { scanf( %s , s); int n = strlen(s); int x = 0, y = 0; for (int i = 0; i < n; i++) { if (s[i] == L ) x--; else if (s[i] == R ) x++; else if (s[i] == U ) y++; ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2016/05/23 21:33:25
// Design Name:
// Module Name: bcd_to_7segment_decoder
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencie... |
#include <bits/stdc++.h> using namespace std; map<long long, int> mm; long long Abs(long long a) { if (a < 0) a = -a; return a; } int main() { int q, l, m, a; long long b; scanf( %lld%d%d%d , &b, &q, &l, &m); for (int i = 0; i < m; i++) { scanf( %d , &a); mm[a] = 1; } ... |
#include <bits/stdc++.h> using namespace std; void solve() { long long n, x, i, m = 1, second = 0; cin >> n >> x; long long a[n]; for (i = 0; i < n; i++) cin >> a[i]; sort(a, a + n); for (i = n - 1; i >= 0; i--) { second += a[i]; if (((second * 1.0) / m) < (x * 1.0)) break; ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 00:45:31 11/17/2015
// Design Name:
// Module Name: SPI_interface
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies: ... |
#include <bits/stdc++.h> using namespace std; long long labs(long long a) { return a < 0 ? (-a) : a; } long long max(long long a, long long b) { return a > b ? a : b; } long long min(long long a, long long b) { return a < b ? a : b; } template <typename T> struct Point { T x, y; Point() {} Point... |
#include <bits/stdc++.h> using namespace std; int N, M, i, dx, dy, y; int main() { scanf( %d %d , &N, &M); if ((N == 5 || N == 6) && M == 3) { printf( -1 n ); return 0; } dx = 9; dy = 5; y = 0; for (i = 0; i < M; i++) { printf( %d %d n , dx * i, y); y += dy * (i... |
#include <bits/stdc++.h> using namespace std; const int MAX_N = 1010; const double EPS = 0.0000001; struct Point { int x, y; Point() {} Point(int a, int b) : x(a), y(b) {} }; int n; long long k; Point centers[MAX_N]; int radii[MAX_N]; double GetDist(int x1, int y1, int x2, int y2) { ... |
#include <bits/stdc++.h> using namespace std; vector<int> adj[3010]; pair<int, long long> dp[3010][3010], tmp[3010]; int v[3010], sz[3010]; void merge(int x, int y) { for (int i = 0; i < sz[x] + sz[y]; i++) tmp[i] = pair<int, long long>(-1, 0); for (int i = 0; i < sz[x]; i++) for (int j = 0; j <... |
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 12/09/2014 02:03:49 PM
// Design Name:
// Module Name: estream_tb
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revisio... |
#include <bits/stdc++.h> using namespace std; const long double pi = 3.14159265359; template <typename T> T abs(T x) { return x > 0 ? x : -x; } template <typename T> T sqr(T x) { return x * x; } long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; } const int maxn = 2e5 + ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; long long ans = 0; for (int i = (0); i < (n); ++i) { long long t, T, x, cost; cin >> t >> T >> x >> cost; if (t >= T) { ans += cost + m * x; continue; } long long aux1 = ... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 100005; int c1[MAXN], c2[MAXN]; vector<pair<int, int> > ans; int main() { int n; scanf( %d , &n); int in, winner; for (int i = 1; i <= n; i++) { scanf( %d , &in); if (i == n) winner = in; c1[i] = c1[i - 1] + (in =... |
#include <bits/stdc++.h> using namespace std; vector<pair<int, int> > ans; int deg[400001]; int tot; int flag; int n, d, k; int name() { flag++; return flag; } void f(int x, int curr) { if (tot <= 0 or x == 0) return; while (deg[curr] < k and tot > 0) { if (tot <= 0) return; ... |
#include <bits/stdc++.h> using namespace std; int main() { int a, t, i; cin >> t; for (i = 0; i < t; i++) { cin >> a; cout << a / 2 << endl; } } |
/**
* 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 int N = 200000 + 10; inline long long rd() { long long x = 0, w = 1; char ch = 0; while (ch < 0 || ch > 9 ) { if (ch == - ) w = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = (x << 3) + (x << 1) + (ch ^ 48); ... |
#include <bits/stdc++.h> using namespace std; int ch[42][42][42][42], qs[42][42], ans[42][42][42][42]; int b[42][42], cou[42][42]; char a[42]; int main() { int n, m, q, i, j, ii, jj; scanf( %d %d %d , &n, &m, &q); for (i = 1; i <= n; i++) { scanf( %s , a + 1); for (j = 1; j <= m; j++)... |
#include <bits/stdc++.h> using namespace std; int it = 0; int find(int l, int r, int k) { if (l == r) return l; int ras = (r - l + 1) / 2; int ll, rr; if (k == 0) { ll = l + ras - 1; rr = l + ras; } else { ll = r - ras; rr = ll + 1; } if (k == 0) { assert(... |
#include <bits/stdc++.h> using namespace std; #pragma optimize( -O3 ) string to_string(string s) { return + s + ; } string to_string(const char* s) { return to_string((string)s); } string to_string(const bool& b) { return (b ? true : false ); } template <typename A, typename B> string to_string(... |
#include <bits/stdc++.h> using namespace std; int digit(int n) { int counter = 0; while (n != 0) { counter++; n /= 10; } return counter; } int main() { int T; cin >> T; for (int i = 0; i < T; i++) { int n; cin >> n; if (n == 1) { cout << -1 << ... |
#include <bits/stdc++.h> using namespace std; const int maxx = 2000010; const double pi = acos(-1.0); const double eps = 1e-15; map<pair<long long, long long>, long long> h, mk; map<pair<long long, pair<long long, long long> >, long long> hh; int t, n, m, k; long long ans = 0, total = 0, sum = 0, cnt = ... |
//********************************************************************
//
// clock_gen.v
//
// This file is part of the DLX3 project ... |
`include "defines.v"
`include "connectRouter_2SNoBuffer.v"
`timescale 1ns/1ps
module tb_connectRouters(
);
reg clk, rst;
reg `control_w port_in, inj;
reg bfull;
wire `control_w port_out, eject;
wire accept, push;
connectRouter_nobuffer r(
.clk(clk),
.rst(rst),
... |
/*
* 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 int N = 1e6 + 6; const long long M = 1e9 + 7; const double eps = 1e-7; int a[N]; int Int() { int x; scanf( %d , &x); return x; } long long Lnt() { long long x; scanf( %I64d , &x); return x; } long long Bigmod(long long A, lo... |
#include <bits/stdc++.h> using namespace std; int n, m, x, y; int b[1005], a[1005]; int F1[1005], F2[1005]; int main() { char ch; cin >> n >> m >> x >> y; for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) { cin >> ch; if (ch == # ) b[j]++; } for (int i = 1;... |
/*
* MBus Copyright 2015 Regents of the University of Michigan
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 5000 + 5; int n, k, v; int a[maxn]; bool f[maxn][maxn]; pair<int, int> fr[maxn][maxn]; bool u[maxn][maxn]; bool vis[maxn]; struct ex { int cnt, x, y; }; vector<ex> ans; vector<int> vec; int read() { int x; scanf( %d , &... |
/*
Filename : MEM2WB.v
Compiler : Quartus II
Description : MEM to WB register
INPUT : clk, rst, EN, all active high
[31:0] PC_In, ALUOut_In, rdata_In,
[4:0] AddrC_In,
[1:0] MemtoReg_In,
OUTPUT : RegWrite_Out
[31:0] PC_Out, ALUOut_Out, rdata_Out,
[4:0] AddrC_Out,
[1:0... |
module rs232_syscon_top_1_0 (
input clk_i,
input reset_i,
input ack_i,
input err_i,
input rs232_rxd_i,
input [31:0]data_in,
output [31:0]data_out,
output rst_o,
output stb_o,
output cyc_o,
output [31:0]adr_o,
output we_o,
output rs232_txd_o,
output [3:0]sel_o
);
wire sy... |
#include <bits/stdc++.h> using namespace std; long long func(long long x, long long y, long long z) { return (x - y) * (x - y) + (y - z) * (y - z) + (z - x) * (z - x); } void solve() { long long na, nb, nc; cin >> na >> nb >> nc; vector<long long> a(na), b(nb), c(nc); long long i, j, k; ... |
#include <bits/stdc++.h> using namespace std; int contrib[312345] = {0}; bool in_set[312345] = {0}; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, k; cin >> n >> k; vector<int> ans; int cnt = 0; for (int i = 1; i <= n / 2; i++) { if (cnt + co... |
#include <bits/stdc++.h> using namespace std; template <typename T> inline T abs(T a) { return ((a < 0) ? -a : a); } template <typename T> inline T sqr(T a) { return a * a; } const int INF = (int)1E9 + 7; const long double EPS = 1E-9; const long double PI = 3.1415926535897932384626433832795;... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 10:22:09 04/08/2015
// Design Name:
// Module Name: IntegerMultiplication
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Depend... |
#include <bits/stdc++.h> using namespace std; int32_t main() { long long r, g, b; cin >> r >> g >> b; long long ans = 0; long long tr, tg, tb; for (long long i = 0; i <= min({r, g, b, 2LL}); i++) { long long t = i; tr = r; tg = g; tb = b; tr -= i; tg -= 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... |
/**
* 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 getn() { int h; scanf( %d , &h); return h; } template <class T, class U> ostream& operator<<(ostream& out, const pair<T, U>& par) { cout << [ << par.first << ; << par.second << ] ; return out; } vector<vector<int> > mini; int n; ... |
module processor;
wire [31:0] mux4out,pcout,imemout,reg1out,reg2out,mux3out,signout,mux2out,xorout,arith1out,dmemout,mux6out,arith2out,shiftlout,arith3out,andout,orout,mux5out;
wire [4:0] mux1out;
reg reset;
clock clock1(clk);
programcounter PC(mux4out,clk,pcout,reset);
instructionmemory imem(imemout,pcout[6:0],clk);... |
// (c) Copyright 1995-2017 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 license and does not grant ... |
#include bits/stdc++.h using namespace std; #define pb push_back #define ppb pop_back #define pf push_front #define ppf pop_front #define all(x) (x).begin(),(x).end() #define uniq(v) (v).erase(unique(all(v)),(v).end()) #def... |
#include <bits/stdc++.h> using namespace std; int n; string str; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> str; int ans = 0; for (int i = 0; i < n; i += 2) { int cnt = 0; if (str[i] == a ) cnt++; else cnt--; if (str[i + 1] == a ) ... |
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) #pragma GCC target( avx,avx2,tune=native ) template <typename T> using Prior = std::priority_queue<T>; template <typename T> using prior = std::priority_queue<T, std::vector<T>, std::greater<T>>; using namespace ... |
/**
* 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; const int N = 55; const long long M = 1000003; struct ban { long long x; ban() { x = 0; } ban(long long x) { this->x = x % M; } }; bool operator<(const ban& a, const ban& b) { return a.x < b.x; } bool operator>(const ban& a, const ban& b) { return ... |
// From: "Ma, Zhenqiang" <>
module test (
// Ports for module A
input i_A_outsidei,
output o_A_outsideo,
// Ports for module B
input i_B_outsidei,
output o_B_outsideo );
/*AUTOWIRE*/
//-----------------------------------------------------------------------------
// instantiate module A
... |
#include <bits/stdc++.h> using namespace std; template <class T> ostream &operator<<(ostream &os, const vector<T> &v) { for (T i : v) os << i << , ; return os; } template <class T> ostream &operator<<(ostream &os, const set<T> &v) { for (T i : v) os << i << ; return os; } template <... |
#include <bits/stdc++.h> using namespace std; int n, m; vector<int> G[100000]; int a[100000]; int b[100000]; int c[100000]; void dfs(int v) { b[v]++; c[v] = 1; for (int i = 0; i < (int)(G[v].size()); i++) { int w = G[v][i]; if (++b[w] == a[w]) dfs(w); } } int main() { c... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: California State University San Bernardino
// Engineer: Bogdan Kravtsov
// Tyler Clayton
//
// Create Date: 11:05:10 10/17/2016
// Module Name: S_EXTEND_tb
// Project Name: MI... |
//*****************************************************************************
// (c) Copyright 2009 - 2012 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
/... |
/**
* 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 law... |
#include <bits/stdc++.h> using namespace std; const int maxmn = 505; long long a[maxmn][maxmn]; long long luu1[maxmn][maxmn]; bool k[1000005]; long long maxx = 1e9; void readquick() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } int main() { readquick(); vector<long lon... |
//name : file_reader_b
//tag : c components
//output : output_z:16
//source_file : file_reader_b.c
///=============
///
///*Created by C2CHIP*
//////////////////////////////////////////////////////////////////////////////
// Register Allocation
// ===================
// Register Name ... |
//======================================================================
//
// blockmem2r1wptr.v
// -----------------
// Synchronous block memory with two read ports and one write port.
// For port 1 the address is implicit and instead given by the
// internal pointer. The pointer is automatically increased
// when the... |
#include <bits/stdc++.h> using namespace std; char s[110], ss[110]; int a[210], ans[210], n, k, namlen; bool boo; bool check() { int i, j; for (i = 1; i <= n; i++) if (ss[i] == 0 ) { bool bk = true; for (j = 1; j <= namlen; j++) if (a[i + j - 1] != s[j]) { ... |
/*
-- ============================================================================
-- FILE NAME : alu.v
-- DESCRIPTION : ËãÐgÕÀíÑÝËã¥æ¥Ë¥Ã¥È
-- ----------------------------------------------------------------------------
-- Revision Date Coding_by Comment
-- 1.0.0 2011/06/27 suito ÐÂÒ×÷³É
-- ========... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.