結果
| 問題 |
No.945 YKC饅頭
|
| コンテスト | |
| ユーザー |
eSeF
|
| 提出日時 | 2020-07-14 22:32:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 619 bytes |
| コンパイル時間 | 2,030 ms |
| コンパイル使用メモリ | 199,360 KB |
| 最終ジャッジ日時 | 2025-01-11 20:41:45 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 58 TLE * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:27: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=]
27 | printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]);
| ~~~^
| |
| long long int
| %d
main.cpp:27: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=]
27 | printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]);
| ~~~^
| |
| long long int
| %d
main.cpp:27: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=]
27 | 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){
int L,R;char T;
cin >> L >> R >> T;
L--;R--;
auto itr = lower_bound(res.begin(),res.end(),L);
while (itr!=res.end()&&L<=(*itr)&&(*itr)<=R)
{
itr=res.erase(itr);
if(T=='Y')ans[0]++;
if(T=='K')ans[1]++;
if(T=='C')ans[2]++;
}
}
printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]);
return 0;
}
eSeF