結果
問題 | No.2239 Friday |
ユーザー | tada721 |
提出日時 | 2023-03-10 21:28:43 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 4,581 bytes |
コンパイル時間 | 1,795 ms |
コンパイル使用メモリ | 177,580 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-18 03:40:34 |
合計ジャッジ時間 | 2,533 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,948 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,944 KB |
testcase_07 | AC | 2 ms
6,940 KB |
testcase_08 | AC | 2 ms
6,944 KB |
testcase_09 | AC | 2 ms
6,940 KB |
testcase_10 | AC | 2 ms
6,944 KB |
testcase_11 | AC | 2 ms
6,944 KB |
testcase_12 | AC | 2 ms
6,944 KB |
testcase_13 | AC | 2 ms
6,940 KB |
testcase_14 | AC | 2 ms
6,940 KB |
testcase_15 | AC | 2 ms
6,944 KB |
testcase_16 | AC | 2 ms
6,940 KB |
testcase_17 | AC | 2 ms
6,944 KB |
testcase_18 | AC | 2 ms
6,940 KB |
testcase_19 | AC | 2 ms
6,944 KB |
コンパイルメッセージ
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) if(n<m)swap(n,m); int ans=inf; rep(0,i,m+1){ ans=min(ans,abs(n+m-i*4)); } c(ans) }