QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#363665#5072. Future CodersxdgwjaWA 139ms3916kbC++171.1kb2024-03-24 01:38:342024-03-24 01:38:35

Judging History

你现在查看的是最新测评结果

  • [2024-03-24 01:38:35]
  • 评测
  • 测评结果:WA
  • 用时:139ms
  • 内存:3916kb
  • [2024-03-24 01:38:34]
  • 提交

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];
    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;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3652kb

input:

2
8
3 -1 4 1 -5 9 2 -6
1
0

output:

19
0

result:

ok 2 number(s): "19 0"

Test #2:

score: 0
Accepted
time: 139ms
memory: 3624kb

input:

1000000
1
-164353707
1
-282757533
1
916961328
1
-540297420
1
866372576
1
1
1
871062154
1
873753814
1
1
1
1
1
636976909
1
789718633
1
200630859
1
-855838121
1
1
1
1
1
282306491
1
-308064257
1
-220028474
1
396002423
1
765070684
1
407981535
1
1
1
184126913
1
935672434
1
-70908999
1
1
1
669665925
1
1
1
...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok 1000000 numbers

Test #3:

score: -100
Wrong Answer
time: 94ms
memory: 3916kb

input:

500000
2
1 790170188
2
-886864567 1
2
-579023597 746881890
2
-534254391 -756978339
2
1 1
2
-617821991 -444756587
2
-676343428 -276446748
2
-422136307 1
2
1 1
2
-280282708 -901772076
2
-958271412 676715004
2
157313986 920829551
2
1 1
2
-796480068 1
2
1 1
2
616588559 1
2
1 -922399591
2
620860427 1
2
-...

output:

1
1
1
0
0
0
0
1
0
0
1
0
0
1
0
1
1
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
0
0
0
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
0
1
1
1
1
0
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
1
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
1
0
0
0
1
1
1
0
0
...

result:

wrong answer 5th numbers differ - expected: '1', found: '0'