結果
問題 |
No.1703 Much Matching
|
ユーザー |
![]() |
提出日時 | 2021-10-08 22:04:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 327 ms / 2,000 ms |
コード長 | 651 bytes |
コンパイル時間 | 4,855 ms |
コンパイル使用メモリ | 255,100 KB |
最終ジャッジ日時 | 2025-01-24 22:09:21 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 35 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:28:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | scanf("%d %d",&x,&y); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <bits/stdc++.h> #include <atcoder/all> using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 int op(int a,int b){ return max(a,b); } int e(){ return 0; } int main(){ int n,m,q; cin>>n>>m>>q; vector<vector<int>> E(n); rep(i,q){ int x,y; scanf("%d %d",&x,&y); x--;y--; E[x].push_back(y); } segtree<int,op,e> seg(m); rep(i,n){ sort(E[i].rbegin(),E[i].rend()); rep(j,E[i].size()){ int b = E[i][j]; seg.set(b,max(seg.get(b),seg.prod(0,b)+1)); } } cout<<seg.all_prod()<<endl; return 0; }