QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#644407 | #7747. Memory | guodong# | WA | 1ms | 3656kb | C++17 | 1.2kb | 2024-10-16 13:47:03 | 2024-10-16 13:47:03 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define For(i,a,b) for(int i = a; i <= b; ++i)
#define push_back emplace_back
#define mp make_pair
class us{
private:
vector<int> f;
public:
us(int n){
f.resize(n + 1);
For(i,1,n)
f[i] = i;
}
int gf(int x){
if(x == f[x])
return x;
return f[x] = gf(f[x]);
}
void merge(int a,int b){
a = gf(a);
b = gf(b);
f[b] = a;
}
};
#define edg pair<int,pair<int,int>>
vector<int> tar,W;
vector<vector<pair<int,int> >> To;
vector<int> ans,siz;
int Dfs(int pos,int fa){
int cur = 0;
siz[pos] = tar[pos];
int v = 0;
for(auto son : To[pos]){
if(son.first == fa) continue;
v = Dfs(son.first,pos);
siz[pos] += siz[son.first];
if(v > cur){
swap(cur,v);
}
ans.push_back(v);
}
if(fa != -1)
cur += siz[pos] * (W[fa] - W[pos]);
return cur;
}
#define eps (1e-10)
signed main(){
#ifdef NICEGUODONG
freopen("data.in","r",stdin);
#endif
ios::sync_with_stdio(false);
int n;
cin >> n;
long double accm = 0;
For(i,1,n){
int a;
cin >> a;
accm = a + accm * 0.5;
if(fabs(accm) <= eps){
cout << "0";
}
else if(accm > 0){
cout << "+";
}
else
cout << "-";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3656kb
input:
10 2 -1 4 -7 4 -8 3 -6 4 -7
output:
+0+-+---+-
result:
ok single line: '+0+-+---+-'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
10 -1 36 18 18 18 18 18 18 18 -18
output:
-++++++++-
result:
ok single line: '-++++++++-'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3628kb
input:
1000 -1 193552 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 96776 967...
output:
-+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++...
result:
wrong answer 1st lines differ - expected: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++-', found: '-+++++++++++++++++++++++++++++...++++++++++++++++++++++++++++++0'