제출 #769891

#제출 시각아이디문제언어결과실행 시간메모리
769891TimDeeFountain (eJOI20_fountain)C++17
30 / 100
1569 ms2256 KiB
// Esti <3 //\ šťastia pre nás :) // you're already the best // _ // ^ ^ // // >(O_O)<___// // \ __ __ \ // \\ \\ \\\\ #include <bits/stdc++.h> using namespace std; //#pragma GCC optimize("O3","unroll-loops") //#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #pragma GCC optimize("O3") #pragma GCC target("popcnt") using ll = long long; #define int long long #define forn(i,n) for(int i=0; i<(n); ++i) #define pb push_back #define pi pair<int,int> #define f first #define s second #define vii(a,n) vector<int> a(n); forn(i,n) cin>>a[i]; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); const int inf = 1e18; const int mod = 1e9+7;//998244353; // \ \ :smiling_face_with_3_hearts: :smiling_face_with_3_hearts: :smiling_face_with_3_hearts: //vidime sa veľmi skoro, moje slnko void solve() { int n, q; cin>>n>>q; vector<pi> a(n); forn(i,n) cin>>a[i].f>>a[i].s; forn(i,q) { int r,v; cin>>r>>v; int last=0; for (int j=r-1; j<n; ++j) { //cout<<"? "<<a[i].f<<' '<<last<<'\n'; if (a[j].f > last) { //cout<<"! "<<i<<' '<<v<<'\n'; v-=a[j].s; last=a[j].f; if (v<=0) { cout<<j+1<<'\n'; break; } } } if (v>0) cout<<"0\n"; } } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; //cin>>t; while (t--) solve(); return 0; }

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

fountain.cpp:3:1: warning: multi-line comment [-Wcomment]
    3 | //\
      | ^
fountain.cpp:9:1: warning: multi-line comment [-Wcomment]
    9 | //   \ __ __  \
      | ^
fountain.cpp:36:1: warning: multi-line comment [-Wcomment]
   36 | // \
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...