結果
問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
ユーザー |
|
提出日時 | 2014-11-28 02:03:23 |
言語 | Ruby (3.4.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 457 bytes |
コンパイル時間 | 40 ms |
コンパイル使用メモリ | 8,064 KB |
実行使用メモリ | 23,680 KB |
最終ジャッジ日時 | 2025-02-07 08:40:57 |
合計ジャッジ時間 | 4,457 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 30 |
コンパイルメッセージ
Main.rb:1: warning: shebang line ending with \r may cause problems Syntax OK
ソースコード
#!/usr/bin/ruby IO.popen('gcc -xc -ozzz - -lquadmath','w'){|io| io.puts <<EOM #include <stdio.h> #include <quadmath.h> char buf[99]; int main(){ int N,i=0; scanf("%d",&N); __float128 s=0; for(;i<N;i++){ scanf("%s",buf); s+=strtoflt128(buf,NULL); } quadmath_snprintf(buf,sizeof(buf),"%.10Qf",s); puts(buf); return 0; } EOM } IO.popen('./zzz','r+'){|io| io.write $<.read io.close_write puts io.read } File.unlink('zzz')