提出 #74562496
ソースコード 拡げる
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ull unsigned long long
template<class T1, class T2> bool cmin(T1 &x, const T2 &y) { if (y < x) { x = y; return 1; } return 0; }
template<class T1, class T2> bool cmax(T1 &x, const T2 &y) { if (x < y) { x = y; return 1; } return 0; }
typedef pair<int,int> pii;
typedef vector<int> vc;
#define pb push_back
#define ll long long
#define lll __int128
//#define endl '\n'
#define lowbit(x) (x&-(x))
const int inf=1e18;
const int mod=1e9+7;
//const int mod=998244353;
const int N=2e5+10;
const int maxm=1e6+10;
const int maxn=2500;
const int dir[4][2]={1,0,0,1,-1,0,0,-1};
//const int dir[8][2]={1,0,0,1,-1,0,0,-1,1,1,1,-1,-1,1,-1,-1};
int powerr(int x,int y){int ans=1;while(y){if(y&1)ans=ans*x%mod;x=x*x%mod;y>>=1;}return ans;}
int inv(int x){return powerr(x,mod-2);}
mt19937_64 rg(random_device{}());//rg()
int gcd(int x,int y){while(y){int temp=y;y=x%y;x=temp;}return x;}
inline void read(int& a){int s = 0, w = 1;char ch = getchar();while (ch < '0' || ch>'9'){if (ch == '-')w = -1;ch = getchar();}while (ch >= '0' && ch <= '9'){s = s * 10 + ch - '0';ch = getchar();}a = s * w;}
void write(int x){if(x<0)putchar('-'),x=-x;if(x>9)write(x/10);putchar(x%10+'0');return;}
#define all(v) v.begin(),v.end()
const double eps=1e-6;
#define ls i<<1
#define rs i<<1|1
void solve(){
int n,m;cin>>n>>m;
int ca[m+1];
int cb[m+1];
memset(ca,0,sizeof(ca));
memset(cb,0,sizeof(cb));
for(int i=1;i<=n;i++){
int x,y;cin>>x>>y;
ca[x]++;
cb[y]++;
}
for(int i=1;i<=m;i++){
cout<<cb[i]-ca[i]<<endl;
}
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int t=1;//cin>>t;
while(t--){solve();}
}
提出情報
| 提出日時 |
|
| 問題 |
B - Personnel Change |
| ユーザ |
llsy |
| 言語 |
C++23 (GCC 15.2.0) |
| 得点 |
200 |
| コード長 |
1793 Byte |
| 結果 |
AC |
| 実行時間 |
1 ms |
| メモリ |
3716 KiB |
ジャッジ結果
| セット名 |
Sample |
All |
| 得点 / 配点 |
0 / 0 |
200 / 200 |
| 結果 |
|
|
| セット名 |
テストケース |
| Sample |
00_sample_01.txt, 00_sample_02.txt |
| All |
00_sample_01.txt, 00_sample_02.txt, 01_small_m_random_01.txt, 01_small_m_random_02.txt, 01_small_m_random_03.txt, 02_large_m_random_01.txt, 02_large_m_random_02.txt, 02_large_m_random_03.txt, 03_large_m_biased_01.txt, 03_large_m_biased_02.txt, 03_large_m_biased_03.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| 00_sample_01.txt |
AC |
1 ms |
3516 KiB |
| 00_sample_02.txt |
AC |
1 ms |
3612 KiB |
| 01_small_m_random_01.txt |
AC |
1 ms |
3584 KiB |
| 01_small_m_random_02.txt |
AC |
1 ms |
3632 KiB |
| 01_small_m_random_03.txt |
AC |
1 ms |
3548 KiB |
| 02_large_m_random_01.txt |
AC |
1 ms |
3612 KiB |
| 02_large_m_random_02.txt |
AC |
1 ms |
3716 KiB |
| 02_large_m_random_03.txt |
AC |
1 ms |
3584 KiB |
| 03_large_m_biased_01.txt |
AC |
1 ms |
3632 KiB |
| 03_large_m_biased_02.txt |
AC |
1 ms |
3464 KiB |
| 03_large_m_biased_03.txt |
AC |
1 ms |
3716 KiB |