結果
問題 |
No.945 YKC饅頭
|
ユーザー |
![]() |
提出日時 | 2020-07-14 22:39:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 660 bytes |
コンパイル時間 | 2,238 ms |
コンパイル使用メモリ | 198,496 KB |
最終ジャッジ日時 | 2025-01-11 20:43:03 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 58 TLE * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:29:14: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} [-Wformat=] 29 | printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]); | ~~~^ | | | long long int | %d main.cpp:29:19: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} [-Wformat=] 29 | printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]); | ~~~^ | | | long long int | %d main.cpp:29:24: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’} [-Wformat=] 29 | printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]); | ~~~^ | | | long long int | %d
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; const int MOD = 1000000007; const ll INF = (ll) 1e18; int main() { int N,M; cin >> N >> M; set<int>res; rep(i,N)res.insert(i); vector<int>ans(3,0); rep(i,M){ if(res.empty())break; int L,R;char T; cin >> L >> R >> T; L--;R--; auto itr = lower_bound(res.begin(),res.end(),L); while (itr!=res.end()&&*itr<=R) { itr=res.erase(itr); if(T=='Y')ans[0]++; if(T=='K')ans[1]++; if(T=='C')ans[2]++; if(res.empty())break; } } printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]); return 0; }