QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#363674 | #5072. Future Coder | sxdgwja | WA | 0ms | 3572kb | C++17 | 1.1kb | 2024-03-24 01:43:43 | 2024-03-24 01:43:43 |
Judging History
answer
#include <bits/stdc++.h>
#define fi first
#define se second
#define int long long
using namespace std;
#define endl '\n'
typedef long long i64;
typedef long long ll;
typedef long long LL;
typedef vector<int> vei;
typedef unsigned long long ull;
//typedef __int128 i128;
const int N = 1e6 + 10;
const int p = 1e9 + 7;
typedef pair<ll, ll> pii;
typedef pair<double, double> poi;
void solve()
{
int n;
cin>>n;
vector<int> a(n + 10);
int cut[4] = {0};
for(int i = 1; i <= n; ++i)
{
cin>>a[i];
if(a[i] == 1)cut[3]++;
if(a[i] == 0 )cut[0]++;
if(a[i] < 0)cut[1]++;
if(a[i] > 1)cut[2]++;
}
int ans = 0;
ans += cut[1] * (cut[2] + cut[3]);
ans += (cut[0] + cut[3]) * (cut[2] + cut[3]);
cout<< ans<<endl;
}
signed main()
{
srand(time(NULL));mt19937 rnd(time(NULL));ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
// freopen("D:\\clk\\APP\\problem\\B\\2.in", "r", stdin);
// freopen("D:\\clk\\APP\\problem\\B\\2.out", "w", stdout);
int test = 1;cin>> test;
while (test--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
2 8 3 -1 4 1 -5 9 2 -6 1 0
output:
20 0
result:
wrong answer 1st numbers differ - expected: '19', found: '20'