Submission #994335

#TimeUsernameProblemLanguageResultExecution timeMemory
994335tosivanmakMagic Show (APIO24_show)C++17
100 / 100
3 ms944 KiB
#include "Alice.h" #include <bits/stdc++.h> #define ll long long using namespace std; vector<pair<int, int>> Alice() { ll x=setN(5000); vector<pair<int,int> >edges; for(int i=2;i<=5000;i++){ edges.push_back({i,x%(i-1)+1}); } return edges; }
#include <bits/stdc++.h> #include "Bob.h" #define ll long long using namespace std; long long Bob(vector<pair<int,int>> v) { for(int i=0;i<v.size();i++){ v[i].first--,v[i].second--; if(v[i].first<v[i].second){ swap(v[i].first,v[i].second); } } sort(v.begin(),v.end()); ll val=-1,add; for(int i=0;i<v.size();i++){ if(val==-1){val=v[i].second;add=v[i].first;} else{ while(val%v[i].first!=v[i].second){ val+=add; } add=lcm(add,v[i].first); } } return val; }

Compilation message (stderr)

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:7:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |   for(int i=0;i<v.size();i++){
      |               ~^~~~~~~~~
Bob.cpp:15:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |   for(int i=0;i<v.size();i++){
      |               ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...