Submission #167322

#TimeUsernameProblemLanguageResultExecution timeMemory
167322AKaan37Ljetopica (COI19_ljetopica)C++17
8 / 100
5 ms1532 KiB
//Sani buyuk Osman Pasa Plevneden cikmam diyor. //FatihSultanMehmedHan //Abdulhamid Han //Bismillahirrahmanirrahim //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█▄█ //█─█─█▄─█▄─█─█─█─█ #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #include <bits/stdc++.h> using namespace std; typedef long long lo; typedef pair< lo,lo > PII; #define fi first #define se second #define int long long #define mp make_pair #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo MAX = -1000000000000000000; const lo MIN = 1000000000000000000; const lo inf = 1000000000; const lo KOK = 100000; const lo LOG = 30; const lo li = 500005; const lo mod = 1000000007; int n,m,b[li],a[li],k,flag,t; int cev; string s,s1,s2; vector<int> v; inline int add(int x,int y){ if(x+y>=mod)return x+y-mod; return x+y; } inline int mul(int x,int y){ return (x%mod)*(y%mod)%mod; } inline void dfs(int sira,int der,string ss){ if(der==n){ //~ cout<<ss<<endl; if(ss>=s1 && ss<=s2){ int carp=1; for(int i=(int)ss.size()-1;i>=0;i--){ cev=add(cev,mul(carp,(ss[i]-'0'))); carp=mul(carp,2); } } return ; } if(s[sira]=='L')dfs(sira+1,der+1,ss+'0'); else dfs(sira+1,der+1,ss+'1'); } main(void){ fio(); cin>>n>>k; cin>>s; cin>>s1>>s2; string st{}; st+='1'; dfs(0,1,st); for(int i=0;i<(int)s.size();i++){ if(s[i]=='L')s[i]='R'; else s[i]='L'; } dfs(0,1,st); cout<<cev<<endl; return 0; }

Compilation message (stderr)

ljetopica.cpp:67:10: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(void){
          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...