結果
| 問題 | No.2178 Payable Magic Items |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2023-01-06 21:40:57 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 885 bytes |
| 記録 | |
| コンパイル時間 | 4,429 ms |
| コンパイル使用メモリ | 277,136 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-06-29 05:47:58 |
| 合計ジャッジ時間 | 9,213 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 TLE * 1 -- * 15 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 2000000000000000005
int check(string &a,string &b){
bool f0 = true,f1 = true;
rep(i,a.size()){
if(a[i]<b[i])f0 = false;
if(a[i]>b[i])f1 = false;
}
if(f0)return 1;
if(f1)return -1;
return 0;
}
int main(){
int N,K;
cin>>N>>K;
vector<string> ans;
rep(i,N){
string t;
cin>>t;
//rep(j,K)scanf("%d",&t[j]);
bool f = true;
rep(j,ans.size()){
if(ans[j]==t)f = false;
}
if(!f)continue;
{
vector<string> na;
rep(j,ans.size()){
if(check(t,ans[j])==1)continue;
na.push_back(ans[j]);
if(check(t,ans[j])==-1)f = false;
}
if(f)na.push_back(t);
swap(ans,na);
}
}
cout<<N-ans.size()<<endl;
return 0;
}
沙耶花