# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
170322 |
2019-12-24T19:59:33 Z |
ngmh |
Garaža (COCI17_garaza) |
C++11 |
|
4000 ms |
1528 KB |
#include <bits/stdc++.h>
using namespace std;
int n, q, t, x, v, l, r, cur, ans, a[100005];
int main(){
cin >> n >> q;
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 0; i < q; i++){
cin >> t;
if(t == 1){
cin >> x >> v;
x--;
a[x] = v;
} else {
cin >> l >> r;
l--; r--; ans = 0;
for(int j = l; j <= r; j++){
cur = a[j];
for(int k = j; k <= r; k++){
cur = __gcd(cur, a[k]);
if(cur == 1) break;
ans++;
}
}
cout << ans << "\n";
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
39 ms |
380 KB |
Output is correct |
2 |
Execution timed out |
4018 ms |
376 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4035 ms |
760 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4041 ms |
1144 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4046 ms |
1528 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |