結果
問題 | No.1262 グラフを作ろう! |
ユーザー | kiyoshi0205 |
提出日時 | 2020-10-16 23:19:27 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 2,345 bytes |
コンパイル時間 | 2,431 ms |
コンパイル使用メモリ | 184,836 KB |
実行使用メモリ | 121,728 KB |
最終ジャッジ日時 | 2024-07-21 00:01:55 |
合計ジャッジ時間 | 238,666 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2,442 ms
121,628 KB |
testcase_01 | AC | 2,529 ms
121,600 KB |
testcase_02 | AC | 2,568 ms
121,636 KB |
testcase_03 | AC | 2,383 ms
121,600 KB |
testcase_04 | AC | 2,141 ms
121,600 KB |
testcase_05 | AC | 2,325 ms
121,600 KB |
testcase_06 | AC | 2,128 ms
121,600 KB |
testcase_07 | AC | 2,131 ms
121,564 KB |
testcase_08 | AC | 2,315 ms
121,520 KB |
testcase_09 | AC | 2,414 ms
121,504 KB |
testcase_10 | AC | 2,265 ms
121,600 KB |
testcase_11 | AC | 2,458 ms
121,524 KB |
testcase_12 | AC | 2,611 ms
121,628 KB |
testcase_13 | AC | 2,520 ms
121,716 KB |
testcase_14 | AC | 2,203 ms
121,600 KB |
testcase_15 | AC | 2,151 ms
121,632 KB |
testcase_16 | AC | 2,385 ms
121,616 KB |
testcase_17 | AC | 2,365 ms
121,644 KB |
testcase_18 | AC | 2,490 ms
121,600 KB |
testcase_19 | AC | 2,098 ms
121,600 KB |
testcase_20 | AC | 2,090 ms
121,636 KB |
testcase_21 | AC | 2,473 ms
121,636 KB |
testcase_22 | AC | 2,157 ms
121,728 KB |
testcase_23 | AC | 2,299 ms
121,600 KB |
testcase_24 | AC | 2,351 ms
121,696 KB |
testcase_25 | AC | 2,075 ms
121,728 KB |
testcase_26 | AC | 2,148 ms
121,632 KB |
testcase_27 | AC | 2,149 ms
121,728 KB |
testcase_28 | AC | 2,079 ms
121,560 KB |
testcase_29 | AC | 2,064 ms
121,600 KB |
testcase_30 | AC | 2,198 ms
121,540 KB |
testcase_31 | AC | 2,521 ms
121,528 KB |
testcase_32 | AC | 2,296 ms
121,632 KB |
testcase_33 | AC | 2,104 ms
121,516 KB |
testcase_34 | AC | 2,210 ms
121,684 KB |
testcase_35 | AC | 2,342 ms
121,692 KB |
testcase_36 | AC | 2,170 ms
121,532 KB |
testcase_37 | AC | 2,496 ms
121,580 KB |
testcase_38 | AC | 2,245 ms
121,596 KB |
testcase_39 | AC | 2,235 ms
121,504 KB |
testcase_40 | AC | 2,252 ms
121,728 KB |
testcase_41 | AC | 2,097 ms
121,600 KB |
testcase_42 | AC | 2,289 ms
121,592 KB |
testcase_43 | AC | 2,197 ms
121,728 KB |
testcase_44 | AC | 2,294 ms
121,508 KB |
testcase_45 | AC | 2,311 ms
121,544 KB |
testcase_46 | AC | 2,037 ms
121,500 KB |
testcase_47 | AC | 2,221 ms
121,728 KB |
testcase_48 | AC | 2,326 ms
121,600 KB |
testcase_49 | AC | 2,428 ms
121,728 KB |
testcase_50 | AC | 2,400 ms
121,628 KB |
testcase_51 | AC | 2,261 ms
121,536 KB |
testcase_52 | AC | 2,159 ms
121,700 KB |
testcase_53 | AC | 2,119 ms
121,720 KB |
testcase_54 | AC | 2,415 ms
121,728 KB |
testcase_55 | AC | 2,209 ms
121,600 KB |
testcase_56 | AC | 2,172 ms
121,632 KB |
testcase_57 | AC | 2,573 ms
121,508 KB |
testcase_58 | AC | 2,515 ms
121,580 KB |
testcase_59 | AC | 2,374 ms
121,600 KB |
testcase_60 | AC | 2,692 ms
121,632 KB |
testcase_61 | AC | 2,228 ms
121,580 KB |
testcase_62 | AC | 2,457 ms
121,728 KB |
testcase_63 | AC | 2,398 ms
121,688 KB |
testcase_64 | AC | 2,298 ms
121,728 KB |
testcase_65 | AC | 2,239 ms
121,508 KB |
testcase_66 | AC | 2,238 ms
121,596 KB |
testcase_67 | AC | 2,155 ms
121,600 KB |
testcase_68 | AC | 2,131 ms
121,588 KB |
testcase_69 | AC | 2,336 ms
121,556 KB |
testcase_70 | AC | 2,426 ms
121,616 KB |
testcase_71 | AC | 2,398 ms
121,572 KB |
testcase_72 | AC | 2,409 ms
121,728 KB |
testcase_73 | AC | 2,407 ms
121,632 KB |
testcase_74 | AC | 2,245 ms
121,636 KB |
testcase_75 | AC | 2,351 ms
121,728 KB |
testcase_76 | AC | 2,320 ms
121,692 KB |
testcase_77 | AC | 2,474 ms
121,632 KB |
testcase_78 | AC | 2,473 ms
121,632 KB |
testcase_79 | AC | 2,555 ms
121,600 KB |
testcase_80 | AC | 2,366 ms
121,596 KB |
testcase_81 | AC | 2,527 ms
121,728 KB |
testcase_82 | AC | 2,518 ms
121,520 KB |
testcase_83 | AC | 2,658 ms
121,636 KB |
testcase_84 | AC | 2,442 ms
121,704 KB |
testcase_85 | AC | 2,742 ms
121,728 KB |
testcase_86 | AC | 2,560 ms
121,600 KB |
testcase_87 | AC | 2,622 ms
121,728 KB |
testcase_88 | AC | 2,490 ms
121,636 KB |
testcase_89 | AC | 2,477 ms
121,556 KB |
testcase_90 | AC | 2,318 ms
121,608 KB |
testcase_91 | AC | 2,183 ms
121,504 KB |
testcase_92 | AC | 2,372 ms
121,632 KB |
testcase_93 | AC | 2,683 ms
121,628 KB |
testcase_94 | TLE | - |
testcase_95 | AC | 2,549 ms
121,600 KB |
ソースコード
#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // #include<ext/pb_ds/tag_and_trait.hpp> // using namespace __gnu_pbds; // #include<boost/multiprecision/cpp_int.hpp> // namespace multiprecisioninteger = boost::multiprecision; // using cint=multiprecisioninteger::cpp_int; using namespace std; using ll=long long; #define double long double using datas=pair<ll,ll>; using ddatas=pair<double,double>; using tdata=pair<ll,datas>; using vec=vector<ll>; using mat=vector<vec>; using pvec=vector<datas>; using pmat=vector<pvec>; // using llset=tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>; #define For(i,a,b) for(i=a;i<(ll)b;++i) #define bFor(i,b,a) for(i=b,--i;i>=(ll)a;--i) #define rep(i,N) For(i,0,N) #define rep1(i,N) For(i,1,N) #define brep(i,N) bFor(i,N,0) #define brep1(i,N) bFor(i,N,1) #define all(v) (v).begin(),(v).end() #define allr(v) (v).rbegin(),(v).rend() #define vsort(v) sort(all(v)) #define vrsort(v) sort(allr(v)) #define endl "\n" #define eb emplace_back #define print(x) cout<<x<<endl #define printyes print("Yes") #define printno print("No") #define printYES print("YES") #define printNO print("NO") #define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0) #define matoutput(v) do{for(auto outimat:v)output(outimat);}while(0) const ll mod=1000000007; // const ll mod=998244353; const ll inf=1LL<<60; const double PI=acos(-1); const double eps=1e-9; template<class T,class E> ostream& operator<<(ostream& os,pair<T,E>& p){return os<<"{"<<p.first<<","<<p.second<<"}";} template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} void startupcpp(){ cin.tie(0); ios::sync_with_stdio(false); cout<<fixed<<setprecision(15); } int M,phi[1000001]; ll ans; vector<int> divisor[1000001]; int main(){ startupcpp(); int i,j; for(i=1;i<1000001;++i){ phi[i]=i-phi[i]; for(j=i;j<1000001;j+=i){ divisor[j].eb(i); if(j!=i)phi[j]+=phi[i]; } } cin>>M>>M; while(M--){ cin>>i; // ans=0; for(auto d:divisor[i]){ ans+=(i-1)%d*phi[i/d]; } // print(ans); } print(ans); }