제출 #473308

#제출 시각아이디문제언어결과실행 시간메모리
473308Ahmed_SolymanGaraža (COCI17_garaza)C++14
0 / 160
4083 ms2192 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n,q;cin>>n>>q; ll arr[n]; for(auto &i:arr)cin>>i; while(q--){ ll type;cin>>type; if(type==1){ ll i,v;cin>>i>>v; arr[i-1]=v; } else{ ll l,r;cin>>l>>r; ll ans=0; vector<ll>v; l--;r--; for(ll i=l;i<=r;i++){ v.push_back(arr[i]); } for(ll i=0;i<v.size();i++){ ll gcd=0; for(ll j=i;j<v.size();j++){ gcd=__gcd(gcd,v[j]); ans+=(gcd>1); } } cout<<ans<<endl; } } return 0; }

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

garaza.cpp: In function 'int main()':
garaza.cpp:26:25: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |             for(ll i=0;i<v.size();i++){
      |                        ~^~~~~~~~~
garaza.cpp:28:29: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |                 for(ll j=i;j<v.size();j++){
      |                            ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...