<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>physics on The Site of laekov</title>
    <link>/tags/physics/</link>
    <description>Recent content in physics on The Site of laekov</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>&amp;copy; laekov</copyright>
    <lastBuildDate>Sun, 25 Jan 2015 21:33:41 +0000</lastBuildDate><atom:link href="/tags/physics/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>BZOJ2419 电阻</title>
      <link>/oi/i11rimport_078/</link>
      <pubDate>Sun, 25 Jan 2015 21:33:41 +0000</pubDate>
      
      <guid>/oi/i11rimport_078/</guid>
      <description>&amp;lt;div class=&amp;quot;post_brief&amp;quot;&amp;gt;&amp;lt;p&amp;gt; 记得这是高一的时候ty同学和我说的东西了。然后现在才解决，可以打败上帝造题的七分钟，荣登解决时间最长的题目了。&amp;lt;/p&amp;gt; &amp;nbsp;
其实也就是一个高斯消元，用电势来列方程。不过高斯消元写得不熟，平时有空都写ds的题去了。以后不能再这样了。
&amp;nbsp;
用自己的代码高亮脚本了，虽然还不完善不过还是很开心的。
&amp;nbsp;
#include &amp;lt;cstdio&amp;gt; #include &amp;lt;cstring&amp;gt; #include &amp;lt;cmath&amp;gt; #include &amp;lt;cstdlib&amp;gt; #include &amp;lt;algorithm&amp;gt; using namespace std;
const int maxn = 109; const double inf = 1e100; const double eps = 1e-8;
double x[maxn], a[maxn][maxn], b[maxn][maxn]; int n, m, perm[maxn];
int main() { #ifndef ONLINE_JUDGE freopen(&amp;ldquo;in.txt&amp;rdquo;, &amp;ldquo;r&amp;rdquo;, stdin); #endif
srand(19970911); while (scanf(&amp;quot;%d%d&amp;quot;, &amp;amp;amp;n, &amp;amp;amp;m) != EOF) { for (int i = 1; i &amp;amp;lt;= n; ++ i) perm[i] = i; if (n &amp;amp;gt; 2) random_shuffle(perm + 2, perm + n); for (int i = 1; i &amp;amp;lt;= n; ++ i) for (int j = 1; j &amp;amp;lt;= n; ++ j) if (i == j) a[i][j] = 0; else a[i][j] = inf; while (m --) { int u, v; double p; scanf(&amp;quot;%d%d%lf&amp;quot;, &amp;amp;amp;u, &amp;amp;amp;v, &amp;amp;amp;p); u = perm[u]; v = perm[v]; if (u == v) continue; a[u][v] = 1.</description>
    </item>
    
  </channel>
</rss>
