#include #define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(long long int i=(a);i<(b);i++) #define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Abs(a,b) max(a,b)-min(a,b) #define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;} #define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;} #define Cout(x) cout<<(x)<1){ cmp=(cmp*hh)%MOD; hh--; } return cmp; } long long int ruizyo(long long int aa, long long int bb){ if(aa==0){ return 1; } else if(aa%2==0){ long long int tt=ruizyo(aa/2,bb); return (tt*tt)%MOD; } else{ return (ruizyo(aa-1,bb)*bb)%MOD; } }フェルマ-のア --------------------------------------------------------------- while(x!=0){ sum+=x%10; / x/=10; } 各桁の和 --------------------------------------------------------------- pair p[100000]; cin >> tmp; p[i]=make_pair(tmp,i); cout << p[i].second+1 << endl;//ペアの右側つまりiを出力 --------------------------------------------------------------- bool f[100001];//1000000以下の素数を調べよう! rrep(i,2,100001){ f[i]=false; } rrep(i,2,100001){ if(!f[i]){ for(int j=i+i;j<=100000;j+=i){ f[j]=true; } } } for(int i=3;i<=100000;i+=2){ if(!f[i]){ c[i]++; } } --------------------------------------------------------------- long long gcd(long long aaa,long long bbb){ if(bbb==0){ return aaa; } return gcd(bbb,aaa%bbb); } long long lcm(long long aaa,long long bbb){ long long g = gcd(aaa,bbb); return aaa/g * bbb; }左から最大公約数と最小公倍数 --------------------------------------------------------------- long long int prime_cnt[10000]; for(int i=2;i*i<=n;i++){ while(n%i==0){ n/=i; prime_cnt[i]+=1; } if(n>1){ prime_cnt[n]+=1; break; } }ある数nを素因数分解しましょう --------------------------------------------------------------- debug: cout<<"i: "<>a>>b>>s; cmp=0; cmpp=0; rep(i,Size(s)){ if(s[i]=='.')fl=false; } cnt=1; if(fl){ rrrep(i,Size(s)-1,4){ cmp+=(s[i]-'0')*cnt; cnt*=10; } if(s[3]=='-')cmp*=-1; cmp-=9; if(a+cmp<0){ a=24+(a+cmp); } else if(a+cmp>=24){ a=a+cmp-24; } else{ a+=cmp; } if(a<=9)cout<<0; cout<=24){ a=a+cmp-24; } else{ a+=cmp; } if((double)b+time<0){ anss=(double)60+(b+time); if(a-1<0){ a=24-1; } else{ a-=1; } } else if((double)b+time>=60){ anss=b+time-60; if(a+1>=24){ a=0; } else{ a+=1; } } else{ anss=b+time; } pos=(ll)anss; // Cout(pos); if(pos>=59){ pos=b+time-60; if(a+1>=24){ a=0; } else{ a+=1; } if(a<=9)cout<<0; cout<