Submission #631235

# Submission time Handle Problem Language Result Execution time Memory
631235 2022-08-17T21:13:49 Z smartmonky Rack (eJOI19_rack) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define int ll
using namespace std;
const int mod=1e9+7;
main(){
	int n,k;
	cin >>n >>k;
	map<int,int> v,ans;
	v[1]=1;
	ans[1]=1;
	v[2]=(x/2+1)%mod;
	ans[2]=(v[2])%mod;
	int cnt=2;
	int s=3;
	for(int i=x/4;i>=1;i/=2){
		for(int j=1;j<=cnt;j++){
				v[cnt+j]=(v[j]+i)%mod;
				ans[s]=v[cnt+j];
				s++;
		}
		cnt*=2;
	}
	cout<<ans[k];
}

Compilation message

rack.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main(){
      | ^~~~
rack.cpp: In function 'int main()':
rack.cpp:13:8: error: 'x' was not declared in this scope
   13 |  v[2]=(x/2+1)%mod;
      |        ^