Submission #1117654

#TimeUsernameProblemLanguageResultExecution timeMemory
1117654vjudge1Paprike (COI18_paprike)C++17
13 / 100
22 ms824 KiB
//Desinged by AzeTurk810 Open source #include <bits/stdc++.h> using namespace std; # define ull unsigned long long # define hurryup ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) # define endl '\n' # define pb push_back # define INF 1e10 # define vbol vector<bool> # define vint vector<int> # define ll long long # define mod 10000007 __int128_t powr(__int128_t n,__int128_t k) { if(k == 0 )return 1; if(k&1){n*=n;n=n%mod;} k>>=1; n = powr(n % mod,k)%mod; } int main() { int n,k,ans= 0,sum =0; cin>>n>>k; vector<int>v(n); for(int i=0;i<n;i++) { cin>>v[i]; sum+=v[i]; if(sum >k) { ans++; sum = v[i]; } } cout<<ans<<endl; }

Compilation message (stderr)

paprike.cpp: In function '__int128 powr(__int128, __int128)':
paprike.cpp:19:7: warning: control reaches end of non-void function [-Wreturn-type]
   19 |     n = powr(n % mod,k)%mod;
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...