Submission #51805461


Source Code Expand

Copy
// !JOY
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define coutyes cout<<"YES\n"
#define coutno cout<<"NO\n"
#define endl "\n"
#define hell 1000000007
using namespace std;
int M = 1000000;
int sieve[1000001];
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
// !JOY
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
        
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define coutyes cout<<"YES\n"
#define coutno cout<<"NO\n"
#define endl "\n"
#define hell 1000000007

using namespace std;

int M = 1000000;
int sieve[1000001];
 
 
void createSieve() {
    for (int i = 2; i <= M; i++) {
        sieve[i] = 1;
    }
    for (int i = 2; i * i <= M; i++) {
        if (sieve[i] == 1) {
            if (i == 2) {
                for (int j = i * i; j <= M; j += i) {
                    sieve[j] = 2;
                }
            }
            else {
                for (int j = i * i; j <= M; j += 2 * i) {
                    if (sieve[j] == 1) {
                        sieve[j] = i;
                    }
                }
            }
        }
    }
}

bool isPrime(ll n)
{
    if (n <= 1)
        return false;
    for (ll i = 2; i * i <= n; i++) 
    {
        if (n % i == 0)
            return false;
    }
    return true;
}

ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

vector<ll> factors(ll n) {
    vector<ll> f;
    for (ll x = 2; x*x <= n; x++) {
        while (n%x == 0) {
            f.push_back(x);
            n /= x;
        }
    }
    if (n > 1) f.push_back(n);
    return f;
}

ll powe(ll a, ll n) {

    ll r = 1;
    while (n) {
        if (n % 2) {
            r = ((r % hell) * (a % hell)) % hell;
            n--;
        }
        else {
            a = ((a % hell) * (a % hell)) % hell;
            n = n / 2;
        }
    }
    return r;
}

ll dx[] = {0, 0, 1, -1};
ll dy[] = {1, -1, 0, 0};

ll dfs(ll i, ll j, vector<vector<ll>> &vi, ll n, ll m, vector<vector<ll>> & v) {
    ll ans = 0;
    if (!vi[i][j]) {
        vi[i][j] = 1;
        ans = v[i][j];
        for (int k = 0; k < 4; k++) {
            if (i + dx[k] >= 0 && i + dx[k] < n && j + dy[k] >= 0 && j + dy[k] < m && v[i + dx[k]][j + dy[k]] != 0 && vi[i + dx[k]][j + dy[k]] == 0) {
                ans += dfs(i + dx[k], j + dy[k], vi, n, m, v);
            }
        }
    }
    return ans;
}

const int N = 1e5+10;
vector<int>g[N];
bool vis[N];

void _dfs(int vertex){
    if(!vis[vertex]){
        vis[vertex]=true;
        for (int child: g[vertex])
        {
            if(!vis[child]) _dfs(child);
        }
    }
}

void solve()
{
    ll n,k;
    cin>>n>>k;
    vector<ll>v(n);
    for (int i = 0; i < n; ++i)
    {
        cin>>v[i];
        if(v[i]%k==0){
            cout<<v[i]/k<<' ';
        }
    }
}

int main()
{
    fast_io;
    ll t;
    t=1;
    // cin>>t;
    while(t--)
        solve();
    return 0;
}

Submission Info

Submission Time
Task A - Divisible
User Parzival01
Language C++ 20 (gcc 12.2)
Score 100
Code Size 2945 Byte
Status AC
Exec Time 1 ms
Memory 3628 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 15
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3436 KB
00_sample_02.txt AC 1 ms 3488 KB
00_sample_03.txt AC 1 ms 3496 KB
01_test_01.txt AC 1 ms 3496 KB
01_test_02.txt AC 1 ms 3500 KB
01_test_03.txt AC 1 ms 3496 KB
01_test_04.txt AC 1 ms 3436 KB
01_test_05.txt AC 1 ms 3556 KB
01_test_06.txt AC 1 ms 3496 KB
01_test_07.txt AC 1 ms 3628 KB
01_test_08.txt AC 1 ms 3492 KB
01_test_09.txt AC 1 ms 3492 KB
01_test_10.txt AC 1 ms 3436 KB
01_test_11.txt AC 1 ms 3620 KB
01_test_12.txt AC 1 ms 3432 KB


2025-03-31 (Mon)
00:15:02 +00:00