Submission #984354

# Submission time Handle Problem Language Result Execution time Memory
984354 2024-05-16T14:32:26 Z Malix Intercastellar (JOI22_ho_t1) C++14
0 / 100
65 ms 106576 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef vector<ll> lli;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair

ll INF=1e18+10;
ll M=1e9+7;

ll MI(ll a){
    for(ll i=1;i<M+1;i++)if((a*i)%M==1)return i;
}

int main() {   
//ios::sync_with_stdio(0);
//cin.tie(0);
freopen("test_input.txt", "r", stdin);
freopen("test_output.txt", "w", stdout);
    int n;cin>>n;
    lli a(n);
    REP(i,0,n)cin>>a[i];
    int m;cin>>m;
    lli b(m);
    REP(i,0,m)cin>>b[i];
    lli c(n);
    REP(i,0,n)c[i]=(ll)((a[i])&(-a[i]));
    lli d(n);
    d[0]=c[0];
    REP(i,1,n)d[i]=d[i-1]+c[i];
    REP(i,0,m){
        int k=lower_bound(d.begin(),d.end(),b[i])-d.begin();
        cout<<a[k]/c[k]<<"\n";
    }
}

Compilation message

Main.cpp: In function 'll MI(ll)':
Main.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
Main.cpp: In function 'int main()':
Main.cpp:27:8: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   27 | freopen("test_input.txt", "r", stdin);
      | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:28:8: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   28 | freopen("test_output.txt", "w", stdout);
      | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 106324 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 106576 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 106324 KB Output isn't correct
2 Halted 0 ms 0 KB -