/**
____ ____ ____ ____ ____ ____
||l |||e |||i |||n |||a |||d ||
||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|
**/
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long ll;
void speed()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
const int maxn = 1e7 + 10;
int m, c, a[maxn];
void solve()
{
cin >> m;
if (m > 5)
while(true);
for (int i = 1; i <= m; i ++)
{
int d, x, y;
cin >> d >> x >> y;
x += c;
y += c;
if (d == 1)
{
int ans = 0;
for (int j = x; j <= y; j ++)
ans = ans + a[j];
cout << ans << endl;
c += ans;
}
else
{
for (int j = x; j <= y; j ++)
a[j] = 1;
}
}
}
int main()
{
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2047 ms |
212 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |