結果
問題 | No.2239 Friday |
ユーザー | tada721 |
提出日時 | 2023-03-10 21:20:47 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 4,488 bytes |
コンパイル時間 | 1,579 ms |
コンパイル使用メモリ | 176,092 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-18 03:30:55 |
合計ジャッジ時間 | 2,208 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
コンパイルメッセージ
main.cpp: In function 'std::vector<long long int> dijstra(long long int, wgraph, long long int, bool)': main.cpp:163:1: warning: no return statement in function returning non-void [-Wreturn-type] 163 | } | ^
ソースコード
#include<bits/stdc++.h> using namespace std; #define ll long long #define int long long #define rep(s,i,n) for(int i=s;i<n;i++) #define rrep(s,i,n) for(int i=n-1;i>=s;i--) #define c(n) cout<<n<<endl; #define cd(d) cout<<setprecision(20)<<d<<endl; #define ic(n) int n;cin>>n; #define sc(s) string s;cin>>s; #define dc(d) double d;cin>>d; #define CY c("Yes") return 0; #define CN c("No") return 0; #define mod 998244353 #define mod2 1000000007 #define inf 2000000000000000000 #define P pair<int,int> #define f first #define s second #define pi 3.141592653589793238462643383279 #define pb push_back int gcd(int x,int y){ x=abs(x),y=abs(y); if(x==0||y==0)return x+y; if(x<y)swap(x,y); return gcd(x%y,y); } int lcm(int x,int y){ x=abs(x),y=abs(y); return x/gcd(x,y)*y; } int pow(int n,int m,int modulo){ int pro=1; int nn=n; while(m){ if(m%2==1)pro=pro*nn%modulo; m=m/2; nn=nn*nn%modulo; } return pro; } int inv(int n,int m,int modulo){ int t=pow(m,modulo-2,modulo); return n*t%modulo; } template<int MOD> struct Fp { long long val; constexpr Fp(long long v = 0) noexcept : val(v % MOD) { if (val < 0) v += MOD; } constexpr int getmod() { return MOD; } constexpr Fp operator - () const noexcept { return val ? MOD - val : 0; } constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; } constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; } constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; } constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; } constexpr Fp& operator += (const Fp& r) noexcept { val += r.val; if (val >= MOD) val -= MOD; return *this; } constexpr Fp& operator -= (const Fp& r) noexcept { val -= r.val; if (val < 0) val += MOD; return *this; } constexpr Fp& operator *= (const Fp& r) noexcept { val = val * r.val % MOD; return *this; } constexpr Fp& operator /= (const Fp& r) noexcept { long long a = r.val, b = MOD, u = 1, v = 0; while (b) { long long t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } val = val * u % MOD; if (val < 0) val += MOD; return *this; } constexpr bool operator == (const Fp& r) const noexcept { return this->val == r.val; } constexpr bool operator != (const Fp& r) const noexcept { return this->val != r.val; } friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept { return os << x.val; } friend constexpr istream& operator >> (istream &is, Fp<MOD>& x) noexcept { return is >> x.val; } friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept { if (n == 0) return 1; auto t = modpow(a, n / 2); t = t * t; if (n & 1) t = t * a; return t; } }; using mint=Fp<mod>; struct comb{ vector<mint> fac,invfac; comb(int n){ fac.pb(1); rep(1,i,n+1)fac.pb(fac[i-1]*i); rep(0,i,n+1){ invfac.pb(1); invfac[i]/=fac[i]; } } mint com(int n,int m){ if(n<m)return 0; else return fac[n]*invfac[m]*invfac[n-m]; } }; using graph=vector<vector<int>>; graph makeG(int n,int m,vector<int> u,vector<int> v,bool d){ graph G(n); rep(0,i,m){ G[u[i]].pb(v[i]); if(d)G[v[i]].pb(u[i]); } return G; } struct UF{ vector<int> par,rank,siz; UF(int n):par(n,-1),rank(n,0),siz(n,1){} int root(int x){ if(par[x]==-1)return x; else return par[x]=root(par[x]); } bool same(int x,int y){ return root(x)==root(y); } bool unite(int x,int y){ int rx=root(x),ry=root(y); if(rx==ry)return false; if(rank[rx]<rank[ry])swap(rx,ry); par[ry]=rx; if(rank[rx]==rank[ry])rank[rx]++; siz[rx]+=siz[ry]; return true; } int size(int x){ return siz[root(x)]; } }; graph makeUF(int n,graph g){ UF d(n); vector<vector<int>> m(n); rep(0,i,n){ for(auto t:g[i])d.unite(i,t); } rep(0,i,n)m[d.root(i)].pb(i); return m; } using wgraph=vector<vector<P>>; vector<int> dijstra(int n,wgraph g,int st,bool d){ } signed main(){ ic(n) ic(m) c(abs(n-m)) }