Submission #118598

#TimeUsernameProblemLanguageResultExecution timeMemory
118598roseanne_pcyPinball (JOI14_pinball)C++14
0 / 100
2 ms356 KiB
#include <bits/stdc++.h> #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; #define X first #define Y second #define pb push_back typedef pair<int, int> ii; typedef long long ll; const int maxn = 1e5+5; int n, m; int A[maxn], B[maxn], C[maxn], pay[maxn]; vector<int> cut; map<int, int> bst; struct node { ll L, R, fill; node(){} node(ll L, ll R, ll fill) : L(L), R(R), fill(fill){} }; node st[12*maxn]; int main() { scanf("%d %d", &n, &m); for(int i = 1; i<= n; i++) { scanf("%d %d %d %d", &A[i], &B[i], &C[i], &pay[i]); cut.pb(A[i]); cut.pb(B[i]); cut.pb(C[i]); } sort(cut.begin(), cut.end()); cut.resize(unique(cut.begin(), cut.end())-cut.begin()); int cnt = 0; if(cut[0] != 1) cnt++; for(int x : cut) { cnt++; bst[x] = cnt; } if(cut.back() != m) cnt++; for(int i = 1; i<= n; i++) { A[i] = bst[A[i]]; B[i] = bst[B[i]]; C[i] = bst[C[i]]; } }

Compilation message (stderr)

pinball.cpp: In function 'int main()':
pinball.cpp:29:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
  ~~~~~^~~~~~~~~~~~~~~~~
pinball.cpp:32:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d %d", &A[i], &B[i], &C[i], &pay[i]);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...