Submission #785625

# Submission time Handle Problem Language Result Execution time Memory
785625 2023-07-17T10:52:18 Z andecaandeci Sprinkler (JOI22_sprinkler) C++17
0 / 100
151 ms 39820 KB
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define keish                             ios_base::sync_with_stdio(0);       cin.tie(0); cout.tie(0)
      
using namespace std;

int n, l, q, u, v, t, x, d, w, lim;
vector<int> con[1005][1005];

signed main(){
      keish;
      cin >> n >> l;
      vector<vector<int>> e(n);
      for(int i = 1; i < n; i++){
            cin >> u >> v; u--, v--;
            e[u].push_back(v);
            e[v].push_back(u);
      }

      vector<int> a(n);
      for(auto &x : a) cin >> x;

      cin >> q;
      while(q--){
            cin >> t;
            if(t == 1){
                  cin >> x >> d >> w; x--;
                  (a[x] *= w) %= l;
                  if(d == 1){
                        for(auto v : e[u]){
                              (a[v] *= w) %= l;
                        }
                  }
            }else{      
                  cin >> x; x--;
                  cout << a[x] << '\n';
            }
      }
}  
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 24000 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 23960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 23960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23968 KB Output is correct
2 Incorrect 151 ms 39820 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 24064 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 24000 KB Output isn't correct
2 Halted 0 ms 0 KB -