text stringlengths 59 71.4k |
|---|
module MPUC924_383 ( CLK,DS ,ED, MPYJ,C383,DR,DI ,DOR ,DOI );
parameter total_bits = 32;
input CLK ;
wire CLK ;
input DS ;
wire DS ;
input ED; //data strobe
input MPYJ ; //the result is multiplied by -j
wire MPYJ ;
input C383 ; //the coefficient is 0.383
wire C383 ;
input [total_bits-1:0] DR ;
... |
#include <bits/stdc++.h> #pragma GCC target( sse ) const int maxn = 2e5 + 5; struct IO { char c; inline char gc() { static char buf[maxn], *p1 = buf, *p2 = buf; return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, maxn, stdin), p1 == p2) ? EOF : *p1++; } ... |
// ZX-Evo Base Configuration (c) NedoPC 2008,2009,2010,2011,2012,2013,2014
//
// VGA scandoubler
/*
This file is part of ZX-Evo Base Configuration firmware.
ZX-Evo Base Configuration firmware is free software:
you can redistribute it and/or modify it under the terms of
the GNU General Public License a... |
#include <bits/stdc++.h> #pragma warning(disable : 4786) #pragma comment(linker, /STACK:102400000,102400000 ) using namespace std; const double eps = 1e-8; const double PI = acos(-1.0); const int MAXN = 200005; const int mod = 1000000007; const long long llinf = (long long)(1e18) + 500; const int inf... |
//
// Copyright 2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is dis... |
/*============================================================================
This Verilog source file is part of the Berkeley HardFloat IEEE Floating-Point
Arithmetic Package, Release 1, by John R. Hauser.
Copyright 2019 The Regents of the University of California. All rights
reserved.
Redistribution an... |
/*******************************************************************************
* This file is owned and controlled by Xilinx and must be used solely *
* for design, simulation, implementation and creation of design files *
* limited to Xilinx devices or technologies. Use with non-Xilinx ... |
/**
* 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> #pragma GCC optimize(2) using namespace std; long long n, m, cost[105], fri[105], cst, need[105], sscc[110], ss, pd[30], now[30], nn; bool qc[1200000], ttp, ttp2, ttp3, ttp4, ttp5, ttp6; map<pair<long long, long long>, long long> ans; map<long long, long long> jl1, jl2, jl3; ... |
#include <bits/stdc++.h> using namespace std; struct s { int x; int y; int str; s(int a, int b, int st) { x = a; y = b; str = st; } }; bool func(s x, s y) { return x.str > y.str; } int main() { int n; cin >> n; vector<s> v; for (int i = 2; i <= 2 * n; i++)... |
#include <bits/stdc++.h> #pragma comment(linker, /STACK:16777216 ) using namespace std; const double eps = 1e-9; const double pi = acos(-1.0); const int maxn = (int)1e4 + 10; long long a[maxn], v[maxn], b[maxn]; long long gcd(long long A, long long B) { A = abs(A); B = abs(B); while (B != 0) ... |
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int n; cin >> n; vector<int> cand(26, 1); string t, w; int f = 0, ans = 0; for (int i = 0; i < n - 1; i++) { cin >> t >> w; if (f == 1) { ans += (t == ! || t == ? ); continue... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, k; cin >> n >> k; int sum = 0; sum += 2 * n / k; if (2 * n % k != 0) sum++; sum += 5 * n / k; if (5 * n % k != 0) sum++; sum += 8 * n / k; if (8 * n % k != 0... |
// Generated by DDR3 High Performance Controller 11.1 [Altera, IP Toolbench 1.3.0 Build 173]
// ************************************************************
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
// ************************************************************
// Copyright (C) 1991-2012 Altera Co... |
// =============================================================================
// COPYRIGHT NOTICE
// Copyright 2006 (c) Lattice Semiconductor Corporation
// ALL RIGHTS RESERVED
// This confidential and proprietary software may be used only as authorised by
// a licensing agreement from Latt... |
#include <bits/stdc++.h> using namespace std; long long query(long long t, long long i, long long j, long long k) { cout << t << << i << << j << << k << << n ; cout.flush(); long long res; cin >> res; return res; } void solve() { long long n; cin >> n; long long... |
#include <bits/stdc++.h> using namespace std; long long n, m, i, j, k, mod, dp[605][605], rd[605], xs[605][605], ans = 1; vector<long long> ts, bi[605], nrd, ncd; long long gcd(long long x, long long y) { if (y == 0) return x; return gcd(y, x % y); } long long lcm(long long x, long long y) { return ... |
/*
* Copyright 2012, Homer Hsing <>
*
* 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 ... |
//Legal Notice: (C)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
//simulation files), and any associated do... |
#include <bits/stdc++.h> using namespace std; template <typename T> inline T Abs(const T& value) { return value < 0 ? -value : value; } template <typename T> inline T Sqr(const T& value) { return value * value; } const int maxn = 110; int a[maxn][maxn]; int main() { int k; int n = 0;... |
#include <bits/stdc++.h> using namespace std; struct node { int v, id, tag; } a[100010]; int cmp1(node x, node y) { return x.v < y.v; } int cmp2(node x, node y) { return x.id < y.id; } int ccount[100010]; int main() { int n, tt; scanf( %d , &n); for (int i = 1; i <= n; i++) scanf( %d , &a[... |
#include <bits/stdc++.h> using namespace std; int ar[2111111], br[2111111], cr[2111111], dr[2111111]; int main() { cin.sync_with_stdio(false); int n, i, j, x, y, pos, m; cin >> n; for (i = 1; i <= n; i++) { cin >> ar[i]; if (ar[i] == 0) pos = i; } for (i = n + 1; i < n + n; i++... |
// (c) Copyright 1995-2015 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 ... |
module branch_wait
(/*AUTOARG*/
// Outputs
pending_branches_arry,
// Inputs
clk, rst, alu_valid, alu_branch, alu_wfid, f_salu_branch_en,
f_salu_branch_wfid
);
input clk, rst;
// Issued alu info
input alu_valid, alu_branch;
input [`WF_ID_LENGTH-1:0] alu_wfid;
// Salu signals with ... |
/*
* 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 k25 = 0, k50 = 0, n; cin >> n; bool f = 1; for (int i = 0; i < n; i++) { int q; cin >> q; if (q == 25) k25++; else if (q == 50) { if (k25) { k25--; k50++; } else ... |
/*
* 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 = 1e5 + 100; int h[N], nex[N << 1], to[N << 1], tot, dis[N]; void add(int x, int y) { to[++tot] = y; nex[tot] = h[x]; h[x] = tot; } int fa[N][30], dep[N], lg[N]; void dfs(int u, int fath, int d) { dis[u] = d; fa[u][0] = fath; ... |
#include <bits/stdc++.h> using namespace std; const int N = 200005, mod = 1e9 + 7; int n, head[N], nxt[N << 1], to[N << 1], num = 0, dfn[N], DFN = 0, a[N], dep[N]; inline void link(int x, int y) { nxt[++num] = head[x]; to[num] = y; head[x] = num; } namespace tr { int fa[N], top[N], sz[N], son[... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int n, k; cin >> n >> k; int i = 1; for (i = k - 1; i > 0; i--) { if ((n % i) == 0) break; } if (i == 0) i = 1; int x = (n / i) * k; for (; x % k != i;... |
#include <bits/stdc++.h> using namespace std; int main() { int t, fl; cin >> t; while (t--) { fl = 1; int a, b, c, d, x, y, x1, y1, x2, y2; cin >> a >> b >> c >> d >> x >> y >> x1 >> y1 >> x2 >> y2; int p = x - a + b, q = y - c + d; if ((p >= x1 && p <= x2) && (x1 < x2 || a... |
#include <bits/stdc++.h> using namespace std; const long long MOD = (long long)1e9 + 7; long long dp[12][65][1024], dp0[12][65][1024]; void upd(long long &a, long long b) { a = (a + b); } int get_next(int a, int b) { if ((a & (1 << b)) == 0) { a += (1 << b); } else { a -= (1 << b); } ... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company: Adam LLC
// Engineer: Adam Michael
//
// Create Date: 21:40:37 09/26/2015
// Design Name: Multiplication
// Module Name: C:/Users/adam/Documents/GitHub/Digital Systems/MultiplicationUnit/Multiplicati... |
/*
* Milkymist 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 distribut... |
#include <bits/stdc++.h> using namespace std; const int INF = 2000000000; const int MAX = 10000000; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; while (cin >> n) { map<string, int> m; for (int i = 0; i < n; i++) { string s; cin >> s; m[s]++; ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2008 by Lane Brooks
`define WIDTH 2
module top (
input OE1,
input OE2,
input [`WIDTH-1:0] A1,
input [`WIDTH-1:0] A2,
output [`WIDTH-1:0] Y1,
output [`WIDTH-1:0] Y2,
output [`WIDTH-1:0] Y3,
output [`WI... |
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; char **a = new char *[n]; for (int i = 0; i < n; i++) { a[i] = new char[m + 1]; cin >> a[i]; } for (int i = 0; i < n; i++) for (int j... |
/*
* 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... |
//======================================================================
//
// Design Name: PRESENT Block Cipher
// Module Name: PRESENT_ENCRYPT_PBOX
// Language: Verilog-2001
//
// Description: Permutation Layer (p-Layer or p-box) of PRESENT Encryption
//
// Dependencies: none
//
// Designer: Saied H. Kha... |
/**
* 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; int main() { int T; scanf( %d , &T); while (T--) { scanf( %I64d , &n); for (long long i = n;; i += i) if (i * (n + 1) % (4 * n) == 0) { printf( %I64d n , i + 1); break; } } return 0; } ... |
`default_nettype none
module SysPLL(
// interface 'refclk'
input wire refclk,
// interface 'reset'
input wire rst,
// interface 'outclk0'
output wire sdr_clk,
// interface 'outclk1'
output wire sys_clk,
// interface 'outclk2'
output wire vga_clk,
output wire pit_clk,
// interface 'locked'
ou... |
/*888888888 .d88888b. 8888888b.
888 d88P" "Y88b 888 Y88b
888 888 888 888 888
888 888 888 888 d88P
888 888 888 8888888P"
888 888 888 888
888 Y88b. .d88P 888
888 "Y88888P" 8*/
`include "timescale.v"
module top_test... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1000001; int n, t; int p[MAXN], s[MAXN]; stack<int> st; int main() { scanf( %d n , &n); for (int i = 1; i <= n; ++i) scanf( %d , &p[i]); scanf( %d , &t); for (int i = 1; i <= t; ++i) { int x; scanf( %d , &x); p[... |
/**
* 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 maxtop = 1025; const int maxn = 100010; const int mo = 1000000007; int top; int repeat[maxtop + 1]; int rest; int a[maxn + 1]; int n, K; int C[maxn + 1]; int f[2][maxtop + 1], old, now; long long result; void init() { int i; scanf... |
#include <bits/stdc++.h> using namespace std; template <typename T> inline T qmin(const T &x, const T &y) { return x < y ? x : y; } template <typename T> inline T qmax(const T &x, const T &y) { return x > y ? x : y; } template <typename T> inline void getmin(T &x, const T &y) { if (y < x) ... |
module note2dds_4st_gen(clk, note, adder);
input wire clk;
input wire [6:0] note;
output [31:0] adder;
reg [31:0] adder_tbl [15:0];
reg [3:0] addr;
reg [3:0] divider;
// note div 12 ( * 0,08333333333333333333333333333333)
//; Add input / 16 to accumulator
//; Add input / 64 to accumulator
initial begin
addr <= 4... |
#include <bits/stdc++.h> using namespace std; vector<int> a, b, e; char s[5]; long long ans; int c; int main() { int n, f; scanf( %d , &n); while (n--) { scanf( %s %d , &s, &f); if (s[0] == 0 && s[1] == 1 ) a.push_back(f); else if (s[0] == 1 && s[1] == 0 ) ... |
#include <bits/stdc++.h> using namespace std; long long n, ans, val[3001000]; priority_queue<int> q; int main() { scanf( %lld , &n); for (int i = 1; i <= n; i++) scanf( %lld , &val[i]); for (int i = 1; i <= n; i++) { q.push(-val[i]); q.push(-val[i]); ans += val[i] + q.top(); ... |
#include <bits/stdc++.h> using namespace std; using lint = long long; using pi = pair<int, int>; const int MAXN = 1005; const int MAXM = 1005; struct edge_color { int deg[2][MAXN]; pi has[2][MAXN][MAXN]; int color[MAXM]; int c[2]; void clear(int n) { for (int t = 0; t < 2; t++) { ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long int n, x; cin >> n >> x; long long int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int j = 1, teams = 0; for (int i = n - 1; ... |
/*
Name: ClockRecoverSetCounter
Attempts to recover a clock from a serial signal whose frequency is known, set,
and equal to system clock frequency divided by some integer. Reclocked serial
data is then output along with a clock strobe.
Faster is pretty much always better for this type of function, so the clock
re... |
#include <bits/stdc++.h> using namespace std; int n, x, i, a[200], s1, s2, j = 2; string can = YES ; int main() { cin >> n; cin >> x; x = 7 - x; for (i = 0; i < n * 2; i++) { cin >> a[i]; } for (i = 1; i < n; i++) { s1 = a[j]; s2 = a[j + 1]; if (x == s1 || x == s... |
#include <bits/stdc++.h> using namespace std; ifstream fin( input ); void init() { cin.tie(NULL); ios_base::sync_with_stdio(false); } struct operation { int i, j, x; }; int n; vector<int> v; vector<int> cpy; vector<operation> ops; void simul() { for (operation x : ops) { cpy[... |
#include <bits/stdc++.h> using namespace std; long long powm(long long base, long long exp, long long mod = 1000000009) { long long ans = 1; while (exp) { if (exp & 1) ans = (ans * base) % mod; exp >>= 1, base = (base * base) % mod; } return ans; } long long ctl(char x, char an = a ... |
#include <bits/stdc++.h> using namespace std; const int maxn = 1000010; const long long inf = (1ll << 58ll); int k, n, q; int ten[10] = {1, 10, 100, 1000, 10000, 100000}; long long F[7]; long long dp[maxn], g[7][maxn]; long long read() { long long s = 0, f = 1; char ch = getchar(); while (ch... |
import "DPI-C" function string fna (input string str1);
export "DPI" c_identifier = task task_identifier;
import "DPI" context function string fnb (input string str1);
module testbench;
import "DPI" function string fn1 (input string str1);
import "DPI-C" function void dpiWriteArray (input bit[7:0] data[])... |
// Copyright 2021 The CFU-Playground 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law ... |
#include <bits/stdc++.h> using namespace std; int n; void solve() { if (n <= 3) printf( NO n ); else if (n == 4) { printf( YES n ); printf( 2 * 3 = 6 n ); printf( 6 * 4 = 24 n ); printf( 24 * 1 = 24 n ); } else if (n == 5) { printf( YES n ); printf( 1 + 5 = 6 ... |
#include <bits/stdc++.h> using namespace std; long long int _seive_size; bitset<1000000> bs; vector<long long int> primes; void seive(long long int upperbound) { _seive_size = upperbound + 1; bs.set(); bs[0] = bs[1] = 0; for (long long int i = 2; i <= _seive_size; i++) { if (bs[i]) { ... |
module platform(
input CLK_EXT,
output BUZZER_,
// control panel
input RXD,
output TXD,
output [7:0] DIG,
output [7:0] SEG,
// RAM
output SRAM_CE_, SRAM_OE_, SRAM_WE_, SRAM_UB_, SRAM_LB_,
output [17:0] SRAM_A,
inout [15:0] SRAM_D,
output F_CS_, F_OE_, F_WE_
);
localparam CLK_EXT_HZ = 50_000_000;
// --- M... |
#include <bits/stdc++.h> using namespace std; int digit(long long int n) { if (n > 0) return (digit(n / 10) + 1); return 0; } int main() { long long int l, h; long long int a[] = {0, 4, 49, 499, 4999, 49999, 499999, 4999999, 49999999, 49999999... |
`timescale 1 ps / 1 ps
//-----------------------------------------------------------------------------
// Title : PCI Express PIPE PHY connector
// Project : PCI Express MegaCore function
//-----------------------------------------------------------------------------
// File : altpcietb_pipe_phy.... |
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize( Ofast ) #pragma GCC optimize( unroll-loops ) template <class T, class U> istream &operator>>(istream &in, pair<T, U> &p) { in >> p.first >> p.second; return in; } template <class T, class U> ostream &operator<<(ostream &out, con... |
//Copyright (C) 1991-2013 Altera Corporation
//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 from any of the foregoing
//(including device programming or simulation files), and any
//associated documentatio... |
#include <bits/stdc++.h> using namespace std; string to_string(string s) { return + s + ; } string to_string(const char *s) { return to_string((string)s); } string to_string(bool b) { return (b ? true : false ); } template <typename A, typename B> string to_string(pair<A, B> p) { return ( + ... |
//
// Copyright 2011 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is dis... |
#include <bits/stdc++.h> using namespace std; long long power(long long x, long long y) { long long res = 1; while (y > 0) { if (y & 1) res = (res * x) % 998244353; y = y / 2; if (y != 0) x = (x * x) % 998244353; } return res; } int main() { ios_base::sync_with_stdio(false)... |
#include <bits/stdc++.h> using namespace std; int main() { char str[200]; int num, i, j, k; int pre = 0; char temp[10]; cin.getline(str, 200, n ); for (i = 0; str[i] != 0; i++) { num = str[i]; j = 0; while (num != 0) { k = num % 2; temp[j++] = k + 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... |
/**
* bp2wb_convertor.v
* DESCRIPTION: THIS MODULE ADAPTS BP MEMORY BUS TO 64-BIT WISHBONE
*/
module bp2wb_convertor
import bp_common_pkg::*;
import bp_me_pkg::*;
#(parameter bp_params_e bp_params_p = e_bp_unicore_no_l2_cfg
`declare_bp_proc_params(bp_params_p)
`declare_bp_bedrock_mem_if_widths(paddr_wid... |
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, d, e; scanf( %d%d%d%d%d , &a, &b, &c, &d, &e); if ((a + b + c + d + e) % 5 == 0 && a + b + c + d + e >= 5) printf( %d n , (a + b + c + d + e) / 5); else printf( -1 n ); } |
#include <bits/stdc++.h> using namespace std; const double eps = 1e-6; long long sum[200005]; long long sum2[200005]; long long a[200005]; int n; int sgn(double x) { if (fabs(x) < eps) return 0; return x > 0 ? 1 : -1; } struct point { long long x, y; point(){}; point(long long x, l... |
/*
* 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 n; int a[210000][3]; set<pair<int, int> > st; int nxt[210000][2]; int x[210000]; vector<pair<int, int> > re; map<long long, int> mp; int pp[210000]; long long hsh(int x, int y, int z) { if (y > z) swap(y, z); if (x > y) swap(x, y); if (y ... |
#include <bits/stdc++.h> using namespace std; int x[200005], y[200005], z[200005]; long long a[200005], b[200005]; int main() { long long n, t; cin >> n >> t; x[0] = 0; for (int i = 1; i <= n; i++) { cin >> a[i]; y[i] = 0; } for (int i = 1; i <= n; i++) { cin >> x[i]; ... |
#include <bits/stdc++.h> using namespace std; int arr[10][10]; double me[10][10]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n = 10; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> arr[i][j]; } } me[0][0] = 0.; me[0][1] = ... |
/*
* 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; long long n, k, cnt[200005], x, y, ans; vector<long long> v[200005]; void dfs(long long pos, long long pre) { long long len = v[pos].size(); for (long long i = 0; i < len; i++) { long long xx = v[pos][i]; if (xx != pre) { dfs(xx, pos); ... |
// megafunction wizard: %FIFO%
// GENERATION: STANDARD
// VERSION: WM1.0
// MODULE: scfifo
// ============================================================
// File Name: fifo_340_16.v
// Megafunction Name(s):
// scfifo
//
// Simulation Library Files(s):
// altera_mf
// ===============================... |
#include <bits/stdc++.h> using namespace std; const int MAXN = 1024; bool mark[MAXN][MAXN]; int a[MAXN][MAXN], b[MAXN][MAXN]; long long s[MAXN][MAXN]; int main() { int n, m, r, c; vector<pair<long long, pair<int, int> > > v, w; scanf( %d%d%d%d , &n, &m, &r, &c); for (int i = 1; i <= n; ++i) ... |
/**
* Copyright 2020 The SkyWater PDK Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
// ***************************************************************************
// ***************************************************************************
// Copyright 2014 - 2017 (c) Analog Devices, Inc. All rights reserved.
//
// In this HDL repository, there are many different and unique modules, consisting
// of... |
`timescale 1ns / 1ps
////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 13:07:30 07/02/2014
// Design Name: FONT5_base
// Module Name: H:/Firmware/FONT5_base/ISE13/FONT5_base/font5_base_TB.v
// Project Name: FONT5_base
// Target Device: ... |
#include <bits/stdc++.h> using namespace std; int dx[] = {0, 0, 1, -1, -1, -1, 1, 1}; int dy[] = {1, -1, 0, 0, -1, 1, 1, -1}; template <class T> inline T biton(T n, T pos) { return n | ((T)1 << pos); } template <class T> inline T bitoff(T n, T pos) { return n & ~((T)1 << pos); } template <cl... |
#include <bits/stdc++.h> using namespace std; template <typename T, typename U> ostream& operator<<(ostream& o, const pair<T, U>& x) { o << ( << x.first << , << x.second << ) ; return o; } template <typename T> ostream& operator<<(ostream& o, const vector<T>& x) { o << [ ; int b = 0; ... |
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; if ((n & (n - 1)) == 0) { cout << 0 << n ; } else { int k = 0; while ((1 << k + 1) <= n) { k++; } n ^= 1 << k; int ans = 0; ... |
// ====================================================================
// MAH PONK
//
// Copyright (C) 2007, Viacheslav Slavinsky
// This design and core is distributed under modified BSD license.
// For complete licensing information see LICENSE.TXT.
// ----------------------------... |
/*
* Copyright (c) Atomic Rules LLC, Auburn NH., 2009-2010
*
* Atomic Rules LLC
* 287 Chester Road
* Auburn, NH 03032
* United States of America
* Telephone
*
* This file is part of OpenCPI (www.opencpi.org).
* ____ __________ ____
* / __ \____ ___ ____ / ____... |
// Copyright 2020 The XLS 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
module alt_mem_ddrx_fifo
# (
parameter
CTL_FIFO_DATA_WIDTH = 8,
CTL_FIFO_ADDR_WIDTH = 3
)
(
// general
ctl_clk,
ctl_reset_n,
// pop free fifo entry
get_valid,
get_ready,
get_data,
// push free fifo entry
put_valid,
put_read... |
#include <bits/stdc++.h> using namespace std; long long MOD = 1000000007; long double EPS = 1e-9; long long binpow(long long b, long long p, long long mod) { long long ans = 1; b %= mod; for (; p; p >>= 1) { if (p & 1) ans = ans * b % mod; b = b * b % mod; } return ans; } voi... |
#include <bits/stdc++.h> #pragma GCC optimize( O3 ) using namespace std; const long long mod = 1e9 + 7; const long long inf = 1e9 + 7; vector<vector<int> > g; vector<bool> used; int main() { int n, m; cin >> n >> m; g.resize(n); used.resize(n, false); for (int i = 0; i < m; ++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; bool seen[100005], x[100005]; vector<int> g[100005], ans; inline void add(int u) { ans.push_back(u + 1), x[u] ^= 1; } void dfs(int u, int p) { seen[u] = true; add(u); for (auto v : g[u]) if (v != p && !seen[v]) dfs(v, u), add(u); if (x[u]) { ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.