//#define local
#ifndef local
#include "Annalib.h"
#endif
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int N = 3e5 + 5;
const int oo = 1e18 + 7, mod = 1e9 + 7;
mt19937 rng(1);
int rnd(int l, int r){
int temp = rng() % (r - l + 1);
return abs(temp) + l;
}
bool out[N];
int arr1[] = {1, 2, 2, 4, 2, 4, 4, 4};
int arr2[] = {0, 0, 0, 0, 1, 1, 2, 3};
void Anna(int N, long long X, int K, int P[]){
for(int i = 0; i < K; i++) out[P[i]] = 1;
//cout << X << "\n";
for(int i = 0; i < N; i += 3){
// if(!X) break;
int msk = (!out[i]) + (!out[i + 1]) * 2 + (!out[i + 2]) * 4;
int ind = -1;
for(int j = 7; j >= 0; j--){
if((X % arr1[j] == arr2[j]) && ((msk | j) == msk)){
ind = j;
break;
}
}
X /= arr1[ind];
Set(i, ((ind & 1) != 0));
Set(i + 1, ((ind & 2) != 0));
Set(i + 2, ((ind & 4) != 0));
cout << X << " " << ind << "\n";
}
}
#ifdef local
void process(){
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--) process();
}
#endif
//#define local
#ifndef local
#include "Brunolib.h"
#endif
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
const int N = 3e5 + 5;
const int oo = 1e18 + 7, mod = 1e9 + 7;
//mt19937 rng(1);
int arr11[] = {1, 2, 2, 4, 2, 4, 4, 4};
int arr22[] = {0, 0, 0, 0, 1, 1, 2, 3};
long long Bruno(int N, int A[]){
long long ans = 0;
for(int i = N - 3; i >= 0; i -= 3){
int temp = A[i] + 2 * A[i + 1] + 4 * A[i + 2];
// cout << temp << "\n";
ans = (ans * arr11[temp]) + arr22[temp];
}
cout << ans << "\n";
return ans;
}
#ifdef local
void process(){
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--) process();
}
#endif
Compilation message
Anna.cpp:22:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
22 | const int oo = 1e18 + 7, mod = 1e9 + 7;
| ~~~~~^~~
Bruno.cpp:22:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
22 | const int oo = 1e18 + 7, mod = 1e9 + 7;
| ~~~~~^~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
26 ms |
4432 KB |
Unexpected end of file - int64 expected |
2 |
Runtime error |
28 ms |
4480 KB |
Execution killed with signal 11 |
3 |
Runtime error |
29 ms |
4536 KB |
Execution killed with signal 11 |
4 |
Runtime error |
31 ms |
4612 KB |
Execution killed with signal 11 |
5 |
Incorrect |
26 ms |
4376 KB |
Unexpected end of file - int64 expected |
6 |
Incorrect |
26 ms |
4460 KB |
Unexpected end of file - int64 expected |
7 |
Runtime error |
27 ms |
4596 KB |
Execution killed with signal 11 |
8 |
Runtime error |
27 ms |
4592 KB |
Execution killed with signal 11 |
9 |
Incorrect |
27 ms |
4488 KB |
Unexpected end of file - int64 expected |
10 |
Incorrect |
29 ms |
4484 KB |
Unexpected end of file - int64 expected |
11 |
Runtime error |
29 ms |
4644 KB |
Execution killed with signal 11 |
12 |
Incorrect |
27 ms |
4504 KB |
Unexpected end of file - int64 expected |
13 |
Runtime error |
28 ms |
4552 KB |
Execution killed with signal 11 |
14 |
Runtime error |
28 ms |
4588 KB |
Execution killed with signal 11 |
15 |
Incorrect |
26 ms |
4508 KB |
Unexpected end of file - int64 expected |
16 |
Runtime error |
30 ms |
4612 KB |
Execution killed with signal 11 |
17 |
Incorrect |
26 ms |
4512 KB |
Unexpected end of file - int64 expected |
18 |
Incorrect |
27 ms |
4464 KB |
Unexpected end of file - int64 expected |
19 |
Incorrect |
27 ms |
4432 KB |
Unexpected end of file - int64 expected |
20 |
Runtime error |
28 ms |
4628 KB |
Execution killed with signal 11 |
21 |
Incorrect |
26 ms |
4512 KB |
Unexpected end of file - int64 expected |
22 |
Incorrect |
26 ms |
4488 KB |
Unexpected end of file - int64 expected |
23 |
Runtime error |
34 ms |
4528 KB |
Execution killed with signal 11 |
24 |
Incorrect |
27 ms |
4464 KB |
Unexpected end of file - int64 expected |
25 |
Runtime error |
28 ms |
4612 KB |
Execution killed with signal 11 |
26 |
Runtime error |
27 ms |
4652 KB |
Execution killed with signal 11 |
27 |
Incorrect |
26 ms |
4420 KB |
Unexpected end of file - int64 expected |
28 |
Runtime error |
27 ms |
4648 KB |
Execution killed with signal 11 |
29 |
Incorrect |
33 ms |
4444 KB |
Unexpected end of file - int64 expected |
30 |
Runtime error |
27 ms |
4636 KB |
Execution killed with signal 11 |
31 |
Runtime error |
27 ms |
4524 KB |
Execution killed with signal 11 |
32 |
Incorrect |
28 ms |
4476 KB |
Unexpected end of file - int64 expected |
33 |
Incorrect |
27 ms |
4460 KB |
Unexpected end of file - int64 expected |
34 |
Incorrect |
26 ms |
4492 KB |
Unexpected end of file - int64 expected |
35 |
Incorrect |
26 ms |
4456 KB |
Unexpected end of file - int64 expected |
36 |
Incorrect |
27 ms |
4412 KB |
Unexpected end of file - int64 expected |
37 |
Incorrect |
27 ms |
4456 KB |
Unexpected end of file - int64 expected |
38 |
Incorrect |
26 ms |
4484 KB |
Unexpected end of file - int64 expected |
39 |
Incorrect |
27 ms |
4472 KB |
Unexpected end of file - int64 expected |
40 |
Incorrect |
27 ms |
4508 KB |
Unexpected end of file - int64 expected |