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 la...
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, c0, c1, h; cin >> n >> c0 >> c1 >> h; string second; cin >> second; int cost1 = 0, z = 0, o = 0; for (int i = 0; i < second.length(); i++) { if (second[i] == 0 ) ...
`timescale 1 ns / 1 ps module axis_scaler # ( parameter integer AXIS_TDATA_WIDTH = 14 ) ( // System signals input wire aclk, input wire aresetn, input wire signed [AXIS_TDATA_WIDTH-1:0] cfg_data, // Slave side input wire signed [AXIS_TDATA_WIDTH-1:...
#include <bits/stdc++.h> using namespace std; const int N = 100000, M = 10, pw[5] = {1, 10, 100, 1000, 10000}; const unsigned long long mod = 1ULL << 58, inv = 6723469279985657373ULL; struct comp { unsigned long long a[4]; comp(int X = 0) { a[0] = X; a[1] = a[2] = a[3] = 0; } unsigne...
#include <bits/stdc++.h> using namespace std; const int N = 2005; int n, m, ans[N], h[N]; bitset<N> a[N]; vector<int> e[N]; bool check1() { for (int i = (int)(1); i <= (int)(n); i++) if (e[i].size() & 1) return 0; return 1; } void gauss() { int it = 1; for (int i = (int)(1); i <= (...
/* * ECP5 PicoRV32 demo * * Copyright (C) 2017 Clifford Wolf <> * Copyright (C) 2018 David Shah <> * * 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...
#include <bits/stdc++.h> using namespace std; const int N = 55; const unsigned long long M = 1000000009LL; const int K = 3; const int LIT = 2500; const int INF = 1 << 30; const double eps = 1e-6; const unsigned long long MOD = 1000000007LL; const int dir[][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; un...
/** * 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...
// // Copyright (c) 2000 Steve Wilson () // // 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) // a...
/* This file was generated automatically by the Mojo IDE version B1.3.6. Do not edit this file directly. Instead edit the original Lucid source. This is a temporary file and any changes made to it will be destroyed. */ /* Parameters: FACTOR = 5 */ module serdes_n_to_1_22 ( input ioclk, ...
#include <bits/stdc++.h> using namespace std; vector<vector<int> > v; vector<bool> vis; string ans = ; void dfs(int temp) { ans += temp + a ; for (auto it = v[temp].begin(); it != v[temp].end(); ++it) { if (!vis[*it]) { vis[*it] = true; dfs(*it); } } } int main()...
#include <bits/stdc++.h> using namespace std; long long n, k; long long a[100010]; signed main() { scanf( %lld%lld , &n, &k); long long cnt = 1; long long l = 1; long long ans = 0; for (long long i = 1; i <= n; i++) { scanf( %lld , &a[i]); cnt = cnt * a[i] % k; if (!cnt) { ...
/** * 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 module tb_multiplier (); /* this is automatically generated */ // clock initial begin clk = 0; forever #5 clk = ~clk; end // (*NOTE*) replace reset, clock reg [SW-1:0] a; reg [SW-1:0] b; // wire [2*SW-2:0] BinaryRES; //wire [2*SW-1:0] FKOARES; wire [2*SW-1:0] RKOARES; ...
#include <bits/stdc++.h> using namespace std; int n; int a[2][200005]; int dp[2][200005][19]; void gao(int c) { for (int i = 1; i <= n; ++i) dp[c][i][0] = a[c][i]; for (int j = 1; (1 << j) <= n; ++j) { for (int i = 1; i + (1 << (j - 1)) <= n; ++i) { if (c == 0) dp[c][i][j] = ma...
`include "../include/tune.v" // Pentevo project (c) NedoPC 2010,2011,2012 // // decoding mode setup: which border, which modes in one-hot style coding module video_modedecode( input wire clk, input wire [ 1:0] pent_vmode, // inputs as set by Z80 environment input wire [ 2:0] atm_vmode, // output re...
#include <bits/stdc++.h> using namespace std; const int N = 3E4 + 5; const int M = 500; int n, d, a[N], x, ans, r, L, w, f[N][M * 2 + 5]; int main() { cin >> n >> L; for (int i = 1; i <= n; i++) scanf( %d , &r), a[r]++; memset(f, -10, sizeof(f)); f[L][M] = a[L]; for (int i = 1; i <= r; i++...
// // Copyright (c) 1999 Steven Wilson () // // 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 <bits/stdc++.h> using namespace std; int main() { int n, a, b; scanf( %d%d%d , &n, &a, &b); printf( %d n , ((a - 1) + b + 100 * n) % n + 1); return 0; }
#include <bits/stdc++.h> using namespace std; const int P = 1e9 + 7; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } long long qpow(long long a, long long n) { long long r = 1 % P; for (a %= P; n; a = a * a % P, n >>= 1) if (n & 1) r = r * a % P; return r; } long ...
/* * 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 tree[270000 * 4]; int t; char opt; void insert(long long x) { if (x == 0) { ++tree[2]; return; } int num = x % 10; x /= 10; num = (num % 2 == 0 ? 0 : 1); int root = (num == 0 ? 2 : 3); ++tree[root]; while (x) { ...
#include <bits/stdc++.h> using namespace std; int n, m, l[2001], s[2001], c[4001]; int f[4001][2001]; int main() { scanf( %d%d , &n, &m); m += n; for (int i = n; i >= 1; i -= 1) scanf( %d , &l[i]); for (int i = n; i >= 1; i -= 1) scanf( %d , &s[i]); for (int i = 1; i <= m; i += 1) scanf( %d ...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2012.2 // Copyright (C) 2012 Xilinx Inc. All rights reserved. // // ============================================================== `timescale 1 ns / 1 ps mod...
#include <bits/stdc++.h> using namespace std; void solve() { int n, kk; cin >> n >> kk; vector<string> v(n); unordered_map<string, int> mp; for (int i = 0; i < n; i++) { cin >> v[i]; mp[v[i]]++; } int ans = 0; string req; for (int i = 0; i < n; i++) { for (int j...
#include <bits/stdc++.h> using namespace std; pair<int, int> Max[3005][3005]; struct ans { int a, b, c; int i, j, k; ans(int _a, int _b, int _c, int _i, int _j, int _k) { a = _a; b = _b; c = _c; i = _i; j = _j; k = _k; } }; bool operator<(const ans &a, const...
// megafunction wizard: %ROM: 1-PORT% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: altsyncram // ============================================================ // File Name: dec_table.v // Megafunction Name(s): // altsyncram // // Simulation Library Files(s): // altera_mf // ==============================...
#include <bits/stdc++.h> using namespace std; const double pi = acos(0.0) * 2.0; const long double eps = 1e-10; const int step[8][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}, {-1, 1}, {1, 1}, {1, -1}, {-1, -1}}; template <class T> inline T abs1(T a) { return a < 0 ? -a : a; } t...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; struct Node { string str; int pos; friend bool operator<(Node const& n1, Node const& n2) { return n2.str < n1.str; } }; priority_queue<Node> que; int main() { int k; string str; cin >> str; cin >>...
#include <bits/stdc++.h> using namespace std; void debug_out() { cerr << n ; } template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << << H; debug_out(T...); } const long long MAXN = 1e2 + 10, INF = 1e9; long long n, m, k, a, b, u, v, floyd[MAXN][MAXN], second[...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int N = 3 * 100002; int a[N], pr[N]; ll cnt[N]; map<int, int> s[N]; int main() { int q; cin >> q; while (q--) { ll ans = 0; int n; cin >> n; for (int i = 0; i <= n; i++) { pr[i] = -1; ...
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed into the Public Domain, for any use, // without warranty, 2019 by Driss Hafdi // SPDX-License-Identifier: CC0-1.0 interface validData ( input wire clk, input wire rst ); logic data; logic valid; modport sink ...
/* * 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) 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...
module computation(clk, asel, bsel, loadc, loads, shift, ALUop, A, B, sximm5, status, C); parameter width= 1; parameter statusWidth= 3; input clk, asel, bsel, loadc, loads; input [1:0] shift, ALUop; input [15:0] A, B, sximm5; output [2:0] status; output [15:0] C; wire [2:0] statusComputed; wire overflow; wir...
#include <bits/stdc++.h> using namespace std; int size(long long a) { int c = 0; while (a != 0) { c++; a /= 10; } return c; } int main() { long long a, b, c; cin >> a >> b; long long s = size(b), ns = 1; for (int i = 1; i <= s; i++) ns *= 10; s = ns; while (b ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { for (int j = i; j <= n; j++) { if (j % i == 0 && i * j > n && j < n * i) return cout << j << << i, 0; } } cout << -1; }
#include <bits/stdc++.h> using namespace std; int m, n, arr[200][200]; int color(int x, int y) { int col = 1; while (arr[x - 1][y] == col or arr[x][y - 1] == col or arr[x + 1][y] == col or arr[x][y + 1] == col) col++; return col; } int color2(int x, int y) { int col = 1; w...
// megafunction wizard: %LPM_MULT%VBB% // GENERATION: STANDARD // VERSION: WM1.0 // MODULE: lpm_mult // ============================================================ // File Name: mult30_9.v // Megafunction Name(s): // lpm_mult // // Simulation Library Files(s): // lpm // ============================...
// *************************************************************************** // *************************************************************************** // Copyright 2011(c) Analog Devices, Inc. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // a...
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 6; int n, k, h[N]; long long p, m, t, a[N], b[N]; struct xd { int z, i; bool operator<(const xd &d) const { return z > d.z; } } tmp, nw; inline int read() { int T = 0, F = 1; char ch = getchar(); while (ch < 0 || ch > ...
/*************************************************************************************************** ** fpga_nes/hw/src/cpu/apu/apu_div.v * * Copyright (c) 2012, Brian Bennett * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that th...
#include <bits/stdc++.h> #pragma GCC optimize( Ofast ) using namespace std; template <typename T> void ckmn(T& a, T b) { a = min(a, b); } template <typename T> void ckmx(T& a, T b) { a = max(a, b); } void rd(int& x) { scanf( %i , &x); } void rd(long long& x) { scanf( %lld , &x); } void rd(...
#include <bits/stdc++.h> using namespace std; string s, v; bool g(char k) { return (k == a || k == e || k == i || k == o || k == u ); } int main() { ios_base::sync_with_stdio(0); cin >> s; long long tek = 0; char t1 = - , t2 = - ; for (long long i = 0; i < s.size(); i++) { ...
#include <bits/stdc++.h> using namespace std; int main() { int v0, v1, v2, vm, a0, a1, a2; bool err = true; scanf( %d%d%d%d , &v2, &v1, &v0, &vm); for (int i = v0; i <= v0 * 2; i++) { for (int j = v1; j <= v1 * 2; j++) { for (int k = v2; k <= v2 * 2; k++) { if (vm <= i && vm ...
#include <bits/stdc++.h> using namespace std; int sum[64]; long long a[200200]; long long calc() { long long ans = 0; for (int i = 0; i < 64; i++) { ans += (1LL << i) * (sum[i] > 0); } return ans; } int main() { int n, k, x; cin >> n >> k >> x; for (int i = 1; i <= n; i++) ...
module heater # ( parameter integer C_HEAT_VALUE_WIDTH = 12, parameter integer C_HEAT_TIME_WIDTH = 32 ) ( input wire clk, input wire resetn, input wire ext_autostart, output wire power, output wire en, output wire fan, input wire [15:0] s_axis_tdata, input wire [4:0] s_axis_tid, output wire ...
#include <bits/stdc++.h> using namespace std; const int MAXN = 100 + 7; int n, k; string second; string s2; string s1; int main() { cin >> n >> k; cin >> second; sort(second.begin(), second.end()); for (int i = 0; i < n; i++) { if (second[i] != second[i + 1]) { s2 += second[i...
#include <bits/stdc++.h> using namespace std; int main() { string a, b; int ailgis, bilgis; cin >> a >> b; ailgis = a.length(); bilgis = b.length(); if (a == b) { cout << -1 ; return 0; } if (ailgis > bilgis) cout << ailgis; else cout << bilgis; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); ; long long i, j, k, l, r, m, n, o, t; cin >> n; cin >> l >> r; char str[100001]; cin >> str; long long len = strlen(str); l--; r--; if (str[l] == str[r]) { cout << 0 << endl; ...
#include <bits/stdc++.h> using std::cin; using std::cout; using std::endl; using std::set; using std::swap; using std::vector; void TaskA() { vector<char> first; vector<char> second; char a; int f, s; for (int i = 0; i < 4; i++) { cin >> a; first.push_back(a); if (a =...
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i; cin >> n >> k; if (k == 1 || k == n) { cout << 3 * n << endl; return 0; } else { int sum = 0; if (k & 1) { if (k >= n / 2 + 1) { k = n - k + 1; } } else { if (k > n...
/** * 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...
// A register file module. 32 registers, each of it has 32 bit // Supports 2 reading ports, 1 writing port // ADDA: reading address of A, ADDB: reading addr of B // ADDC: writing address of C // clk: clock signal // clr: clear signal // WE: Write Enable module registerfile(ADDA, DATAA, ADDB, DATAB, ADDC, DATAC, clk,...
#include <bits/stdc++.h> using namespace std; const long long maxN = 1e5 + 21; long long n, m, a[maxN], cnt[maxN], ans; bool p[maxN], f = true; vector<long long> g[maxN]; int32_t main() { cin >> n >> m; for (long long i = 0; i < m; i++) { long long x, y; cin >> x >> y; g[x].push_ba...
/** * 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 Wed Dec 14 22:35:39 MST 2016 // Date : Mon Feb 27 19:26:51 2017 // Host : GILAMONSTER running 64-bit major release (...
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2018.2 // Copyright (C) 1986-2018 Xilinx, Inc. All Rights Reserved. // // ============================================================== `timescale 1 ns / 1...
#include <bits/stdc++.h> using namespace std; double g[110][110], x[110]; int n, m, ues[110]; pair<pair<int, int>, int> p[5010]; bool vis[110]; void read(int &x) { char ch = getchar(); int mark = 1; for (; ch != - && (ch < 0 || ch > 9 ); ch = getchar()) ; if (ch == - ) mark = -1,...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; long long powmod(long long a, long long b) { long long res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = res * a % mod; a = a * a % mod; } return res; } const int N = 55; ...
#include <bits/stdc++.h> using namespace std; vector<char> a; int x, y, n; void update(pair<int, int> &pos, int i, int d) { if (a[i] == U ) pos.second += d; else if (a[i] == D ) pos.second -= d; else if (a[i] == R ) pos.first += d; else pos.first -= d; } bool ok(pa...
// 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 : Thu May 25 15:27:56 2017 // Host : GILAMONSTER running 64-bit major release (...
// Accellera Standard V2.5 Open Verification Library (OVL). // Accellera Copyright (c) 2005-2010. All rights reserved. `include "std_ovl_defines.h" `module ovl_fifo_index (clock, reset, enable, push, pop, fire); parameter severity_level = `OVL_SEVERITY_DEFAULT; parameter depth = 1; param...
#include <bits/stdc++.h> using namespace std; int i, h, j, w; string s, t, v; pair<string, int> k; stack<int> p; vector<pair<string, int>> a; int main() { cin >> s; v = s; t = s; for (i = 0; i < s.size(); i++) if (s[i] == ( || s[i] == [ ) p.push(i); while (!p.empty()) { ...
#include <bits/stdc++.h> using namespace std; const double eps = 1e-10; const int maxn = (1 << 11) + 100; int dp[maxn][maxn]; vector<int> g[15]; int n, m, k, u, v, mx, cc[maxn]; void init() { for (int i = 0; i < maxn; ++i) cc[i] = __builtin_popcount(i); } int main() { init(); cin >> n >> m...
/** * 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 unsigned mod = 3853518419u; const unsigned base = 85429482u; int n; string s; basic_string<int> e[300005]; int p[19][300005], du[300005]; unsigned bp[300005]; unsigned hu[19][300005], hd[19][300005]; void dfs(int x, int par) { p[0][x] = par; ...
#include <bits/stdc++.h> using namespace std; int gi() { int f = 1, x = 0; char ch = getchar(); while (ch < 0 || ch > 9 ) { if (ch == - ) f = -1; ch = getchar(); } while (ch >= 0 && ch <= 9 ) { x = x * 10 + ch - 0 ; ch = getchar(); } return f == 1 ? x : -x...
#include <bits/stdc++.h> using namespace std; int main() { int sum1 = 0, sum2 = 0, sum3 = 0; int n; cin >> n; int a, b, c; for (int i = 0; i < n; i++) { cin >> a >> b >> c; sum1 += a; sum2 += b; sum3 += c; } if (sum1 == 0 && sum2 == 0 && sum3 == 0) cout << ...
/** * 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() { int n; cin >> n; long long int a[2 * n]; for (int i = 0; i < 2 * n; i++) cin >> a[i]; sort(a, a + (2 * n)); long long int s = 2e19; ; for (int i = 1; i < n; i++) { s = min(s, (a[n * 2 - 1] - a[0]) * (a[n + i - 1] - 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 law...
#include <bits/stdc++.h> using namespace std; char moves[4] = { L , U , R , D }; long long dx[4] = {-1, 0, 1, 0}; long long dy[4] = {0, -1, 0, 1}; const long long N = 1e3 + 1; bool visited[N]; vector<long long> adj[N]; long long n, k; signed main() { ios_base::sync_with_stdio(0); cin.tie(0)...
#include <bits/stdc++.h> using namespace std; string str, queries[100010]; int n; unsigned long long values[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; unsigned long long length[10] = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; int main() { cin >> str >> n; queries[0] = 0-> + str; for (int i = 0; i < ...
`timescale 1ns/1ns module usb_tx_token (input c, input [18:0] d, input start, output [7:0] sie_d, output sie_dv); localparam ST_IDLE = 3'd0; localparam ST_CALC_CRC = 3'd1; localparam ST_SYNC = 3'd2; localparam ST_DATA = 3'd3; localparam SW=4, CW=5; reg [CW+SW-1:0] ctrl; wire [SW-1:0] state; wire [SW-1...
#include <bits/stdc++.h> using namespace std; const int MAX = 300005; pair<int, int> seg[2 * MAX]; void update(int l, int r, int fight, int value) { for (l += MAX, r += MAX; l < r; l >>= 1, r >>= 1) { if (l & 1) seg[l++] = make_pair(fight, value); if (r & 1) seg[--r] = make_pair(fight, value); ...
/** * 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...
// file: pll.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 licens...
//Legal Notice: (C)2017 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 //simulation files), and any associated do...
#include <bits/stdc++.h> using namespace std; int a[100005], b[100005]; int main() { int n, m, k; map<int, int> f1; cin >> n >> m >> k; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i < m; i++) { cin >> b[i]; } bool f = false; sort(a, a + n); sort...
#include <bits/stdc++.h> using namespace std; int mp[100][100]; int cnt[100]; int main() { int n, x, y; cin >> n; while (cin >> x) { cin >> y; mp[x][y] = 1; mp[y][x] = 1; cnt[x]++; } for (int i = 1; i <= n; i++) { for (int j = i + 1; j <= n; j++) { if (!...
module gmii2fifo72 # ( parameter Gap = 4'h2 ) ( input sys_rst, input gmii_rx_clk, input gmii_rx_dv, input [7:0] gmii_rxd, // FIFO output [71:0] din, input full, output reg wr_en, output wr_clk ); assign wr_clk = gmii_rx_clk; //------------------------------...
/* * 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...
// divmmc // // Total refactoring. Made module synchroneous. (Sorgelig) // module divmmc ( input clk_sys, input [1:0] mode, // CPU interface input nWR, input nRD, input nMREQ, input nIORQ, input nM1, input [15:0] addr, input [7...
//================================================================================================== // Filename : RKOA_OPCHANGE.v // Created On : 2016-10-26 23:25:59 // Last Modified : 2016-10-31 16:26:29 // Revision : // Author : Jorge Esteban Sequeira Rojas // Company : Instituto Tec...
#include <bits/stdc++.h> using namespace std; const int BSZ1 = 1010; const int BSZ2 = 200; int N; char A[202020]; int B[40404040]; int C[202020]; long long ans; int R[202020]; void calc(int i, int r, int zero) { int t = (zero + R[r]) / i; int u = zero / i; if (zero % i != 0) u++; if ...
/** * 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() { int n; cin >> n; char a[n][7]; for (int i = 0; i < n; i++) { for (int j = 0; j < 7; j++) cin >> a[i][j]; } int ans = 0, ct = 0; for (int j = 0; j < 7; j++) { ct = 0; for (int i = 0; i < n; i++) { if (a[i...
// // Copyright (c) 1999 Steven Wilson () // // 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 <bits/stdc++.h> using namespace std; int a[26], l[26], n, k, x, se, t; char b; string s; int main() { cin >> n; for (int i = 0; i < n; i++) { cin >> b >> s; if (x == 1) { if (i == n - 1) break; if (b != . ) se++; continue; } if (b != ? ) ...
/* Copyright 2018 Nuclei System Technology, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 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 law...
`timescale 1ns/100ps module top; parameter pdly = 1.2; real rdly = 1.3; integer idly = 1; reg in = 1'b0; wire gi, gf, gs, gt; wire #idly int = in; wire #1.1 first = in; wire #pdly second = in; wire #rdly third = in; buf #idly (gi, in); buf #1.1 (gf, in); buf #pdly (gs, in); buf #rdly (gt, i...
#include <bits/stdc++.h> using namespace std; int main() { int n, m, i, j, k, l; cin >> n >> m; k = (n - m) / 2; j = 1; while (j <= n) { if (j % (k + 1) == 0) { cout << 1 ; } else { cout << 0 ; } j++; } }
// DESCRIPTION: Verilator: Verilog Test module // // This file ONLY is placed under The Creative Commons Public Domain, for // any use, without warranty, 2020 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 `timescale `time_scale_units / `time_scale_prec import "DPI-C" function void dpii_check(); module t (/*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...