結果
| 問題 | No.230 Splarraay スプラレェーイ |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2021-11-16 22:41:18 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 618 bytes |
| 記録 | |
| コンパイル時間 | 3,145 ms |
| コンパイル使用メモリ | 273,636 KB |
| 実行使用メモリ | 7,964 KB |
| 最終ジャッジ日時 | 2026-06-23 17:55:18 |
| 合計ジャッジ時間 | 12,234 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 TLE * 1 -- * 5 |
ソースコード
#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 1000000001
int main(){
int N,Q;
cin>>N>>Q;
vector<int> a(N,0);
int A=0,B=0;
rep(_,Q){
int x,l,r;
scanf("%d %d %d",&x,&l,&r);
if(x==0){
vector<int> c(3,0);
for(int i=l;i<=r;i++)c[a[i]]++;
if(c[1]>c[2])A += c[1];
if(c[1]<c[2])B += c[2];
}
else{
for(int i=l;i<=r;i++)a[i] = x;
}
}
rep(i,N){
if(a[i]==1)A++;
if(a[i]==2)B++;
}
cout<<A<<' '<<B<<endl;
return 0;
}
沙耶花