제출 #496023

#제출 시각아이디문제언어결과실행 시간메모리
496023ktkeremSob (COCI19_sob)C++17
10 / 110
55 ms3844 KiB
#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;
    //cout << z << "\n";
    ll y = 1;
    for(ll i = 0;32>i;i++ , y*=2){
        //cout << y << "\n";
        dt.pb(y);
    }
    y = dt.size();
    fora(i,n){
        bitset<64> bt;
        fora(i,64){
            bt[i] = 0;
        }
        ll opt = i;
        for(ll j = y-1;0<=j;j--){
            if(opt >= dt[j]){
                bt[j] = 1;
                opt-=dt[j];
            }
        }
        opt= i;
        for(ll j = y-1;0<=j && opt < m;j--){
            if(bt[j] == 0 && (dt[j] + opt) <= z){
                opt+=dt[j];
            }
        }
        ll uy = i & opt;
        cout << i << " " << opt << "\n";
    }
    return;/**/
}
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    ll t=1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0; 
}

컴파일 시 표준 에러 (stderr) 메시지

sob.cpp: In function 'void solve()':
sob.cpp:50:12: warning: unused variable 'uy' [-Wunused-variable]
   50 |         ll uy = i & opt;
      |            ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...