Submission #667539

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6675392022-12-01 17:07:18berrFancy Fence (CEOI20_fancyfence)C++17
100 / 100
278 ms7508 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+37;
int p[N], vis[N], length[N];
int sum, ans=0, mod=1e9+7;
int s(int x, int y){
return ((x+y)%mod+mod)%mod;
}
int mul(int x, int y){
return (x*y)%mod;
}
int poww(int x, int y){
if(y==0) return 1;
int tmp=poww(x, y/2);
if(y&1) return mul(tmp, mul(tmp, x));
return mul(tmp, tmp);
}
int val(int x){
return mul(mul(x, (x+1)), poww(2, mod-2));
}
int find(int x){
return (p[x]!=x)?p[x]=find(p[x]):x;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

fancyfence.cpp: In function 'int main()':
fancyfence.cpp:71:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::array<long long int, 3> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |     for(int i=0; i<a.size()-1; i++)
      |                  ~^~~~~~~~~~~
fancyfence.cpp:73:24: warning: unused variable 'len' [-Wunused-variable]
   73 |         int p=a[i][2], len=a[i][1], h=a[i][0];
      |                        ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...