結果
問題 | No.1992 Tendon Walk |
ユーザー |
|
提出日時 | 2024-07-02 16:26:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 1,464 bytes |
コンパイル時間 | 864 ms |
コンパイル使用メモリ | 106,152 KB |
最終ジャッジ日時 | 2025-02-22 01:50:28 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#define _USE_MATH_DEFINES#include <cmath>#include <cstdio>#include <vector>#include <iostream>#include <algorithm>#include <string>#include<math.h>#include<iomanip>#include<stdio.h>#include <stdlib.h>#include<stdio.h>#include <queue>#include<map>#include <fstream>#include <sstream>#include<set>#include<stack>#include<time.h>#include <sys/types.h>#include <tuple>#include <numeric>typedef long long int ll;//#include<bits/stdc++.h>using namespace std;int64_t modpow(int64_t x, int64_t n, int64_t MOD) {x = x % MOD;if (n == 0) return 1; //再帰の終了条件else if (n % 2 == 1) {return (x * modpow(x, n - 1,MOD)) % MOD; //nが奇数ならnを1ずらす}else return modpow((x * x) % MOD, n / 2,MOD) % MOD; //nが偶数ならnが半分になる}int X[200009];vector<int>g[200009];bool bipartite = true;void dfs(int c, int x) {X[c] = x;for (auto& d : g[c]) {if (X[d] == -1) {dfs(d, 1 - x);}else if (X[d] == X[c]) {bipartite = false;}}}int main(){int Q;Q = 1;//cin >> Q;while (Q--) {int n;cin >> n;int t = 0;int a = 0;int r = 0;while (t!=n) {if (r == 2 || r == 3 || r == 5 || r == 6)t--;else { t += 2; a++; }a++; r++;r %= 7;}cout << a;}return 0;}