Submission #2172825
Source Code Expand
#include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible" ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible" ) << endl
#define Size(n) (n).size()
typedef long long ll;
using namespace std;
const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;
//long long int kaizyo(long long int hh){
// cmp=1;
//while(hh>1){
// cmp=(cmp*hh)%MOD;
//hh--;
//}
//return cmp;
//}
//while(x!=0){
//sum+=x%10;
// x/=10;
//}
//各桁の和
//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力
//s.find(w[i])==string::npos
//findの使い方
//for(int i=0;i<n;i++){
// b[i]=x%2;
//x/=2;
//}二進数
long long int n,cnt=0,ans=0,a[10000000],b,c,cmp=1,cmpp=1,m,h,w,x,y,sum=0,pos;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
int main(void){
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n;
rep(i,n)cin>>a[i];
rep(i,n){
cmp*=3;
}
rep(i,n){
if(a[i]%2==0){
cmpp*=2;
}
else{
cmpp*=1;
}
}
Cout(cmp-cmpp);
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Similar Arrays |
User |
asdf1 |
Language |
C++14 (GCC 5.4.1) |
Score |
200 |
Code Size |
1986 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
256 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
Status |
|
|
Set Name |
Test Cases |
Sample |
subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt |
All |
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt |
Case Name |
Status |
Exec Time |
Memory |
01.txt |
AC |
1 ms |
256 KB |
02.txt |
AC |
1 ms |
256 KB |
03.txt |
AC |
1 ms |
256 KB |
04.txt |
AC |
1 ms |
256 KB |
05.txt |
AC |
1 ms |
256 KB |
06.txt |
AC |
1 ms |
256 KB |
07.txt |
AC |
1 ms |
256 KB |
subtask0_0.txt |
AC |
1 ms |
256 KB |
subtask0_1.txt |
AC |
1 ms |
256 KB |
subtask0_2.txt |
AC |
1 ms |
256 KB |
subtask0_3.txt |
AC |
1 ms |
256 KB |