提出 #72685402


ソースコード 拡げる

# pragma GCC target("avx2")
# pragma GCC optimize("O3")
# pragma GCC optimize("unroll-loops")
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vl=vector<long long>;
using vvl=vector<vector<long long>>;
using vvvl=vector<vector<vector<long long>>>;
using pl=pair<long long,long long>;
using vpl=vector<pair<long long,long long>>;
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(long long i=(long long)(a);i<(long long)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#include <atcoder/all>
using namespace atcoder;

long long modpow(long long a, long long n, long long mo){long long res=1;while(n>0){if(n&1){res=res*a%mo;}a=a*a%mo;n>>=1;}return res;}
long long Pow(long long a, long long n){long long res=1;while(n>0){if(n&1){res=res*a;}a=a*a;n>>=1;}return res;}


const ll MOD=998244353;
const ll INF=(1ll<<60);
int main(){
  ll N,M;
  cin>>N>>M;
  vl A(M),B(M);
  rep(i,M) cin>>A[i]>>B[i];
  vl canl(N,N-1);
  rep(i,M){
    A[i]--;B[i]--;
    canl[A[i]]--;
    canl[B[i]]--;
  }
  rep(i,N){
    ll x=canl[i];
    cout<<x*(x-1)*(x-2)/6<<" ";
  }
  cout<<endl;
}

提出情報

提出日時
問題 C - Peer Review
ユーザ number_cat
言語 C++23 (GCC 15.2.0)
得点 300
コード長 1369 Byte
結果 AC
実行時間 89 ms
メモリ 8604 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 25
セット名 テストケース
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt
ケース名 結果 実行時間 メモリ
sample00.txt AC 1 ms 3544 KiB
sample01.txt AC 1 ms 3652 KiB
sample02.txt AC 1 ms 3540 KiB
testcase00.txt AC 1 ms 3552 KiB
testcase01.txt AC 13 ms 5412 KiB
testcase02.txt AC 60 ms 6652 KiB
testcase03.txt AC 44 ms 5704 KiB
testcase04.txt AC 49 ms 5824 KiB
testcase05.txt AC 43 ms 5728 KiB
testcase06.txt AC 20 ms 5764 KiB
testcase07.txt AC 89 ms 8604 KiB
testcase08.txt AC 54 ms 6312 KiB
testcase09.txt AC 55 ms 6560 KiB
testcase10.txt AC 4 ms 3800 KiB
testcase11.txt AC 55 ms 6652 KiB
testcase12.txt AC 43 ms 5732 KiB
testcase13.txt AC 43 ms 5668 KiB
testcase14.txt AC 26 ms 4640 KiB
testcase15.txt AC 55 ms 6464 KiB
testcase16.txt AC 19 ms 4512 KiB
testcase17.txt AC 55 ms 6500 KiB
testcase18.txt AC 41 ms 5628 KiB
testcase19.txt AC 30 ms 4904 KiB
testcase20.txt AC 56 ms 6440 KiB
testcase21.txt AC 89 ms 8604 KiB