結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocorusk
提出日時 2018-12-07 00:56:06
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,384 bytes
コンパイル時間 959 ms
コンパイル使用メモリ 96,996 KB
実行使用メモリ 252,288 KB
最終ジャッジ日時 2024-09-14 02:59:30
合計ジャッジ時間 46,837 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 61 TLE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:26:29: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   26 |                 int p; scanf("%d %d %d", &p, &t[i], &r[i]);
      |                        ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int main()
{
int n;
cin>>n;
vector<int> v[10001], vt[10001], vr[10001];
int t[100000], r[100000];
for(int i=0; i<n; i++){
int p; scanf("%d %d %d", &p, &t[i], &r[i]);
vt[t[i]].push_back(i);
vr[r[i]].push_back(i);
v[p].push_back(i);
}
bitset<100000> bt[10002], br[10002], bp;
for(int i=10000; i>=0; i--){
bt[i]=bt[i+1], br[i]=br[i+1];
for(auto j:vt[i]){
bt[i][j]=1;
}
for(auto j:vr[i]){
br[i][j]=1;
}
}
bool nuee[100001]={};
for(int i=10000; i>=0; i--){
for(auto j:v[i]){
if((bp&bt[t[j]]&br[r[j]]).count()) nuee[j]=1;
}
for(auto j:v[i]) bp[j]=1;
for(auto j:v[i]){
if(nuee[j]) continue;
if((bp&bt[t[j]+1]&br[r[j]]).count()) nuee[j]=1;
//else if((bp&bt[t[j]]&br[r[j]+1]).count()) nuee[j]=1;
}
map<int, int> mp;
for(auto j:v[i]){
auto itr=mp.find(t[j]);
if(itr==mp.end()) mp[t[j]]=j;
else{
if(r[itr->second]>r[j]) nuee[j]=1;
else{
nuee[itr->second]=1;
itr->second=j;
}
}
}
}
for(int i=0; i<n; i++){
if(!nuee[i]) printf("%d\n", i+1);
}
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0