text stringlengths 59 71.4k |
|---|
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using pll = pair<ll, ll>; const int N = 325; int n, s[N], sum[26][N], vc; bitset<N> b[N]; char ans[N]; void addv(int s, int e) { int flag = 0; for (int i = s - 1, j = e - 1; i <= j; i++, j--) { ... |
#include <bits/stdc++.h> using namespace std; void printopt(int p) { for (int i = p / 2; i; i--) printf( 4 ); for (int i = p / 2; i; i--) printf( 7 ); } char s[100000 + 2]; char s47[100000 + 2]; int n; bool fopt(int i, int ddif47) { if (abs(ddif47) > n - i) return 0; int j = i; for (; ... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2003 by Wilson Snyder.
`define INT_RANGE 31:0
`define INT_RANGE 31:0 // Duplicate identical defs are OK
`define INT_RANGE_MAX 31
`define VECTOR_RANGE 511:0
module t (clk);
... |
#include <bits/stdc++.h> using namespace std; int main() { int x, y, z; int x1, y1, z1; cin >> x >> y >> z; cin >> x1 >> y1 >> z1; int a[6]; int ans(0); for (int i(0); i < 6; ++i) cin >> a[i]; if (z > z1) ans += a[3]; if (z < 0) ans += a[2]; if (x < 0) ans += a[4]; if (x ... |
`timescale 1ns/1ns
module usb_poll
(input c, // bus clock: 125 mhz
input start,
input tx_sie_done,
input dont_respond, // for debugging stalling issues
output [18:0] token_d,
output token_start,
output [7:0] payload_d,
output payload_dv,
input [7:0] sie... |
/*
* 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 ans = 1, n, k, i; cin >> n >> k; cout << (n / k + 1) * k; return 0; } |
#include <bits/stdc++.h> using namespace std; using ll = long long; using lll = __int128_t; const int N = 105; int n; vector<int> v[N]; void del(int x, int y) { v[x].erase(find(v[x].begin(), v[x].end(), y)); v[y].erase(find(v[y].begin(), v[y].end(), x)); } int f[N], rk[N]; lll dfs(int pos, i... |
`ifndef _rs
`define _rs
module rs (
input rst,
input clk,
input [2:0] inst_type,
input [4:0] rs,
input [4:0] rt,
input [4:0] rd,
input [15:0] imm,
input [31:0] seimm,
input [31:0] ... |
<?
if (elem.Label="")
panic("err_lutNeedsALabelToBeExported");
lutSize := 1 << elem.Inputs;
moduleName = format("LUT_%s", elem.Label);
if (elem.Bits > 1)
export dBitRange := format(" [%d:0] ", elem.Bits - 1);
else
export dBitRange := " ";
?>module <?= moduleName ?> (
<?- fo... |
// ***************************************************************************
// ***************************************************************************
// 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; int main() { int n; cin >> n; vector<vector<int> > a(n, vector<int>(n)); vector<int> b(n * n), q(n * n); for (int i = 0; i < n * n; ++i) { cin >> b[i]; q[i] = i; } do { for (int i = 0; i < n; ++i) for (int j = 0; j <... |
//////////////////////////////////////////////////////////////////////
//// ////
//// endpMux.v ////
//// ////
//// This file is part of the usbhos... |
`timescale 1ns / 1ps
module rinse_mode_tb();
reg [31:0]clk;
wire [31:0]rinse_count;
wire [2:0]state;
reg start, power, rinse_start;
reg [2:0]weight;
wire water_in_light, rinsing_light, rinse_end_sign, water_out_light, dewatering_light;
wire [2:0]water_level;
parameter TIME = 1000;
... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e5 + 10; int n; vector<int> vec[MAXN]; map<int, pair<int, int> > mp; int main() { cin >> n; cin.tie(0); for (int i = 0; i < n; i++) { int t; cin >> t; vec[i].resize(t); int sm = 0; for (int j = 0; j < t... |
#include <bits/stdc++.h> using namespace std; long long mod = 1e9 + 7; long long q[500009]; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long n; cin >> n; long long sum = 0; long long mini = 0; for (long long i = 1; i < n; i++) { ci... |
#include <bits/stdc++.h> using namespace std; #pragma warning(disable : 4996) const long double PI = 3.14159265358979323846; const long long MOD = 998244353; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); void solve() { int n; cin >> n; vector<int> a(n); map<int, deque<... |
//////////////////////////////////////////////////////////////////////
//// ////
//// Generic Single-Port Synchronous RAM ////
//// ////
//// This file is part of memory li... |
/* SPDX-License-Identifier: MIT */
/* (c) Copyright 2018 David M. Koltak, all rights reserved. */
/*
* rcn bus asynchronous bridge.
*
*/
module rcn_bridge_async
(
input main_rst,
input main_clk,
input sub_clk,
input [68:0] main_rcn_in,
output [68:0] main_rcn_out,
input [68:0] sub_rcn_in,
... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:256000000 ) using namespace std; const int INF = (int)(1e9 + 1337); const long long LINF = (long long)(2e18); const double EPS = 1e-11; const int MAXN = 200100; string a; void solve() { cin >> a; a += # ; int cur = 0; int sz = 0; ... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e, f; cin >> a >> b >> c >> d >> e >> f; long k = min(d, min(c, b)); long m = min(a, d); long cost = 0; if (e > f) { d = d - m; cost = m * e + min(d, min(c, b)) * f; } else { d = d - k; cos... |
// megafunction wizard: %ROM: 1-PORT%VBB%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: altsyncram
// ============================================================
// File Name: bg3_new.v
// Megafunction Name(s):
// altsyncram
//
// Simulation Library Files(s):
// altera_mf
// ============================... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); string s; cin >> s; string a(s); int n; cin >> n; for (int i = 0; i < int(s.size()); ++i) { if (isupper(s[i])) { s[i] -= A ; s[i] += a ; } if (... |
#include <bits/stdc++.h> using namespace std; int dp[1000000], arr[1000000]; int main() { int fi = 1, se = 1; int n; cin >> n; int last = 20; for (int i = 1; i <= n; i++) { int x; cin >> x; arr[i] = x; if (i == 1) { cout << 20 << n ; dp[i] = 20; ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); int n; cin >> n; bool taken[n + 1]; for (int i = 0; i < n + 1; i++) taken[i] = 0; int cc = 0; for (int i = 1; i < n + 1; i++) { for (int j = 1; j <= n; j++) { int a; cin >> a; ... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 19:15:51 10/19/2015
// Design Name:
// Module Name: UART_TestModule
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies... |
#include <bits/stdc++.h> using namespace std; template <typename T> inline void checkMax(T& a, const T& b) { if (a < b) a = b; } template <typename T> inline void checkMin(T& a, const T& b) { if (a > b) a = b; } const int kMod = 1000000007; template <typename U, typename V> inline void addMo... |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-10; int dblcmp(double d) { if (fabs(d) < eps) return 0; return (d > 0) ? 1 : -1; } int n, m, T; bool win(long long a, long long b) { if (a * b == 0) return false; if (a > b) swap(a, b); if (!win(a, b % a)) return 1; ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); int n; cin >> n; long long a[n], sum = 0; for (int i = 0; i < n; i++) { cin >> a[i]; sum += a[i]; } if (sum % 2 == 1 || n == 1) { cout << NO ; ... |
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<int, int>> v; for (int i = 0; i < n; i++) { int l, r; cin >> r >> l; v.push_back(make_pair(l, r)); } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); int len = v.size(); ... |
#include <bits/stdc++.h> int ss[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53}; int n, a[200], f[120][(1 << 16) + 10], b[100], g[120][(1 << 16) + 10]; void outit(int x, int y) { if (y == 0) return; outit(x & ~b[g[y][x]], y - 1); printf( %d , g[y][x]); if (y == n) printf( 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 law... |
#include <bits/stdc++.h> using namespace std; const long long N = 2e3 + 5, mod = 998244353, inf = 1e18 + 7; long long dp[N][N]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long n, m, k; cin >> n >> m >> k; for (long long i = 0; i <= n; i++) { dp[i][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... |
`timescale 1ns / 1ps
module flashLED(
output reg [7:0] oLED,
input iCLK_50,
input [3:0] iSW,
input in,
input reset
);
parameter cN = 24;
reg [1:0] speed;
reg direction;
reg enable, enable_cnt;
reg [cN:0] CLKs, CLKs_cnt;
wire edge_out;
reg [1:0] edge_in;
edge_detect ed(iCLK_50, reset, edge_in[1], edge_out);
always... |
#include <bits/stdc++.h> using namespace std; int x[2010], y[2010]; long long nc2(long long n) { return (n * n - n) / 2LL; } int main() { int T, n, caseNo = 0; map<pair<int, int>, long long> cnt; scanf( %d , &n); for (int i = 0; i <= n - 1; i++) { scanf( %d %d , &x[i], &y[i]); x[i] *... |
#include <bits/stdc++.h> using namespace std; int a[100000]; int main() { int n, h; cin >> n >> h; for (int i = 0; i < (int)(n); i++) cin >> a[i]; int head = min_element(a, a + n) - a; sort(a, a + n); int ret1 = max(a[0] + a[n - 1] + h, a[n - 1] + a[n - 2]) - min(a[1] + a[2]... |
#include <bits/stdc++.h> using namespace std; long long res, mx, r1, r2; int main() { long long h, w, p, q; cin >> h >> w; p = 1; while (p <= h) { if (p > h) break; q = (long long)(p / 4.0 * 5.0); if (q > w) q = w; if ((long long)(q / 4.0 * 5.0) < p) break; if (p * q ... |
// Name: WcaWriteByteReg.v
//
// Copyright(c) 2013 Loctronix Corporation
// http://www.loctronix.com
//
// 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 Lic... |
#include <bits/stdc++.h> using namespace std; const int MAX = 200500; int inp[MAX]; int out[MAX]; bool flag[MAX]; map<long long, int> ID; map<long long, int> hasInp; namespace hopcroftKarp { int ptr[100011], next[200011], zu[200011]; int n, m, match[100011], D[100011], q[100011]; void init(int _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... |
#include <bits/stdc++.h> const double PI = acos(-1.0); using namespace std; char p[102][102]; int main() { int n; scanf( %d n , &n); for (int i = 1; i <= n; ++i) { for (int j = 1; j <= n; ++j) p[i][j] = getchar(); getchar(); } bool foo = true; for (int i = 1; i <= n; ++i) { ... |
#include <bits/stdc++.h> using namespace std; long long t; long long n; int x; int main() { ios::sync_with_stdio(0); cin.tie(), cout.tie(); cin >> t; while (t--) { cin >> n; set<int> s; int count = 0; for (int i = 0; i < n; i++) { cin >> x; if (s.find(x)... |
#include <bits/stdc++.h> using namespace std; double y111, y222, yw, xb, yb, r; double ASIN(double w) { if (w < -1.0) w = -1.0; if (w > 1.0) w = 1.0; return asin(w); } int main() { cin >> y111 >> y222 >> yw >> xb >> yb >> r; y111 += 1E-9; y222 -= 1E-9; double st = yw - r; doubl... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 03/06/2016 02:02:25 PM
// Design Name:
// Module Name: mdct_myidct
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
/... |
/*
* PicoSoC - A simple example SoC using PicoRV32
*
* Copyright (C) 2017 Clifford Wolf <>
*
* 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 fpow(long long n, long long k, long long p = 1000000007) { long long r = 1; for (; k; k >>= 1) { if (k & 1) r = r * n % p; n = n * n % p; } return r; } long long inv(long long a, long long p = 1000000007) { return fpow(a, p ... |
/*
* Copyright 2017 Google 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
#include <bits/stdc++.h> using namespace std; void qSort(int *A, int low, int high, int *ii) { int i = low; int j = high; int x = A[(low + high) / 2]; do { while (A[i] < x) ++i; while (A[j] > x) --j; if (i <= j) { int temp = A[i]; int buf = ii[i]; ii[i] = ii... |
/**
* 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 n, k; vector<long long> v; int main() { if (fopen( a.txt , r )) { freopen( a.txt , r , stdin); } else ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> k; if (k >= 1e6) { cout << -1; exit(0); }; ... |
// -------------------------------------------------------------
//
// Generated Architecture Declaration for rtl of inst_10_e
//
// Generated
// by: wig
// on: Mon Jun 26 08:25:04 2006
// cmd: /cygdrive/h/work/eclipse/MIX/mix_0.pl ../../generic.xls
//
// !!! Do not edit this file! Autogenerated by MIX !!!
// $Aut... |
#include <bits/stdc++.h> using namespace std; char p[120], A[10100][120], B[10100][120], res[120]; int SA[110], SB[110], Z[110], Pre[110]; int SS[110], Suf[110]; void Do(int n) { int i, j; printf( ? %d %d n , 1, n); fflush(stdout); for (i = 0; i < n * (n + 1) / 2; i++) { scanf( %s , A[i]... |
#include <bits/stdc++.h> using namespace std; long long d[61]; int ans; int n, a[200005]; void insert() { for (int i = 1; i <= n; i++) { long long x = a[i]; for (int j = 60; j >= 0; j--) if (x & (1LL << j)) { if (d[j] == 0) { d[j] = x; ans++; ... |
#include <bits/stdc++.h> using namespace std; const int N = 1e9 + 7; int main() { string s; cin >> s; int ans = 0; int t = 0; for (int i = s.length() - 1; i >= 0; i--) { if (s[i] == b ) t = (t + 1) % N; else { ans = (ans + t) % N; t = (t * 2) % N; } ... |
#include <bits/stdc++.h> using namespace std; int main() { int n, i; cin >> n; if (n & 1) { for (i = 0; i < n; i++) cout << (i) << ; cout << n ; for (i = 0; i < n; i++) cout << (i) << ; cout << n ; for (i = 0; i < n; i++) cout << ((2 * i) % n) << ; cout <... |
#include <bits/stdc++.h> using namespace std; bool cmp(long long int a, long long int b) { return b < a; } int main() { long long int n; cin >> n; long long int a[n + 1]; for (int i = 1; i <= n; i++) { scanf( %lld , &a[i]); } sort(a + 1, a + n + 1, cmp); long long int ans = 0; ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 305; long long dp[maxn][maxn][6]; int n, x[maxn], y[maxn]; vector<pair<double, pair<int, int>>> seg; int main() { ios_base::sync_with_stdio(0); cin >> n; for (int i = 0; i < n; i++) cin >> x[i] >> y[i]; for (int i = 0; i < n; i++... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 03/13/2016 05:51:29 PM
// Design Name:
// Module Name: Testbench_Barrel_Shifter
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Depende... |
module tone_lut16 (input [5:0] tone, output [15:0] sixteenth_period);
//these constants define the number of 100Mhz cycles needed to emulate each note frequency, divided by 16 to get
//a 16th of the waveform, to use PWM accurately
parameter
// Need to add C3 to G3, also all sharps and flats
C3 = 16'd47... |
#include <bits/stdc++.h> using namespace std; int k[3]; long long t[200000]; long long c[200000]; int n; long long T[3]; long long nt[200000]; multiset<long long> s; int main(void) { for (int i = 0; i < 3; i++) scanf( %d , &k[i]); for (int i = 0; i < 3; i++) scanf( %I64d , &T[i]); scanf(... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; string s[t]; for (int i = 0; i < t; i++) { cin >> s[i]; } map<string, int> m; for (int j = 0; j < t; j++) { for (int l = 1; l <= 9; l++) { for (int i = 0; i < 10 - l; i++) { string p... |
#define DEBUG 0 #include <bits/stdc++.h> using namespace std; #if DEBUG // basic debugging macros int __i__,__j__; #define printLine(l) for(__i__=0;__i__<l;__i__++){cout<< - ;}cout<<endl #define printLine2(l,c) for(__i__=0;__i__<l;__i__++){cout<<c;}cout<<endl #define printVar(n) cout<<#n<< : <<n<... |
#include <bits/stdc++.h> using namespace std; int n, l, r; int ans[1000000 + 5]; long long mmod = 2333, mod = 1e9 + 7; long long shash[1000000 + 5], base[1000000 + 5]; char s[1000000 + 5]; int main() { scanf( %d%s , &n, s + 1); base[0] = 1; for (int i = 1; i <= n; i++) { shash[i] = (shas... |
#include <bits/stdc++.h> using namespace std; void Read(int &x) { static char c; while (!isdigit(c = getchar())) ; x = (c ^ 48); while (isdigit(c = getchar())) x = x * 10 + (c ^ 48); return; } void Print(int x, char end) { static int i; for (i = 1; i * 10LL <= x; i *= 10) ... |
#include <bits/stdc++.h> namespace Factor { const int N = 1010000; int64_t C, fac[10010], n, mut, a[1001000]; int T, cnt, i, l, prime[N], p[N], psize, _cnt; int64_t _e[100], _pr[100]; std::vector<int64_t> d; inline int64_t mul(int64_t a, int64_t b, int64_t p) { if (p <= 1000000000) return a * b ... |
#include <bits/stdc++.h> using namespace std; char ss[100050]; char b[12][12]; int len[12]; int n, m; bool g[100050][11]; bool f[100050][11]; int dp[100050]; struct Node { int a, b; }; int main() { int ll, pos; bool tmp; scanf( %s , ss); n = strlen(ss); scanf( %d , &m); ... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); int n, x[100005]; cin >> n; for (int i = 1; i <= n; i++) cin >> x[i]; sort(x + 1, x + 1 + n); for (int i = 2; i <= n; i++) if (x[i - 1] * 2 > x[i] && x[i - 1] != x[i]) return cout << YES , 0; ... |
#include <bits/stdc++.h> using namespace std; void solve() { long long int k; cin >> k; string s = codeforces ; long long int a[10]; long long int cnt = 1; for (int i = 0; i < 10; ++i) { a[i] = 1; } int idx = 0; while (cnt < k) { a[idx]++; cnt = 1; for (i... |
#include <bits/stdc++.h> using namespace std; int main() { long long m, n; cin >> m >> n; double sum; sum = m; for (double i = m - 1; i > 0; i--) { sum -= pow(i / m, n); } cout << fixed; cout << setprecision(12) << sum << n ; return 0; } |
#include <bits/stdc++.h> using namespace std; const long long int INF = 1e9 + 7; long long int gcd(long long int a, long long int b) { if (a == 0) return b; return gcd(b % a, a); } long long int lcm(long long int a, long long int b) { return (a / gcd(a, b)) * b; } long long int sq(long long in... |
/**
* 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 s; cin >> s; int n = s.length(); vector<vector<int> > pos( z - a + 1); for (int i = 0; i < n; i++) pos[s[i] - a ].push_back(i); int good = 0; for (int c = 0; c <= z - a ; c++) { if (pos[c].empty()) continue; ... |
/**
* 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: mmcm_mkid_exdes.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 ... |
#include <bits/stdc++.h> using namespace std; long long int div_floor(const long long int &a, const long long int &b) { return a / b - (((a ^ b) < 0) and a % b); } long long int div_ceil(const long long int &a, const long long int &b) { return a / b + (((a ^ b) >= 0) and a % b); } long long int diff... |
#include <bits/stdc++.h> using namespace std; const int N = 200000; pair<int, bool> p[N * 2]; pair<int, int> t[N]; int main() { int n; scanf( %d , &n); int l, r; for (int i = 0; i < n; ++i) { scanf( %d%d , &l, &r); t[i] = make_pair(l, r); p[i * 2].first = l; p[i * 2].se... |
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 02/13/2016 08:27:22 PM
// Design Name:
// Module Name: FullAdder
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// ... |
/**
* 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 bsg_mux #(
parameter `BSG_INV_PARAM(width_p ),
parameter `BSG_INV_PARAM(els_p ),
parameter harden_p = 1,
parameter balanced_p = 0,
parameter lg_els_lp = `BSG_SAFE_CLOG2(els_p)
) (
input [els_p-1:0][width_p-1:0] data_i,
input [lg_els_lp-1:0] sel_i,
output [width_p-1: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... |
/**
* 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... |
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// Logic Core: PCI Express Megacore Function
// Company: Altera Corporation.
// www.altera.com
// Author: IPBU... |
/////////////////////////////////////////////////////////////////////
//// Author: Zhangfeifei ////
//// ////
//// Advance Test Technology Laboratory, ////
//// Institute of Computing Techn... |
#include <bits/stdc++.h> using namespace std; const int MAX_N = (int)2e5 + 7; long long dp[MAX_N]; long long num[MAX_N][2]; long long dist[MAX_N][2]; vector<int> a[MAX_N]; long long ans = 0; void go(int v, int pr = -1) { ++num[v][0]; for (int to : a[v]) { if (to == pr) continue; go(t... |
// (C) 2001-2016 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 doc... |
#include <bits/stdc++.h> using namespace std; int ar[7]; int N, K; map<vector<int>, double> M[5]; int bit[20]; void update(int x) { while (x <= N) { bit[x] += 1; x += (x & -x); } } int qry(int x) { int rs = 0; while (x) { rs += bit[x]; x -= (x & -x); } ret... |
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2013 by Ted Campbell.
//With MULTI_CLK defined shows bug, without it is hidden
`define MULTI_CLK
//bug634
module t (
input i_clk_wr,
input ... |
/* This file is part of JT12.
JT12 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.
JT12 is distributed in the hope tha... |
/******************************************************************************
* License Agreement *
* *
* Copyright (c) 1991-2012 Altera Corporation, San Jose, California, USA. *
... |
//altera message_off 10036
`timescale 1 ps / 1 ps
module alt_mem_ddrx_ecc_encoder #
( parameter
CFG_DATA_WIDTH = 40,
CFG_ECC_CODE_WIDTH = 8,
CFG_ECC_ENC_REG = 0,
CFG_MMR_DRAM_DATA_WIDTH = 7,
CFG_MMR_LOCAL_DATA_WIDTH = 7,
... |
#include <bits/stdc++.h> using namespace std; using longInt = long long; const int maxL = 204; int r[maxL], g[maxL], b[maxL], l[3]; longInt f[maxL][maxL][maxL]; void get_array(int *a, int n) { for (int i = 1; i <= n; ++i) cin >> a[i]; sort(a + 1, a + n + 1, [](int x, int y) -> bool { return x > y; }... |
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
// --------------------------------------------------------------------------------
// Tool Version: Vivado v.2018.2 (win64) Build Thu Jun 14 20:03:12 MDT 2018
// Date : Sun Sep 22 02:35:49 2019
// Host : varun-laptop running 64-bit Service Pac... |
#include <bits/stdc++.h> using namespace std; int main() { int t, n; scanf( %d , &t); while (t--) { scanf( %d , &n); for (int i = n * 4, cnt = 1; cnt < n; cnt++, i -= 2) printf( %d , i); printf( %d n , n * 2 + 2); } return 0; } |
#include <bits/stdc++.h> using namespace std; int main() { int q = 1, i, j; while (q--) { int n, r; cin >> r >> n; vector<int> t(n + 1), x(n + 1), y(n + 1); t[0] = 0, x[0] = 1, y[0] = 1; for (i = 1; i < (n + 1); i++) { cin >> t[i] >> x[i] >> y[i]; } vector<i... |
#include <bits/stdc++.h> using namespace std; const long long N = 1e6 + 7; long long n, q; long long a[N]; long long l[N], r[N]; void read() { cin >> n >> q; for (long long i = 0; i < n; ++i) cin >> a[i]; for (long long i = 0; i < q; ++i) cin >> l[i]; for (long long i = 0; i < q; ++i) cin >>... |
module station_management_tb ();
reg reset;
reg clock;
wire mdc;
reg mdi;
wire mdo;
reg mode;
reg begin_transaction;
reg [4:0] phy_address;
reg [4:0] reg_address;
reg [15:0] data_in;
wire [15:0] data_out;
station_management U_station_management
(
.reset(reset),
.clock(clock),
.mdc(mdc),
.mdi... |
/*
* 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> #pragma comment(linker, /STACK:100000000,100000000 ) using namespace std; const long long inf = 1e9 + 7; const long long mod = 1e9 + 7; const double eps = 1e-9; const double PI = 2 * acos(0.0); const double E = 2.71828; int main(void) { long long n; cin >> n; double... |
/**
* 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.