結果
問題 |
No.313 π
|
ユーザー |
![]() |
提出日時 | 2018-11-03 09:05:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 7 ms / 5,000 ms |
コード長 | 713 bytes |
コンパイル時間 | 1,064 ms |
コンパイル使用メモリ | 95,556 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-20 18:26:01 |
合計ジャッジ時間 | 3,043 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 32 |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { int inv[11]={0, 1, 6, 4, 3, 9, 2, 8, 7, 5, 10}; string s; cin>>s; int s1=0, s2=0; for(int i=0; i<s.size(); i++){ if(i!=1){ int a=s[i]-'0'; s1+=a; s1%=11; s2+=(a*a); s2%=11; } } int d1=(s1+1)%11, d2=(s2+3)%11; int d3=d2*inv[d1]%11; cout<<(d1+d3)*inv[2]%11<<" "<<(d3-d1+11)*inv[2]%11<<endl; return 0; }