結果
| 問題 |
No.2178 Payable Magic Items
|
| コンテスト | |
| ユーザー |
たたき@競プロ
|
| 提出日時 | 2023-07-12 18:37:31 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 715 bytes |
| コンパイル時間 | 3,212 ms |
| コンパイル使用メモリ | 245,764 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 07:56:07 |
| 合計ジャッジ時間 | 9,582 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 4 |
| other | RE * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using pp=pair<int,int>;
#define sr string
#define vc vector
#define db double
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define pb push_back
#define all(v) v.begin(),v.end()
#define pque priority_queue
#define bpc(a) __builtin_popcount(a)
int main(){
int n,k;cin>>n>>k;
int b=1; rep(i,k)b*=5;
vc<int>f(k,1); rep(i,k-1)f[i+1]=f[i]*5;
vc<int>xs(n);
rep(i,n){
int x=0;
rep(j,k){
int a;cin>>a;
x+=f[j]*a;
}
xs[i]=x;
}
vc<int>s(f[k]-1,0);
rep(i,n)s[xs[i]]++;
rep(i,k)for(int j=f[k]-1;j>=0;j--){
if((j/f[i])%5!=4)s[j]+=s[j+f[i]];
}
int ans=0;
rep(i,n)if(s[xs[i]]>1)ans++;
cout<<ans;
}
たたき@競プロ