Submission #496008

# Submission time Handle Problem Language Result Execution time Memory
496008 2021-12-20T11:37:03 Z ktkerem Sob (COCI19_sob) C++17
0 / 110
1 ms 332 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 vll;
typedef unsigned __int128 uvll;
ll _i=0;
#define ffn(x) _i=x
#define llll pair<ll , ll>
#define stitr set<ll>::iterator
#define fora(y,x) for(ll y=_i;x>y;y++)
#define pb push_back
#define pf push_front
#define debu cout << "hello\n"
#define fi first
#define sec second
#define all(a) a.begin() , a.end()
const ll limit = 1e13 + 7; 
const ll ous=1e5 + 5;
const ll dx[4] = {0 , -1 , 1 , 0} , dy[4] = {1,0,0,-1};
void solve(){
    ll n , m;cin >> n >> m;
    ll z =m+n-1;
    vector<ll> dt;
    ll y = 1;
    for(ll i = 0;28>i;i++ , y*=2){
        //cout << y << "\n";
        dt.pb(y);
    }
    y = dt.size();
    fora(i,n){
        bitset<32> bt(0);
        ll z = i;
        for(ll j = y-1;0<=j;j--){
            if(z >= dt[j]){
                bt[j] = 1;
                z-=dt[j];
            }
        }
        z= i;
        for(ll j = 0;y>j && z < m;j++){
            if(bt[j] == 0){
                z+=dt[j];
            }
        }
        cout << i << " " << z << "\n";
    }
    return;/**/
}
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    ll t=1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0; 
}

Compilation message

sob.cpp: In function 'void solve()':
sob.cpp:23:8: warning: unused variable 'z' [-Wunused-variable]
   23 |     ll z =m+n-1;
      |        ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Integer parameter [name=y] equals to 1048575, violates the range [724385, 724512]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Integer parameter [name=y] equals to 255, violates the range [178, 189]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Integer parameter [name=y] equals to 1048575, violates the range [724385, 724512]
2 Halted 0 ms 0 KB -